From 12577f3445df86023ba0cbe2462d55ea5dcafe20 Mon Sep 17 00:00:00 2001 From: Alejandro Sior Date: Fri, 17 Jun 2022 14:43:27 +0200 Subject: gptman: now can allocate partitions --- mbr/mbr.ha | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'mbr') diff --git a/mbr/mbr.ha b/mbr/mbr.ha index ceb115f..d0622d2 100644 --- a/mbr/mbr.ha +++ b/mbr/mbr.ha @@ -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)?; -}; -- cgit v1.2.3