Skip to content

Commit 863907a

Browse files
chaseyuJaegeuk Kim
authored andcommitted
f2fs: don't handle error case of f2fs_compress_alloc_page()
f2fs_compress_alloc_page() uses mempool to allocate memory, it never fail, don't handle error case in its callers. Signed-off-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
1 parent 579c7e4 commit 863907a

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

fs/f2fs/compress.c

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -649,13 +649,8 @@ static int f2fs_compress_pages(struct compress_ctx *cc)
649649
goto destroy_compress_ctx;
650650
}
651651

652-
for (i = 0; i < cc->nr_cpages; i++) {
652+
for (i = 0; i < cc->nr_cpages; i++)
653653
cc->cpages[i] = f2fs_compress_alloc_page();
654-
if (!cc->cpages[i]) {
655-
ret = -ENOMEM;
656-
goto out_free_cpages;
657-
}
658-
}
659654

660655
cc->rbuf = f2fs_vmap(cc->rpages, cc->cluster_size);
661656
if (!cc->rbuf) {
@@ -1574,8 +1569,6 @@ static int f2fs_prepare_decomp_mem(struct decompress_io_ctx *dic,
15741569
}
15751570

15761571
dic->tpages[i] = f2fs_compress_alloc_page();
1577-
if (!dic->tpages[i])
1578-
return -ENOMEM;
15791572
}
15801573

15811574
dic->rbuf = f2fs_vmap(dic->tpages, dic->cluster_size);
@@ -1656,11 +1649,6 @@ struct decompress_io_ctx *f2fs_alloc_dic(struct compress_ctx *cc)
16561649
struct page *page;
16571650

16581651
page = f2fs_compress_alloc_page();
1659-
if (!page) {
1660-
ret = -ENOMEM;
1661-
goto out_free;
1662-
}
1663-
16641652
f2fs_set_compressed_page(page, cc->inode,
16651653
start_idx + i + 1, dic);
16661654
dic->cpages[i] = page;

0 commit comments

Comments
 (0)