Messages in this thread | | | Date | Wed, 23 Nov 2022 18:32:32 +0000 | From | Eric Biggers <> | Subject | Re: [f2fs-dev] [PATCH] f2fs: introduce f2fs_is_readonly() for readability |
| |
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 <frank.li@vivo.com> > --- > 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
| |