diff --git a/deps/ox/src/ox/fs/filestore/filestoretemplate.hpp b/deps/ox/src/ox/fs/filestore/filestoretemplate.hpp index 74dcdae1..f817051c 100644 --- a/deps/ox/src/ox/fs/filestore/filestoretemplate.hpp +++ b/deps/ox/src/ox/fs/filestore/filestoretemplate.hpp @@ -232,7 +232,9 @@ Error FileStoreTemplate::decLinks(InodeId_t id) { auto item = find(id); if (item.valid()) { item->links--; - // TODO: remove item if links is 0 + if (item->links == 0) { + remove(item); + } return OxError(0); } return OxError(1);