diff --git a/kernel/src/fs/VFS.h b/kernel/src/fs/VFS.h index dbe471ee..dc75c405 100644 --- a/kernel/src/fs/VFS.h +++ b/kernel/src/fs/VFS.h @@ -27,7 +27,7 @@ namespace VFS ino_t inum; size_t size { 0 }; mode_t mode; - nlink_t nlinks { 1 }; + nlink_t nlinks { 0 }; uid_t uid { 0 }; gid_t gid { 0 }; dev_t devid { 0 }; diff --git a/kernel/src/fs/tmpfs/Inode.h b/kernel/src/fs/tmpfs/Inode.h index 68c6fd02..df354357 100644 --- a/kernel/src/fs/tmpfs/Inode.h +++ b/kernel/src/fs/tmpfs/Inode.h @@ -269,10 +269,12 @@ namespace TmpFS void did_link() override { + m_metadata.nlinks++; } void did_unlink() override { + m_metadata.nlinks--; m_self = {}; m_entries.clear(); }