f2fs: compress: remove unneed check condition
In only call path of __cluster_may_compress(), __f2fs_write_data_pages() has checked SBI_POR_DOING condition, and also cluster_may_compress() has checked CP_ERROR_FLAG condition, so remove redundant check condition in __cluster_may_compress() for cleanup. Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
@@ -890,7 +890,6 @@ bool f2fs_cluster_can_merge_page(struct compress_ctx *cc, pgoff_t index)
|
|||||||
|
|
||||||
static bool __cluster_may_compress(struct compress_ctx *cc)
|
static bool __cluster_may_compress(struct compress_ctx *cc)
|
||||||
{
|
{
|
||||||
struct f2fs_sb_info *sbi = F2FS_I_SB(cc->inode);
|
|
||||||
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);
|
||||||
int i;
|
int i;
|
||||||
@@ -898,12 +897,7 @@ static bool __cluster_may_compress(struct compress_ctx *cc)
|
|||||||
for (i = 0; i < cc->cluster_size; i++) {
|
for (i = 0; i < cc->cluster_size; i++) {
|
||||||
struct page *page = cc->rpages[i];
|
struct page *page = cc->rpages[i];
|
||||||
|
|
||||||
f2fs_bug_on(sbi, !page);
|
f2fs_bug_on(F2FS_I_SB(cc->inode), !page);
|
||||||
|
|
||||||
if (unlikely(f2fs_cp_error(sbi)))
|
|
||||||
return false;
|
|
||||||
if (unlikely(is_sbi_flag_set(sbi, SBI_POR_DOING)))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
/* beyond EOF */
|
/* beyond EOF */
|
||||||
if (page->index >= nr_pages)
|
if (page->index >= nr_pages)
|
||||||
|
|||||||
Reference in New Issue
Block a user