summaryrefslogtreecommitdiff
path: root/mbr/mbr.ha
diff options
context:
space:
mode:
authorAlejandro Sior <aho@sior.be>2022-06-17 14:43:27 +0200
committerAlejandro Sior <aho@sior.be>2022-06-17 14:43:27 +0200
commit12577f3445df86023ba0cbe2462d55ea5dcafe20 (patch)
treee72d03b6339084760d4c781cbbb5e7e4dd71385d /mbr/mbr.ha
parent3c8602ee9f04991e1d60b8d6504e12296ca671d9 (diff)
gptman: now can allocate partitions
Diffstat (limited to 'mbr/mbr.ha')
-rw-r--r--mbr/mbr.ha19
1 files changed, 0 insertions, 19 deletions
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)?;
-};