Update for next_ino in super block

Add support for storing the next allocated inode in the super block.

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2016-05-01 09:11:52 -07:00
parent 77c673f984
commit 67ad29508d
3 changed files with 5 additions and 1 deletions

View File

@@ -149,6 +149,7 @@ struct scoutfs_super_block {
struct scoutfs_block_header hdr;
__le64 id;
__u8 uuid[SCOUTFS_UUID_BYTES];
__le64 next_ino;
__le64 total_blocks;
__le32 buddy_blocks;
__le32 buddy_sweep_bit;

View File

@@ -114,6 +114,7 @@ static int write_new_fs(char *path, int fd)
super->hdr.seq = cpu_to_le64(1);
super->id = cpu_to_le64(SCOUTFS_SUPER_ID);
uuid_generate(super->uuid);
super->next_ino = cpu_to_le64(SCOUTFS_ROOT_INO + 1);
super->total_blocks = cpu_to_le64(total_blocks);
super->buddy_blocks = cpu_to_le32(buddy_blocks);

View File

@@ -241,8 +241,10 @@ static int print_super_blocks(int fd)
print_block_header(&super->hdr);
printf(" id %llx uuid %s\n",
le64_to_cpu(super->id), uuid_str);
printf(" total_blocks %llu buddy_blocks %u buddy_sweep_bit %u\n"
printf(" next_ino %llu total_blocks %llu buddy_blocks %u "
"buddy_sweep_bit %u\n"
" buddy_head %llu buddy_tail %llu\n",
le64_to_cpu(super->next_ino),
le64_to_cpu(super->total_blocks),
le32_to_cpu(super->buddy_blocks),
le32_to_cpu(super->buddy_sweep_bit),