erofs-utils: mkfs: fill filesystem inode count
PATCH 1/1 erofs-utils: mkfs: fill filesystem inode count
Inode count was missing to fill when refactoring. Fix it.
Fixes a17497f0844a ("erofs-utils: introduce inode operations")
Fixes 5e35b75ad499 ("erofs-utils: introduce fuse implementation")
Signed-off-by Gao Xiang <[email protected]>
--- lib/inode.c | 3 +-- mkfs/main.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-)
lib/inode.c +1 -2
@@ -855,14 +855,13 @@ static int erofs_fill_inode(struct erofs_inode *inode,static struct erofs_inode *erofs_new_inode (void ) { -static unsigned int counter;struct erofs_inode *inode; inode =calloc (1 ,sizeof (struct erofs_inode ));if (!inode)return ERR_PTR (-ENOMEM ); - inode->i_ino[0 ] = counter++;/* inode serial number */ + inode->i_ino[0 ] = sbi.inos++;/* inode serial number */ inode->i_count =1 ;init_list_head (&inode->i_subdirs);
mkfs/main.c +1 -1
@@ -387,7 +387,7 @@ int erofs_mkfs_update_super_block(struct erofs_buffer_head *bh,struct erofs_super_block sb = { .magic =cpu_to_le32 (EROFS_SUPER_MAGIC_V1 ), .blkszbits =LOG_BLOCK_SIZE , - .inos =0 , + .inos =cpu_to_le64 (sbi.inos), .build_time =cpu_to_le64 (sbi.build_time), .build_time_nsec =cpu_to_le32 (sbi.build_time_nsec), .blocks =0 ,
Signature · 1 line
2.20.1