diff options
author | Chao Yu <yuchao0@huawei.com> | 2021-04-27 11:07:30 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2021-05-14 11:22:07 -0700 |
commit | 5db479f049c4fd6cb2d61ade28c73f51487c2f45 (patch) | |
tree | e12de09c8adca7bbad141e7cdbebf518403f541a /fs/f2fs/compress.c | |
parent | bd3c9cdb21a2674dd0db70199df884828e37abd4 (diff) |
f2fs: compress: rename __cluster_may_compress
This patch renames __cluster_may_compress() to cluster_has_invalid_data() for
better readability.
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/compress.c')
-rw-r--r-- | fs/f2fs/compress.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c index 925a5ca3744a..19097a1d0125 100644 --- a/fs/f2fs/compress.c +++ b/fs/f2fs/compress.c @@ -876,7 +876,7 @@ bool f2fs_cluster_can_merge_page(struct compress_ctx *cc, pgoff_t index) return is_page_in_cluster(cc, index); } -static bool __cluster_may_compress(struct compress_ctx *cc) +static bool cluster_has_invalid_data(struct compress_ctx *cc) { loff_t i_size = i_size_read(cc->inode); unsigned nr_pages = DIV_ROUND_UP(i_size, PAGE_SIZE); @@ -889,9 +889,9 @@ static bool __cluster_may_compress(struct compress_ctx *cc) /* beyond EOF */ if (page->index >= nr_pages) - return false; + return true; } - return true; + return false; } static int __f2fs_cluster_blocks(struct compress_ctx *cc, bool compr) @@ -967,7 +967,7 @@ static bool cluster_may_compress(struct compress_ctx *cc) return false; if (unlikely(f2fs_cp_error(F2FS_I_SB(cc->inode)))) return false; - return __cluster_may_compress(cc); + return !cluster_has_invalid_data(cc); } static void set_cluster_writeback(struct compress_ctx *cc) |