lkml.org 
[lkml]   [2022]   [Nov]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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

\
 
 \ /
  Last update: 2022-11-23 19:34    [W:0.372 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site