MCPcopy Create free account
hub / github.com/Bananymous/banan-os / find_block_device_by_name

Function find_block_device_by_name

kernel/kernel/FS/VirtualFileSystem.cpp:47–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45 }
46
47 static BAN::ErrorOr<BAN::RefPtr<BlockDevice>> find_block_device_by_name(BAN::StringView name)
48 {
49 auto device_inode = TRY(DevFileSystem::get().root_inode()->find_inode(name));
50 if (!device_inode->mode().ifblk())
51 return BAN::Error::from_errno(ENOTBLK);
52 return BAN::RefPtr<BlockDevice>(static_cast<BlockDevice*>(device_inode.ptr()));
53 }
54
55 static BAN::RefPtr<FileSystem> load_fallback_root_filesystem()
56 {

Callers 1

load_root_filesystemFunction · 0.85

Calls 5

ifblkMethod · 0.80
modeMethod · 0.80
find_inodeMethod · 0.45
root_inodeMethod · 0.45
ptrMethod · 0.45

Tested by

no test coverage detected