diff options
author | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-05-20 07:28:47 -0400 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-05-28 02:03:03 -0400 |
commit | 77888c1e42e8c76e16204cd99c19a01829421402 (patch) | |
tree | 3d19c41bfa81a689c89ed5f0b88c47aa0f109fa0 /fs/f2fs | |
parent | 6f85b3520325a67ee4ac33e75bbcdbc25c79ce69 (diff) |
f2fs: add f2fs_readonly()
Introduce a simple macro function for readability.
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs')
-rw-r--r-- | fs/f2fs/f2fs.h | 5 | ||||
-rw-r--r-- | fs/f2fs/file.c | 2 | ||||
-rw-r--r-- | fs/f2fs/super.c | 2 |
3 files changed, 7 insertions, 2 deletions
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 9182b2710db7..6594ce15a7bb 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) | |||
887 | return 0; | 887 | return 0; |
888 | } | 888 | } |
889 | 889 | ||
890 | static inline int f2fs_readonly(struct super_block *sb) | ||
891 | { | ||
892 | return sb->s_flags & MS_RDONLY; | ||
893 | } | ||
894 | |||
890 | /* | 895 | /* |
891 | * file.c | 896 | * file.c |
892 | */ | 897 | */ |
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 9937ba1a4d24..316bcfe80448 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c | |||
@@ -114,7 +114,7 @@ int f2fs_sync_file(struct file *file, loff_t start, loff_t end, int datasync) | |||
114 | .for_reclaim = 0, | 114 | .for_reclaim = 0, |
115 | }; | 115 | }; |
116 | 116 | ||
117 | if (inode->i_sb->s_flags & MS_RDONLY) | 117 | if (f2fs_readonly(inode->i_sb)) |
118 | return 0; | 118 | return 0; |
119 | 119 | ||
120 | trace_f2fs_sync_file_enter(inode); | 120 | trace_f2fs_sync_file_enter(inode); |
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 8555f7df82c7..3ac305da7cee 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c | |||
@@ -170,7 +170,7 @@ static int f2fs_freeze(struct super_block *sb) | |||
170 | { | 170 | { |
171 | int err; | 171 | int err; |
172 | 172 | ||
173 | if (sb->s_flags & MS_RDONLY) | 173 | if (f2fs_readonly(sb)) |
174 | return 0; | 174 | return 0; |
175 | 175 | ||
176 | err = f2fs_sync_fs(sb, 1); | 176 | err = f2fs_sync_fs(sb, 1); |