diff options
author | Yangtao Li <frank.li@vivo.com> | 2022-11-24 03:48:42 +0100 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2022-12-12 23:53:48 +0100 |
commit | ed8ac22b6b75804743f1dae6563d75f85cfd1483 (patch) | |
tree | bd9b9518d31232954e414036d6a26e9db18f5db4 /fs/f2fs/f2fs.h | |
parent | f2fs: remove F2FS_SET_FEATURE() and F2FS_CLEAR_FEATURE() macro (diff) | |
download | linux-ed8ac22b6b75804743f1dae6563d75f85cfd1483.tar.xz linux-ed8ac22b6b75804743f1dae6563d75f85cfd1483.zip |
f2fs: introduce f2fs_is_readonly() for readability
Introduce f2fs_is_readonly() and use it to simplify code.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/f2fs.h')
-rw-r--r-- | fs/f2fs/f2fs.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index cf738f1275b2..eb8c27c4e5fc 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -4575,6 +4575,11 @@ static inline void f2fs_handle_page_eio(struct f2fs_sb_info *sbi, pgoff_t ofs, } } +static inline bool f2fs_is_readonly(struct f2fs_sb_info *sbi) +{ + return f2fs_sb_has_readonly(sbi) || f2fs_readonly(sbi->sb); +} + #define EFSBADCRC EBADMSG /* Bad CRC detected */ #define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */ |