diff options
author | Chao Yu <yuchao0@huawei.com> | 2019-08-23 11:58:36 +0200 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2019-09-07 01:18:26 +0200 |
commit | 00e09c0bccc71825ca9a659eb145ed7c4dc95588 (patch) | |
tree | 102a0fee320d40270360f9908a04d7a28a3c67da /fs/f2fs/segment.h | |
parent | f2fs: clean up __bio_alloc()'s parameter (diff) | |
download | linux-00e09c0bccc71825ca9a659eb145ed7c4dc95588.tar.xz linux-00e09c0bccc71825ca9a659eb145ed7c4dc95588.zip |
f2fs: enhance f2fs_is_checkpoint_ready()'s readability
This patch changes sematics of f2fs_is_checkpoint_ready()'s return
value as: return true when checkpoint is ready, other return false,
it can improve readability of below conditions.
f2fs_submit_page_write()
...
if (is_sbi_flag_set(sbi, SBI_IS_SHUTDOWN) ||
!f2fs_is_checkpoint_ready(sbi))
__submit_merged_bio(io);
f2fs_balance_fs()
...
if (!f2fs_is_checkpoint_ready(sbi))
return;
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/segment.h')
-rw-r--r-- | fs/f2fs/segment.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h index b219009c3e20..325781a1ae4d 100644 --- a/fs/f2fs/segment.h +++ b/fs/f2fs/segment.h @@ -586,13 +586,13 @@ static inline bool has_not_enough_free_secs(struct f2fs_sb_info *sbi, reserved_sections(sbi) + needed); } -static inline int f2fs_is_checkpoint_ready(struct f2fs_sb_info *sbi) +static inline bool f2fs_is_checkpoint_ready(struct f2fs_sb_info *sbi) { if (likely(!is_sbi_flag_set(sbi, SBI_CP_DISABLED))) - return 0; + return true; if (likely(!has_not_enough_free_secs(sbi, 0, 0))) - return 0; - return -ENOSPC; + return true; + return false; } static inline bool excess_prefree_segs(struct f2fs_sb_info *sbi) |