Skip to content

Commit

Permalink
f2fs: add f2fs_readonly()
Browse files Browse the repository at this point in the history
Introduce a simple macro function for readability.

Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
  • Loading branch information
Jaegeuk Kim committed May 28, 2013
1 parent 6f85b35 commit 77888c1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions fs/f2fs/f2fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion fs/f2fs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion fs/f2fs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 77888c1

Please sign in to comment.