mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-29 12:49:08 +00:00
Add a VFS::absolutePath(InodeIdentifier).
This is pretty inefficient for ext2fs. We walk the entire block group containing the inode, searching through every directory for an entry referencing this inode. It might be a good idea to cache this information somehow. I'm not sure how often we'll be searching for it. Obviously there are multiple caching layers missing in the file system.
This commit is contained in:
@@ -66,7 +66,7 @@ public:
|
||||
VirtualFileSystem();
|
||||
~VirtualFileSystem();
|
||||
|
||||
bool isDirectory(const String& path, Node* base = nullptr);
|
||||
bool isDirectory(const String& path, InodeIdentifier base = InodeIdentifier());
|
||||
void listDirectory(const String& path);
|
||||
void listDirectoryRecursively(const String& path);
|
||||
|
||||
@@ -79,9 +79,9 @@ public:
|
||||
bool mountRoot(RetainPtr<FileSystem>&&);
|
||||
bool mount(RetainPtr<FileSystem>&&, const String& path);
|
||||
|
||||
OwnPtr<FileHandle> open(const String& path, Node* base = nullptr);
|
||||
OwnPtr<FileHandle> create(const String& path, Node* base = nullptr);
|
||||
OwnPtr<FileHandle> mkdir(const String& path, Node* base = nullptr);
|
||||
OwnPtr<FileHandle> open(const String& path, InodeIdentifier base = InodeIdentifier());
|
||||
OwnPtr<FileHandle> create(const String& path, InodeIdentifier base = InodeIdentifier());
|
||||
OwnPtr<FileHandle> mkdir(const String& path, InodeIdentifier base = InodeIdentifier());
|
||||
|
||||
bool isRoot(InodeIdentifier) const;
|
||||
|
||||
@@ -92,12 +92,13 @@ public:
|
||||
size_t mountCount() const { return m_mounts.size(); }
|
||||
void forEachMount(Function<void(const Mount&)>) const;
|
||||
|
||||
String absolutePath(InodeIdentifier);
|
||||
|
||||
private:
|
||||
friend class FileHandle;
|
||||
|
||||
void enumerateDirectoryInode(InodeIdentifier, Function<bool(const FileSystem::DirectoryEntry&)>);
|
||||
String absolutePath(InodeIdentifier);
|
||||
InodeIdentifier resolvePath(const String& path, Node* base = nullptr);
|
||||
InodeIdentifier resolvePath(const String& path, InodeIdentifier base = InodeIdentifier());
|
||||
InodeIdentifier resolveSymbolicLink(const String& basePath, InodeIdentifier symlinkInode);
|
||||
|
||||
RetainPtr<Node> allocateNode();
|
||||
|
||||
Reference in New Issue
Block a user