mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-13 18:36:38 +02:00
Get rid of Ext2FS::modify_link_count() in favor of Inode accessors.
This commit is contained in:
Notes:
sideshowbarker
2024-07-19 16:07:15 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/b0db0e5de09
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user