kernel: Fix inode link counting in tmpfs
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
apio 2023-10-04 20:58:40 +02:00
parent db2963d7bf
commit f5aed95b8b
Signed by: apio
GPG Key ID: B8A7D06E42258954
2 changed files with 3 additions and 1 deletions

View File

@ -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 };

View File

@ -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();
}