From 67ad29508d260259402d89060bb3194ba8b625d3 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Sun, 1 May 2016 09:11:52 -0700 Subject: [PATCH] Update for next_ino in super block Add support for storing the next allocated inode in the super block. Signed-off-by: Zach Brown --- utils/src/format.h | 1 + utils/src/mkfs.c | 1 + utils/src/print.c | 4 +++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/utils/src/format.h b/utils/src/format.h index 6f80059e..e7bbcb59 100644 --- a/utils/src/format.h +++ b/utils/src/format.h @@ -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; diff --git a/utils/src/mkfs.c b/utils/src/mkfs.c index 116e8abf..af2a9661 100644 --- a/utils/src/mkfs.c +++ b/utils/src/mkfs.c @@ -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); diff --git a/utils/src/print.c b/utils/src/print.c index 36097cfe..23feb908 100644 --- a/utils/src/print.c +++ b/utils/src/print.c @@ -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),