mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 22:24:57 +00:00
Add metadata to CoreInode.
This commit is contained in:
parent
10c470e95f
commit
26852a8363
5 changed files with 42 additions and 25 deletions
|
@ -77,7 +77,7 @@ auto VirtualFileSystem::makeNode(InodeIdentifier inode) -> RetainPtr<Node>
|
|||
|
||||
vnode->inode = inode;
|
||||
vnode->m_core_inode = move(core_inode);
|
||||
vnode->m_cachedMetadata = { };
|
||||
vnode->m_cachedMetadata = metadata;
|
||||
|
||||
#ifdef VFS_DEBUG
|
||||
kprintf("makeNode: inode=%u, size=%u, mode=%o, uid=%u, gid=%u\n", inode.index(), metadata.size, metadata.mode, metadata.uid, metadata.gid);
|
||||
|
@ -158,7 +158,7 @@ bool VirtualFileSystem::mountRoot(RetainPtr<FileSystem>&& fileSystem)
|
|||
kprintf("VFS: root inode for / is not in use :(\n");
|
||||
return false;
|
||||
}
|
||||
if (!node->inode.metadata().isDirectory()) {
|
||||
if (!node->metadata().isDirectory()) {
|
||||
kprintf("VFS: root inode for / is not a directory :(\n");
|
||||
return false;
|
||||
}
|
||||
|
@ -580,6 +580,8 @@ void VirtualFileSystem::Node::release()
|
|||
|
||||
const InodeMetadata& VirtualFileSystem::Node::metadata() const
|
||||
{
|
||||
if (m_core_inode)
|
||||
return m_core_inode->metadata();
|
||||
if (!m_cachedMetadata.isValid())
|
||||
m_cachedMetadata = inode.metadata();
|
||||
return m_cachedMetadata;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue