From f2c9f663851850ba05fff9d33083f89f543c9eba Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Wed, 5 May 2021 14:43:46 -0700 Subject: [PATCH] Align first free ino to lock group Currently the first inode number that can be allocated directly follows the root inode. This means the first batch of allocated inodes are in the same lock group as the root inode. The root inode is a bit special. It is always hot as absolute path lookups and inode-to-path resolution always read directory entries from the root. Let's try aligning the first free inode number to the next inode lock group boundary. This will stop work in those inodes from necessarily conflicting with work in the root inode. Signed-off-by: Zach Brown --- utils/src/mkfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/src/mkfs.c b/utils/src/mkfs.c index c646c8ae..65b0143d 100644 --- a/utils/src/mkfs.c +++ b/utils/src/mkfs.c @@ -197,7 +197,7 @@ static int do_mkfs(struct mkfs_args *args) memset(super, 0, SCOUTFS_BLOCK_SM_SIZE); super->version = cpu_to_le64(SCOUTFS_INTEROP_VERSION); uuid_generate(super->uuid); - super->next_ino = cpu_to_le64(SCOUTFS_ROOT_INO + 1); + super->next_ino = cpu_to_le64(round_up(SCOUTFS_ROOT_INO + 1, SCOUTFS_LOCK_INODE_GROUP_NR)); super->next_trans_seq = cpu_to_le64(1); super->total_meta_blocks = cpu_to_le64(last_meta + 1); super->first_meta_blkno = cpu_to_le64(next_meta);