aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChao Yu <chao@kernel.org>2023-05-17 16:26:30 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2023-05-17 18:32:06 -0700
commit70e9ea44f59da1c89c94edfdf72f2d61744311d8 (patch)
tree7c81fff7357b069680941971a7f2a59ec186857f
parent0f74f239a1ec5e8c1a0a945caa94d454f535c507 (diff)
downloadf2fs-tools-70e9ea44f59da1c89c94edfdf72f2d61744311d8.tar.gz
mkfs.f2fs: remove unneeded nat initialization in f2fs_update_nat_root()
- remove unneeded nat initialization for root/quota inode due to it has been initialized in nat journal. - name f2fs_update_nat_root() to f2fs_update_nat_default(). Signed-off-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r--mkfs/f2fs_format.c24
1 files changed, 2 insertions, 22 deletions
diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c
index df6bde2..620f779 100644
--- a/mkfs/f2fs_format.c
+++ b/mkfs/f2fs_format.c
@@ -1413,12 +1413,10 @@ static int f2fs_write_qf_inode(int qtype, int offset)
return 0;
}
-static int f2fs_update_nat_root(void)
+static int f2fs_update_nat_default(void)
{
struct f2fs_nat_block *nat_blk = NULL;
uint64_t nat_seg_blk_offset = 0;
- enum quota_type qtype;
- int i;
nat_blk = calloc(F2FS_BLKSIZE, 1);
if(nat_blk == NULL) {
@@ -1426,24 +1424,6 @@ static int f2fs_update_nat_root(void)
return -1;
}
- /* update quota */
- for (qtype = i = 0; qtype < F2FS_MAX_QUOTAS; qtype++) {
- if (!((1 << qtype) & c.quota_bits))
- continue;
- nat_blk->entries[sb->qf_ino[qtype]].block_addr =
- cpu_to_le32(get_sb(main_blkaddr) +
- c.cur_seg[CURSEG_HOT_NODE] *
- c.blks_per_seg + i + 1);
- nat_blk->entries[sb->qf_ino[qtype]].ino = sb->qf_ino[qtype];
- i++;
- }
-
- /* update root */
- nat_blk->entries[get_sb(root_ino)].block_addr = cpu_to_le32(
- get_sb(main_blkaddr) +
- c.cur_seg[CURSEG_HOT_NODE] * c.blks_per_seg);
- nat_blk->entries[get_sb(root_ino)].ino = sb->root_ino;
-
/* update node nat */
nat_blk->entries[get_sb(node_ino)].block_addr = cpu_to_le32(1);
nat_blk->entries[get_sb(node_ino)].ino = sb->node_ino;
@@ -1660,7 +1640,7 @@ static int f2fs_create_root_dir(void)
}
#endif
- err = f2fs_update_nat_root();
+ err = f2fs_update_nat_default();
if (err < 0) {
MSG(1, "\tError: Failed to update NAT for root!!!\n");
goto exit;