f2fs-tools: avoid build warnings
PATCH 1/2 f2fs-tools: avoid build warnings
This patch resolves warnings while building it in android.
Signed-off-by Jaegeuk Kim <[email protected]>
--- fsck/fsck.c | 20 ++++++++++---------- fsck/fsck.h | 2 +- fsck/main.c | 4 ++-- include/f2fs_fs.h | 2 +- mkfs/f2fs_format.c | 2 +- 5 files changed, 15 insertions(+), 15 deletions(-)
fsck/fsck.c +10 -10
@@ -347,7 +347,7 @@ err:static int sanity_check_nid (struct f2fs_sb_info *sbi,u32 nid,struct f2fs_node *node_blk,enum FILE_TYPE ftype,enum NODE_TYPE ntype, -struct node_info *ni,u8 *name) +struct node_info *ni) {struct f2fs_fsck *fsck =F2FS_FSCK (sbi);int ret;
@@ -470,7 +470,7 @@ static int fsck_chk_xattr_blk(struct f2fs_sb_info *sbi, u32 ino,/* Sanity check */ if (sanity_check_nid (sbi, x_nid, node_blk, -F2FS_FT_XATTR ,TYPE_XATTR , &ni,NULL )) { +F2FS_FT_XATTR ,TYPE_XATTR , &ni)) { ret = -EINVAL ; goto out; }
@@ -484,7 +484,7 @@ out: }int fsck_chk_node_blk (struct f2fs_sb_info *sbi,struct f2fs_inode *inode, -u32 nid,u8 *name,enum FILE_TYPE ftype,enum NODE_TYPE ntype, +u32 nid,enum FILE_TYPE ftype,enum NODE_TYPE ntype,u32 *blk_cnt,struct child_info *child) {struct node_info ni;
@@ -493,7 +493,7 @@ int fsck_chk_node_blk(struct f2fs_sb_info *sbi, struct f2fs_inode *inode, node_blk = (struct f2fs_node *)calloc (BLOCK_SZ ,1 );ASSERT (node_blk !=NULL ); -if (sanity_check_nid (sbi, nid, node_blk, ftype, ntype, &ni, name)) +if (sanity_check_nid (sbi, nid, node_blk, ftype, ntype, &ni)) goto err;if (ntype ==TYPE_INODE ) {
@@ -748,7 +748,7 @@ void fsck_chk_inode_blk(struct f2fs_sb_info *sbi, u32 nid, goto skip; ret =fsck_chk_node_blk (sbi, &node_blk->i, i_nid, -NULL , ftype, ntype, blk_cnt, &child); + ftype, ntype, blk_cnt, &child);if (!ret) { *blk_cnt = *blk_cnt +1 ; }else if (ret == -EINVAL ) {
@@ -905,7 +905,7 @@ int fsck_chk_idnode_blk(struct f2fs_sb_info *sbi, struct f2fs_inode *inode,if (le32_to_cpu (node_blk->in.nid[i]) ==0x0 ) goto skip; ret =fsck_chk_node_blk (sbi, inode, -le32_to_cpu (node_blk->in.nid[i]),NULL , +le32_to_cpu (node_blk->in.nid[i]), ftype,TYPE_DIRECT_NODE , blk_cnt, child);if (!ret) *blk_cnt = *blk_cnt +1 ;
@@ -945,7 +945,7 @@ int fsck_chk_didnode_blk(struct f2fs_sb_info *sbi, struct f2fs_inode *inode,if (le32_to_cpu (node_blk->in.nid[i]) ==0x0 ) goto skip; ret =fsck_chk_node_blk (sbi, inode, -le32_to_cpu (node_blk->in.nid[i]),NULL , +le32_to_cpu (node_blk->in.nid[i]), ftype,TYPE_INDIRECT_NODE , blk_cnt, child);if (!ret) *blk_cnt = *blk_cnt +1 ;
@@ -1325,7 +1325,7 @@ static int __chk_dentries(struct f2fs_sb_info *sbi, struct child_info *child, blk_cnt =1 ; ret =fsck_chk_node_blk (sbi, -NULL ,le32_to_cpu (dentry[i].ino), name, +NULL ,le32_to_cpu (dentry[i].ino), ftype,TYPE_INODE , &blk_cnt,NULL );if (ret && c.fix_on) {
@@ -1501,7 +1501,7 @@ int fsck_chk_orphan_node(struct f2fs_sb_info *sbi)continue ; } - ret =fsck_chk_node_blk (sbi,NULL , ino,NULL , + ret =fsck_chk_node_blk (sbi,NULL , ino,F2FS_FT_ORPHAN ,TYPE_INODE , &blk_cnt,NULL );if (!ret)
@@ -1684,7 +1684,7 @@ static void fix_hard_links(struct f2fs_sb_info *sbi)while (node) {/* Sanity check */ if (sanity_check_nid (sbi, node->nid, node_blk, -F2FS_FT_MAX ,TYPE_INODE , &ni,NULL )) +F2FS_FT_MAX ,TYPE_INODE , &ni))FIX_MSG ("Failed to fix, rerun fsck.f2fs" ); node_blk->i.i_links =cpu_to_le32 (node->actual_links);
fsck/fsck.h +1 -1
@@ -119,7 +119,7 @@ struct selabel_handle;extern int fsck_chk_orphan_node (struct f2fs_sb_info *);extern int fsck_chk_node_blk (struct f2fs_sb_info *,struct f2fs_inode *,u32 , -u8 *,enum FILE_TYPE ,enum NODE_TYPE ,u32 *, +enum FILE_TYPE ,enum NODE_TYPE ,u32 *,struct child_info *);extern void fsck_chk_inode_blk (struct f2fs_sb_info *,u32 ,enum FILE_TYPE ,struct f2fs_node *,u32 *,struct node_info *);
fsck/main.c +2 -2
@@ -80,7 +80,7 @@ void sload_usage()static int is_digits (char *optarg) { -int i; +unsigned int i;for (i =0 ; i <strlen (optarg); i++)if (!isdigit (optarg[i]))
@@ -447,7 +447,7 @@ static void do_fsck(struct f2fs_sb_info *sbi)/* Traverse all block recursively from root inode */ blk_cnt =1 ; -fsck_chk_node_blk (sbi,NULL , sbi->root_ino_num, (u8 *)"/" , +fsck_chk_node_blk (sbi,NULL , sbi->root_ino_num,F2FS_FT_DIR ,TYPE_INODE , &blk_cnt,NULL );fsck_verify (sbi);fsck_free (sbi);
include/f2fs_fs.h +1 -1
@@ -306,7 +306,7 @@ struct f2fs_configuration {/* sload parameters */ char *from_dir;char *mount_point; -} __attribute__((packed)); +};#ifdef CONFIG_64BIT #define BITS_PER_LONG 64
mkfs/f2fs_format.c +1 -1
@@ -748,7 +748,7 @@ static int f2fs_write_check_point_pack(void)/* write NAT bits, if possible */ if (flags &CP_NAT_BITS_FLAG ) { -int i; +uint32_t i; *(__le64 *)nat_bits =get_cp_crc (cp); empty_nat_bits = nat_bits +8 + nat_bits_bytes;
Signature · 6 lines
2.13.0.rc1.294.g07d810a77f-goog ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
PATCH 2/2 mkfs.f2fs: drop initial spaces for feature string
This patch removes initial spaces to detect correct feature string.
Signed-off-by Jaegeuk Kim <[email protected]>
--- mkfs/f2fs_format_main.c | 2 ++ 1 file changed, 2 insertions(+)
mkfs/f2fs_format_main.c +2 -0
@@ -70,6 +70,8 @@ static void f2fs_show_info()static void parse_feature (const char *features) { +while (*features ==' ' ) + features++;if (!strcmp (features,"encrypt" )) { c.feature |=cpu_to_le32 (F2FS_FEATURE_ENCRYPT ); }else {
Signature · 6 lines
2.13.0.rc1.294.g07d810a77f-goog ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot