On Thu, Nov 24, 2022 at 01:01:53AM +0800, Yangtao Li via Linux-f2fs-devel wrote: > Introduce f2fs_is_readonly() and use it to simplify code. > > Signed-off-by: Yangtao Li <[email protected]> > --- > fs/f2fs/f2fs.h | 5 +++++ > fs/f2fs/super.c | 5 ++--- > 2 files changed, 7 insertions(+), 3 deletions(-) > > diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h > index f0833638f59e..efc9d6d7b506 100644 > --- a/fs/f2fs/f2fs.h > +++ b/fs/f2fs/f2fs.h > @@ -4576,6 +4576,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); > +}
There is no need for the !! here. - Eric _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
