diff options
| author | Alejandro Sior <aho@sior.be> | 2022-06-17 14:43:27 +0200 |
|---|---|---|
| committer | Alejandro Sior <aho@sior.be> | 2022-06-17 14:43:27 +0200 |
| commit | 12577f3445df86023ba0cbe2462d55ea5dcafe20 (patch) | |
| tree | e72d03b6339084760d4c781cbbb5e7e4dd71385d /mbr | |
| parent | 3c8602ee9f04991e1d60b8d6504e12296ca671d9 (diff) | |
gptman: now can allocate partitions
Diffstat (limited to 'mbr')
| -rw-r--r-- | mbr/mbr.ha | 19 |
1 files changed, 0 insertions, 19 deletions
@@ -29,22 +29,3 @@ export fn validate(self: *mbr) bool = { return true; }; - -// Gets a handle to the MBR of a partition. -// Return value is returned to user. Resource should be freed with mbr::finish. -export fn from(fd: io::file) (*mbr | nombr | errors::error) = { - const self = io::mmap(null, sector::length, io::prot::READ | io::prot::WRITE, io::mflags::SHARED, fd, sector::lba(mbr_lba))!: *mbr; - - if (!validate(self)) { - io::munmap(self, sector::length)?; - return nombr; - }; - - return self; -}; - -// Frees the resources associated with the MBR partition. -// User revokes ownership. -export fn finish(self: *mbr) (void | errors::error) = { - io::munmap(self, sector::length)?; -}; |
