diff options
author | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-05-20 20:28:47 +0900 |
---|---|---|
committer | Andreas Blaesius <skate4life@gmx.de> | 2016-06-05 21:20:22 +0200 |
commit | 7578bc67e5d4b4ade68a8ba511a281573b4f203a (patch) | |
tree | cafb97f6f8561ba73953d897580a5e469a95f195 | |
parent | 7e27803bb6650e93351303efee1d65b6467b859e (diff) | |
download | kernel_samsung_espresso10-7578bc67e5d4b4ade68a8ba511a281573b4f203a.zip kernel_samsung_espresso10-7578bc67e5d4b4ade68a8ba511a281573b4f203a.tar.gz kernel_samsung_espresso10-7578bc67e5d4b4ade68a8ba511a281573b4f203a.tar.bz2 |
f2fs: add f2fs_readonly()
Introduce a simple macro function for readability.
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Conflicts:
fs/f2fs/super.c
Change-Id: I1d4288c494a801bf38fa63dff9e93bec5f0cfeab
-rw-r--r-- | fs/f2fs/f2fs.h | 5 | ||||
-rw-r--r-- | fs/f2fs/file.c | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index bf2ab6c..b77b328 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -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 */ diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 7d96685..f0fa4cc 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -116,7 +116,7 @@ int f2fs_sync_file(struct file *file, 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); |