Inode parsing works!

This commit is contained in:
Caleb Gardner
2025-05-14 05:16:12 -05:00
parent 3684a958a0
commit b0c71c59f8
5 changed files with 64 additions and 48 deletions
+4 -4
View File
@@ -1,9 +1,9 @@
const std = @import("std");
pub const InodeRef = packed struct {
_: u16,
block_start: u32,
offset: u16,
block_start: u32,
_: u16,
};
pub const InodeType = enum(u16) {
@@ -67,10 +67,10 @@ pub fn readInode(rdr: io.AnyReader, block_size: u32, alloc: std.mem.Allocator) !
.header = hdr,
.data = switch (hdr.inode_type) {
.dir => .{
.dir = try dir.readDirInode(rdr),
.dir = try .init(rdr),
},
.ext_dir => .{
.ext_dir = try dir.readExtDirInode(rdr, alloc),
.ext_dir = try .init(rdr, alloc),
},
.file => .{
.file = try file.readFileInode(rdr, block_size, alloc),