Skip to content

Commit 2ba2a38

Browse files
chaseyuJaegeuk Kim
authored and
Jaegeuk Kim
committed
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 <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
1 parent 94d4ac4 commit 2ba2a38

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

fs/f2fs/compress.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,7 @@ bool f2fs_cluster_can_merge_page(struct compress_ctx *cc, pgoff_t index)
877877
return is_page_in_cluster(cc, index);
878878
}
879879

880-
static bool __cluster_may_compress(struct compress_ctx *cc)
880+
static bool cluster_has_invalid_data(struct compress_ctx *cc)
881881
{
882882
loff_t i_size = i_size_read(cc->inode);
883883
unsigned nr_pages = DIV_ROUND_UP(i_size, PAGE_SIZE);
@@ -890,9 +890,9 @@ static bool __cluster_may_compress(struct compress_ctx *cc)
890890

891891
/* beyond EOF */
892892
if (page->index >= nr_pages)
893-
return false;
893+
return true;
894894
}
895-
return true;
895+
return false;
896896
}
897897

898898
static int __f2fs_cluster_blocks(struct compress_ctx *cc, bool compr)
@@ -968,7 +968,7 @@ static bool cluster_may_compress(struct compress_ctx *cc)
968968
return false;
969969
if (unlikely(f2fs_cp_error(F2FS_I_SB(cc->inode))))
970970
return false;
971-
return __cluster_may_compress(cc);
971+
return !cluster_has_invalid_data(cc);
972972
}
973973

974974
static void set_cluster_writeback(struct compress_ctx *cc)

0 commit comments

Comments
 (0)