Commit 863907a4 authored by Chao Yu's avatar Chao Yu Committed by Jaegeuk Kim

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: default avatarChao Yu <chao@kernel.org>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 579c7e41
...@@ -649,13 +649,8 @@ static int f2fs_compress_pages(struct compress_ctx *cc) ...@@ -649,13 +649,8 @@ static int f2fs_compress_pages(struct compress_ctx *cc)
goto destroy_compress_ctx; goto destroy_compress_ctx;
} }
for (i = 0; i < cc->nr_cpages; i++) { for (i = 0; i < cc->nr_cpages; i++)
cc->cpages[i] = f2fs_compress_alloc_page(); cc->cpages[i] = f2fs_compress_alloc_page();
if (!cc->cpages[i]) {
ret = -ENOMEM;
goto out_free_cpages;
}
}
cc->rbuf = f2fs_vmap(cc->rpages, cc->cluster_size); cc->rbuf = f2fs_vmap(cc->rpages, cc->cluster_size);
if (!cc->rbuf) { if (!cc->rbuf) {
...@@ -1574,8 +1569,6 @@ static int f2fs_prepare_decomp_mem(struct decompress_io_ctx *dic, ...@@ -1574,8 +1569,6 @@ static int f2fs_prepare_decomp_mem(struct decompress_io_ctx *dic,
} }
dic->tpages[i] = f2fs_compress_alloc_page(); dic->tpages[i] = f2fs_compress_alloc_page();
if (!dic->tpages[i])
return -ENOMEM;
} }
dic->rbuf = f2fs_vmap(dic->tpages, dic->cluster_size); dic->rbuf = f2fs_vmap(dic->tpages, dic->cluster_size);
...@@ -1656,11 +1649,6 @@ struct decompress_io_ctx *f2fs_alloc_dic(struct compress_ctx *cc) ...@@ -1656,11 +1649,6 @@ struct decompress_io_ctx *f2fs_alloc_dic(struct compress_ctx *cc)
struct page *page; struct page *page;
page = f2fs_compress_alloc_page(); page = f2fs_compress_alloc_page();
if (!page) {
ret = -ENOMEM;
goto out_free;
}
f2fs_set_compressed_page(page, cc->inode, f2fs_set_compressed_page(page, cc->inode,
start_idx + i + 1, dic); start_idx + i + 1, dic);
dic->cpages[i] = page; dic->cpages[i] = page;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment