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:
@@ -847,7 +847,7 @@ bool f2fs_cluster_can_merge_page(struct compress_ctx *cc, pgoff_t index)
|
|||||||
return is_page_in_cluster(cc, 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);
|
loff_t i_size = i_size_read(cc->inode);
|
||||||
unsigned nr_pages = DIV_ROUND_UP(i_size, PAGE_SIZE);
|
unsigned nr_pages = DIV_ROUND_UP(i_size, PAGE_SIZE);
|
||||||
@@ -860,9 +860,9 @@ static bool __cluster_may_compress(struct compress_ctx *cc)
|
|||||||
|
|
||||||
/* beyond EOF */
|
/* beyond EOF */
|
||||||
if (page->index >= nr_pages)
|
if (page->index >= nr_pages)
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int __f2fs_cluster_blocks(struct compress_ctx *cc, bool compr)
|
static int __f2fs_cluster_blocks(struct compress_ctx *cc, bool compr)
|
||||||
@@ -938,7 +938,7 @@ static bool cluster_may_compress(struct compress_ctx *cc)
|
|||||||
return false;
|
return false;
|
||||||
if (unlikely(f2fs_cp_error(F2FS_I_SB(cc->inode))))
|
if (unlikely(f2fs_cp_error(F2FS_I_SB(cc->inode))))
|
||||||
return false;
|
return false;
|
||||||
return __cluster_may_compress(cc);
|
return !cluster_has_invalid_data(cc);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void set_cluster_writeback(struct compress_ctx *cc)
|
static void set_cluster_writeback(struct compress_ctx *cc)
|
||||||
|
|||||||
Reference in New Issue
Block a user