Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 28e06bec authored by Chao Yu's avatar Chao Yu Committed by Jaegeuk Kim
Browse files

f2fs: wrap sb_rdonly with f2fs_readonly



Use f2fs_readonly to wrap sb_rdonly for cleanup, and spread it in
all places.

Signed-off-by: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent ac00fbd0
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -2565,8 +2565,7 @@ static inline bool f2fs_skip_inode_update(struct inode *inode, int dsync)
	return ret;
	return ret;
}
}


#define sb_rdonly	f2fs_readonly
static inline bool f2fs_readonly(struct super_block *sb)
static inline int f2fs_readonly(struct super_block *sb)
{
{
	return sb->s_flags & MS_RDONLY;
	return sb->s_flags & MS_RDONLY;
}
}
+3 −3
Original line number Original line Diff line number Diff line
@@ -347,7 +347,7 @@ static int f2fs_check_quota_options(struct f2fs_sb_info *sbi)
			"QUOTA feature is enabled, so ignore jquota_fmt");
			"QUOTA feature is enabled, so ignore jquota_fmt");
		sbi->s_jquota_fmt = 0;
		sbi->s_jquota_fmt = 0;
	}
	}
	if (f2fs_sb_has_quota_ino(sbi->sb) && sb_rdonly(sbi->sb)) {
	if (f2fs_sb_has_quota_ino(sbi->sb) && f2fs_readonly(sbi->sb)) {
		f2fs_msg(sbi->sb, KERN_INFO,
		f2fs_msg(sbi->sb, KERN_INFO,
			 "Filesystem with quota feature cannot be mounted RDWR "
			 "Filesystem with quota feature cannot be mounted RDWR "
			 "without CONFIG_QUOTA");
			 "without CONFIG_QUOTA");
@@ -2864,7 +2864,7 @@ try_onemore:
	 * Turn on quotas which were not enabled for read-only mounts if
	 * Turn on quotas which were not enabled for read-only mounts if
	 * filesystem has quota feature, so that they are updated correctly.
	 * filesystem has quota feature, so that they are updated correctly.
	 */
	 */
	if (f2fs_sb_has_quota_ino(sb) && !sb_rdonly(sb)) {
	if (f2fs_sb_has_quota_ino(sb) && !f2fs_readonly(sb)) {
		err = f2fs_enable_quotas(sb);
		err = f2fs_enable_quotas(sb);
		if (err) {
		if (err) {
			f2fs_msg(sb, KERN_ERR,
			f2fs_msg(sb, KERN_ERR,
@@ -2949,7 +2949,7 @@ skip_recovery:


free_meta:
free_meta:
#ifdef CONFIG_QUOTA
#ifdef CONFIG_QUOTA
	if (f2fs_sb_has_quota_ino(sb) && !sb_rdonly(sb))
	if (f2fs_sb_has_quota_ino(sb) && !f2fs_readonly(sb))
		f2fs_quota_off_umount(sbi->sb);
		f2fs_quota_off_umount(sbi->sb);
#endif
#endif
	f2fs_sync_inode_meta(sbi);
	f2fs_sync_inode_meta(sbi);