mirror of
https://github.com/versity/scoutfs.git
synced 2026-01-06 20:16:25 +00:00
scoutfs-utils: meta and data free blocks
The super block now tracks free metadata and data blocks in separate counters. Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
@@ -481,10 +481,11 @@ struct scoutfs_super_block {
|
||||
__le64 total_meta_blocks; /* both static and dynamic */
|
||||
__le64 first_meta_blkno; /* first dynamically allocated */
|
||||
__le64 last_meta_blkno;
|
||||
__le64 free_meta_blocks;
|
||||
__le64 total_data_blocks;
|
||||
__le64 first_data_blkno;
|
||||
__le64 last_data_blkno;
|
||||
__le64 free_blocks;
|
||||
__le64 free_data_blocks;
|
||||
__le64 quorum_fenced_term;
|
||||
__le64 quorum_server_term;
|
||||
__le64 unmount_barrier;
|
||||
|
||||
@@ -457,7 +457,8 @@ static int write_new_fs(char *path, int fd, u8 quorum_count)
|
||||
}
|
||||
|
||||
/* fill out allocator fields now that we've written our blocks */
|
||||
super->free_blocks = cpu_to_le64(total_blocks - next_meta);
|
||||
super->free_meta_blocks = cpu_to_le64(last_meta - next_meta + 1);
|
||||
super->free_data_blocks = cpu_to_le64(last_data - next_data + 1);
|
||||
|
||||
/* write the super block */
|
||||
super->hdr.seq = cpu_to_le64(1);
|
||||
|
||||
@@ -681,9 +681,8 @@ static void print_super_block(struct scoutfs_super_block *super, u64 blkno)
|
||||
|
||||
/* XXX these are all in a crazy order */
|
||||
printf(" next_ino %llu next_trans_seq %llu\n"
|
||||
" total_meta_blocks %llu first_meta_blkno %llu last_meta_blkno %llu\n"
|
||||
" total_data_blocks %llu first_data_blkno %llu last_data_blkno %llu\n"
|
||||
" free_blocks %llu\n"
|
||||
" total_meta_blocks %llu first_meta_blkno %llu last_meta_blkno %llu free_meta_blocks %llu\n"
|
||||
" total_data_blocks %llu first_data_blkno %llu last_data_blkno %llu free_data_blocks %llu\n"
|
||||
" quorum_fenced_term %llu quorum_server_term %llu unmount_barrier %llu\n"
|
||||
" quorum_count %u server_addr %s\n"
|
||||
" core_meta_avail: "RADROOT_F"\n"
|
||||
@@ -699,10 +698,11 @@ static void print_super_block(struct scoutfs_super_block *super, u64 blkno)
|
||||
le64_to_cpu(super->total_meta_blocks),
|
||||
le64_to_cpu(super->first_meta_blkno),
|
||||
le64_to_cpu(super->last_meta_blkno),
|
||||
le64_to_cpu(super->free_meta_blocks),
|
||||
le64_to_cpu(super->total_data_blocks),
|
||||
le64_to_cpu(super->first_data_blkno),
|
||||
le64_to_cpu(super->last_data_blkno),
|
||||
le64_to_cpu(super->free_blocks),
|
||||
le64_to_cpu(super->free_data_blocks),
|
||||
le64_to_cpu(super->quorum_fenced_term),
|
||||
le64_to_cpu(super->quorum_server_term),
|
||||
le64_to_cpu(super->unmount_barrier),
|
||||
|
||||
Reference in New Issue
Block a user