mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 23:09:08 +00:00
Remove InodeIdentifier::metadata().
This commit is contained in:
parent
3a0a8848fb
commit
951ed6692b
Notes:
sideshowbarker
2024-07-19 16:07:40 +09:00
Author: https://github.com/awesomekling
Commit: 951ed6692b
3 changed files with 6 additions and 14 deletions
|
@ -121,13 +121,6 @@ inline const FS* InodeIdentifier::fs() const
|
||||||
return FS::from_fsid(m_fsid);
|
return FS::from_fsid(m_fsid);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline InodeMetadata InodeIdentifier::metadata() const
|
|
||||||
{
|
|
||||||
if (!is_valid())
|
|
||||||
return InodeMetadata();
|
|
||||||
return fs()->inode_metadata(*this);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline bool InodeIdentifier::is_root_inode() const
|
inline bool InodeIdentifier::is_root_inode() const
|
||||||
{
|
{
|
||||||
return (*this) == fs()->root_inode();
|
return (*this) == fs()->root_inode();
|
||||||
|
|
|
@ -33,7 +33,6 @@ public:
|
||||||
return m_fsid != other.m_fsid || m_index != other.m_index;
|
return m_fsid != other.m_fsid || m_index != other.m_index;
|
||||||
}
|
}
|
||||||
|
|
||||||
InodeMetadata metadata() const;
|
|
||||||
bool is_root_inode() const;
|
bool is_root_inode() const;
|
||||||
|
|
||||||
ByteBuffer read_entire_file() const;
|
ByteBuffer read_entire_file() const;
|
||||||
|
|
|
@ -390,7 +390,9 @@ InodeIdentifier VFS::resolve_path(const String& path, InodeIdentifier base, int&
|
||||||
auto& part = parts[i];
|
auto& part = parts[i];
|
||||||
if (part.is_empty())
|
if (part.is_empty())
|
||||||
break;
|
break;
|
||||||
auto metadata = crumb_id.metadata();
|
auto crumb_inode = get_inode(crumb_id);
|
||||||
|
ASSERT(crumb_inode);
|
||||||
|
auto metadata = crumb_inode->metadata();
|
||||||
if (!metadata.isValid()) {
|
if (!metadata.isValid()) {
|
||||||
#ifdef VFS_DEBUG
|
#ifdef VFS_DEBUG
|
||||||
kprintf("invalid metadata\n");
|
kprintf("invalid metadata\n");
|
||||||
|
@ -406,8 +408,7 @@ InodeIdentifier VFS::resolve_path(const String& path, InodeIdentifier base, int&
|
||||||
return { };
|
return { };
|
||||||
}
|
}
|
||||||
auto parent = crumb_id;
|
auto parent = crumb_id;
|
||||||
auto dir_inode = get_inode(crumb_id);
|
crumb_id = crumb_inode->lookup(part);
|
||||||
crumb_id = dir_inode->lookup(part);
|
|
||||||
if (!crumb_id.is_valid()) {
|
if (!crumb_id.is_valid()) {
|
||||||
#ifdef VFS_DEBUG
|
#ifdef VFS_DEBUG
|
||||||
kprintf("child <%s>(%u) not found in directory, %02u:%08u\n", part.characters(), part.length(), parent.fsid(), parent.index());
|
kprintf("child <%s>(%u) not found in directory, %02u:%08u\n", part.characters(), part.length(), parent.fsid(), parent.index());
|
||||||
|
@ -432,7 +433,8 @@ InodeIdentifier VFS::resolve_path(const String& path, InodeIdentifier base, int&
|
||||||
auto dir_inode = get_inode(mount->host());
|
auto dir_inode = get_inode(mount->host());
|
||||||
crumb_id = dir_inode->lookup("..");
|
crumb_id = dir_inode->lookup("..");
|
||||||
}
|
}
|
||||||
metadata = crumb_id.metadata();
|
crumb_inode = get_inode(crumb_id);
|
||||||
|
metadata = crumb_inode->metadata();
|
||||||
if (metadata.isDirectory()) {
|
if (metadata.isDirectory()) {
|
||||||
if (deepest_dir)
|
if (deepest_dir)
|
||||||
*deepest_dir = crumb_id;
|
*deepest_dir = crumb_id;
|
||||||
|
@ -476,8 +478,6 @@ const InodeMetadata& Vnode::metadata() const
|
||||||
{
|
{
|
||||||
if (m_core_inode)
|
if (m_core_inode)
|
||||||
return m_core_inode->metadata();
|
return m_core_inode->metadata();
|
||||||
if (!m_cachedMetadata.isValid())
|
|
||||||
m_cachedMetadata = inode.metadata();
|
|
||||||
return m_cachedMetadata;
|
return m_cachedMetadata;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue