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>
This commit is contained in:
parent
bd3c9cdb21
commit
5db479f049
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user