Commit 5db479f0 authored by Chao Yu's avatar Chao Yu Committed by Jaegeuk Kim

f2fs: compress: rename __cluster_may_compress

This patch renames __cluster_may_compress() to cluster_has_invalid_data() for
better readability.
Signed-off-by: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent bd3c9cdb
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment