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

Commit 77888c1e authored by Jaegeuk Kim's avatar Jaegeuk Kim
Browse files

f2fs: add f2fs_readonly()



Introduce a simple macro function for readability.

Signed-off-by: default avatarJaegeuk Kim <jaegeuk.kim@samsung.com>
parent 6f85b352
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -887,6 +887,11 @@ static inline int cond_clear_inode_flag(struct f2fs_inode_info *fi, int flag)
	return 0;
}

static inline int f2fs_readonly(struct super_block *sb)
{
	return sb->s_flags & MS_RDONLY;
}

/*
 * file.c
 */
+1 −1
Original line number Diff line number Diff line
@@ -114,7 +114,7 @@ int f2fs_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
		.for_reclaim = 0,
	};

	if (inode->i_sb->s_flags & MS_RDONLY)
	if (f2fs_readonly(inode->i_sb))
		return 0;

	trace_f2fs_sync_file_enter(inode);
+1 −1
Original line number Diff line number Diff line
@@ -170,7 +170,7 @@ static int f2fs_freeze(struct super_block *sb)
{
	int err;

	if (sb->s_flags & MS_RDONLY)
	if (f2fs_readonly(sb))
		return 0;

	err = f2fs_sync_fs(sb, 1);