Maintain inode count in super and log trees

Add a count of used inodes to the super block and a change in the inode
count to the log_trees struct.   Client transactions track the change in
inode count as they create and delete inodes.   The log_trees delta is
added to the count in the super as finalized log_trees are deleted.

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2021-10-28 12:30:47 -07:00
parent 94e5bc1457
commit 95ed36f9d3
8 changed files with 85 additions and 1 deletions
+2
View File
@@ -472,6 +472,7 @@ struct scoutfs_log_trees {
struct scoutfs_srch_file srch_file;
__le64 data_alloc_zone_blocks;
__le64 data_alloc_zones[SCOUTFS_DATA_ALLOC_ZONE_LE64S];
__le64 inode_count_delta;
__le64 max_item_seq;
__le64 finalize_seq;
__le64 rid;
@@ -795,6 +796,7 @@ struct scoutfs_super_block {
__u8 uuid[SCOUTFS_UUID_BYTES];
__le64 seq;
__le64 next_ino;
__le64 inode_count;
__le64 total_meta_blocks; /* both static and dynamic */
__le64 total_data_blocks;
struct scoutfs_quorum_config qconf;