mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:37:35 +00:00
Kernel: Remove the now-unused FS::DirectoryEntry
This object was cumbersome and annoying (mostly due to its manually managed, statically sized name buffer.) And now we no longer need it!
This commit is contained in:
parent
6ad2d31952
commit
71e8554740
2 changed files with 0 additions and 30 deletions
|
@ -65,26 +65,6 @@ FS* FS::from_fsid(u32 id)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
FS::DirectoryEntry::DirectoryEntry(const char* n, InodeIdentifier i, u8 ft)
|
|
||||||
: name_length(strlen(n))
|
|
||||||
, inode(i)
|
|
||||||
, file_type(ft)
|
|
||||||
{
|
|
||||||
ASSERT(name_length < (int)sizeof(name));
|
|
||||||
memcpy(name, n, name_length);
|
|
||||||
name[name_length] = '\0';
|
|
||||||
}
|
|
||||||
|
|
||||||
FS::DirectoryEntry::DirectoryEntry(const char* n, size_t nl, InodeIdentifier i, u8 ft)
|
|
||||||
: name_length(nl)
|
|
||||||
, inode(i)
|
|
||||||
, file_type(ft)
|
|
||||||
{
|
|
||||||
ASSERT(name_length < (int)sizeof(name));
|
|
||||||
memcpy(name, n, nl);
|
|
||||||
name[nl] = '\0';
|
|
||||||
}
|
|
||||||
|
|
||||||
FS::DirectoryEntryView::DirectoryEntryView(const StringView& n, InodeIdentifier i, u8 ft)
|
FS::DirectoryEntryView::DirectoryEntryView(const StringView& n, InodeIdentifier i, u8 ft)
|
||||||
: name(n)
|
: name(n)
|
||||||
, inode(i)
|
, inode(i)
|
||||||
|
|
|
@ -69,16 +69,6 @@ public:
|
||||||
|
|
||||||
virtual KResult prepare_to_unmount() const { return KSuccess; }
|
virtual KResult prepare_to_unmount() const { return KSuccess; }
|
||||||
|
|
||||||
// FIXME: This data structure is very clunky and unpleasant. Replace it with something nicer.
|
|
||||||
struct DirectoryEntry {
|
|
||||||
DirectoryEntry(const char* name, InodeIdentifier, u8 file_type);
|
|
||||||
DirectoryEntry(const char* name, size_t name_length, InodeIdentifier, u8 file_type);
|
|
||||||
char name[256];
|
|
||||||
size_t name_length { 0 };
|
|
||||||
InodeIdentifier inode;
|
|
||||||
u8 file_type { 0 };
|
|
||||||
};
|
|
||||||
|
|
||||||
struct DirectoryEntryView {
|
struct DirectoryEntryView {
|
||||||
DirectoryEntryView(const StringView& name, InodeIdentifier, u8 file_type);
|
DirectoryEntryView(const StringView& name, InodeIdentifier, u8 file_type);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue