mirror of
https://github.com/RGBCube/serenity
synced 2025-05-19 00:55: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:
parent
8abf5048b8
commit
eeaba41d13
16 changed files with 61 additions and 53 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue