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:
Andreas Kling 2020-08-18 12:41:27 +02:00
commit eeaba41d13
Notes: sideshowbarker 2024-07-19 03:26:18 +09:00
16 changed files with 61 additions and 53 deletions

View file

@ -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();