Use a separate used_blocks counter for free space stats to hide possibly delayed on-flush deallocation

This commit is contained in:
Vitaliy Filippov
2023-12-31 01:23:17 +03:00
parent d5a6fa6dd7
commit 8b8c1179a7
3 changed files with 6 additions and 1 deletions
+2
View File
@@ -445,6 +445,7 @@ void blockstore_impl_t::mark_stable(const obj_ver_id & v, bool forget_dirty)
if (!exists)
{
inode_space_stats[dirty_it->first.oid.inode] += dsk.data_block_size;
used_blocks++;
}
big_to_flush++;
}
@@ -455,6 +456,7 @@ void blockstore_impl_t::mark_stable(const obj_ver_id & v, bool forget_dirty)
sp -= dsk.data_block_size;
else
inode_space_stats.erase(dirty_it->first.oid.inode);
used_blocks--;
big_to_flush++;
}
}