提交 77888c1e 编写于 作者: J Jaegeuk Kim

f2fs: add f2fs_readonly()

Introduce a simple macro function for readability.
Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
上级 6f85b352
...@@ -887,6 +887,11 @@ static inline int cond_clear_inode_flag(struct f2fs_inode_info *fi, int flag) ...@@ -887,6 +887,11 @@ static inline int cond_clear_inode_flag(struct f2fs_inode_info *fi, int flag)
return 0; return 0;
} }
static inline int f2fs_readonly(struct super_block *sb)
{
return sb->s_flags & MS_RDONLY;
}
/* /*
* file.c * file.c
*/ */
......
...@@ -114,7 +114,7 @@ int f2fs_sync_file(struct file *file, loff_t start, loff_t end, int datasync) ...@@ -114,7 +114,7 @@ int f2fs_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
.for_reclaim = 0, .for_reclaim = 0,
}; };
if (inode->i_sb->s_flags & MS_RDONLY) if (f2fs_readonly(inode->i_sb))
return 0; return 0;
trace_f2fs_sync_file_enter(inode); trace_f2fs_sync_file_enter(inode);
......
...@@ -170,7 +170,7 @@ static int f2fs_freeze(struct super_block *sb) ...@@ -170,7 +170,7 @@ static int f2fs_freeze(struct super_block *sb)
{ {
int err; int err;
if (sb->s_flags & MS_RDONLY) if (f2fs_readonly(sb))
return 0; return 0;
err = f2fs_sync_fs(sb, 1); err = f2fs_sync_fs(sb, 1);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册