mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 03:05:07 +00:00
Get rid of Ext2FS::modify_link_count() in favor of Inode accessors.
This commit is contained in:
parent
673870563d
commit
b0db0e5de0
4 changed files with 30 additions and 23 deletions
|
@ -144,6 +144,25 @@ int Inode::set_mtime(Unix::time_t ts)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int Inode::increment_link_count()
|
||||
{
|
||||
if (fs().is_readonly())
|
||||
return -EROFS;
|
||||
++m_metadata.linkCount;
|
||||
m_metadata_dirty = true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Inode::decrement_link_count()
|
||||
{
|
||||
if (fs().is_readonly())
|
||||
return -EROFS;
|
||||
ASSERT(m_metadata.linkCount);
|
||||
--m_metadata.linkCount;
|
||||
m_metadata_dirty = true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void FS::sync()
|
||||
{
|
||||
for (auto* inode : all_inodes()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue