aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/super.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk.kim@samsung.com>2012-11-28 16:12:41 +0900
committerAndreas Blaesius <skate4life@gmx.de>2016-06-05 21:19:43 +0200
commit87083325a2be7f7cb0b07d43d3b0e18081777b2b (patch)
tree1b723ac89319f482f216a427e766ca374cf9fef3 /fs/f2fs/super.c
parentfe48d6ae1529532a2cd21ee5128b731cfaf9cec8 (diff)
downloadkernel_samsung_espresso10-87083325a2be7f7cb0b07d43d3b0e18081777b2b.zip
kernel_samsung_espresso10-87083325a2be7f7cb0b07d43d3b0e18081777b2b.tar.gz
kernel_samsung_espresso10-87083325a2be7f7cb0b07d43d3b0e18081777b2b.tar.bz2
f2fs: fix endian conversion bugs reported by sparse
This patch should resolve the bugs reported by the sparse tool. Initial reports were written by "kbuild test robot" managed by fengguang.wu. In my local machines, I've tested also by running: > make C=2 CF="-D__CHECK_ENDIAN__" Accordingly, I've found lots of warnings and bugs related to the endian conversion. And I've fixed all at this moment. Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/super.c')
-rw-r--r--fs/f2fs/super.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 8661c93..878bf38 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -89,7 +89,7 @@ static void f2fs_i_callback(struct rcu_head *head)
kmem_cache_free(f2fs_inode_cachep, F2FS_I(inode));
}
-void f2fs_destroy_inode(struct inode *inode)
+static void f2fs_destroy_inode(struct inode *inode)
{
call_rcu(&inode->i_rcu, f2fs_i_callback);
}
@@ -445,7 +445,7 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
if (sanity_check_raw_super(raw_super))
goto free_sb_buf;
- sb->s_maxbytes = max_file_size(raw_super->log_blocksize);
+ sb->s_maxbytes = max_file_size(le32_to_cpu(raw_super->log_blocksize));
sb->s_max_links = F2FS_LINK_MAX;
get_random_bytes(&sbi->s_next_generation, sizeof(u32));
@@ -527,7 +527,7 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
/* if there are nt orphan nodes free them */
err = -EINVAL;
- if (!(sbi->ckpt->ckpt_flags & CP_UMOUNT_FLAG) &&
+ if (!is_set_ckpt_flags(F2FS_CKPT(sbi), CP_UMOUNT_FLAG) &&
recover_orphan_inodes(sbi))
goto free_node_inode;
@@ -547,7 +547,7 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
}
/* recover fsynced data */
- if (!(sbi->ckpt->ckpt_flags & CP_UMOUNT_FLAG) &&
+ if (!is_set_ckpt_flags(F2FS_CKPT(sbi), CP_UMOUNT_FLAG) &&
!test_opt(sbi, DISABLE_ROLL_FORWARD))
recover_fsync_data(sbi);