mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 03:09:08 +00:00
Kernel: Add DirectoryEntryView for VFS directory traversal
Unlike DirectoryEntry (which is used when constructing directories), DirectoryEntryView does not manage storage for file names. Names are just StringViews. This is much more suited to the directory traversal API and makes it easier to implement this in file system classes since they no longer need to create temporary name copies while traversing.
This commit is contained in:
@@ -85,6 +85,13 @@ FS::DirectoryEntry::DirectoryEntry(const char* n, size_t nl, InodeIdentifier i,
|
||||
name[nl] = '\0';
|
||||
}
|
||||
|
||||
FS::DirectoryEntryView::DirectoryEntryView(const StringView& n, InodeIdentifier i, u8 ft)
|
||||
: name(n)
|
||||
, inode(i)
|
||||
, file_type(ft)
|
||||
{
|
||||
}
|
||||
|
||||
void FS::sync()
|
||||
{
|
||||
Inode::sync();
|
||||
|
||||
Reference in New Issue
Block a user