[ox/fs] Remove inode on decLinks if links is 0

This commit is contained in:
Gary Talent 2019-03-17 23:16:41 -05:00
parent 7cfe9aad8e
commit fa3f7801d2

View File

@ -232,7 +232,9 @@ Error FileStoreTemplate<size_t>::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);