FS: Don't default to having a full InodeMetadata in every Inode.

This allows Ext2FS to keep its own ext2_inode around instead.
This commit is contained in:
Andreas Kling 2019-01-01 03:16:36 +01:00
parent 0cb074dc73
commit d07b08a287
Notes: sideshowbarker 2024-07-19 16:06:16 +09:00
8 changed files with 93 additions and 80 deletions

View file

@ -111,56 +111,29 @@ void Inode::will_be_destroyed()
flush_metadata();
}
int Inode::set_atime(Unix::time_t ts)
int Inode::set_atime(Unix::time_t)
{
if (fs().is_readonly())
return -EROFS;
if (m_metadata.atime == ts)
return 0;
m_metadata.atime = ts;
m_metadata_dirty = true;
return 0;
return -ENOTIMPL;
}
int Inode::set_ctime(Unix::time_t ts)
int Inode::set_ctime(Unix::time_t)
{
if (fs().is_readonly())
return -EROFS;
if (m_metadata.ctime == ts)
return 0;
m_metadata.ctime = ts;
m_metadata_dirty = true;
return 0;
return -ENOTIMPL;
}
int Inode::set_mtime(Unix::time_t ts)
int Inode::set_mtime(Unix::time_t)
{
if (fs().is_readonly())
return -EROFS;
if (m_metadata.mtime == ts)
return 0;
m_metadata.mtime = ts;
m_metadata_dirty = true;
return 0;
return -ENOTIMPL;
}
int Inode::increment_link_count()
{
if (fs().is_readonly())
return -EROFS;
++m_metadata.linkCount;
m_metadata_dirty = true;
return 0;
return -ENOTIMPL;
}
int Inode::decrement_link_count()
{
if (fs().is_readonly())
return -EROFS;
ASSERT(m_metadata.linkCount);
--m_metadata.linkCount;
m_metadata_dirty = true;
return 0;
return -ENOTIMPL;
}
void FS::sync()