mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
UPSTREAM: erofs: fold in z_erofs_decompress()
No need this helper since it's just a simple wrapper for decompress
method and only one caller. So, let's fold in directly instead.
Signed-off-by: Yue Hu <huyue2@coolpad.com>
Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Link: https://lore.kernel.org/r/20230426084449.12781-1-zbestahu@gmail.com
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Bug: 318378021
(cherry picked from commit 597e2953ae)
Change-Id: I849360f088016cf97542858e8a5a9cee671a2f61
Signed-off-by: Sandeep Dhavale <dhavale@google.com>
This commit is contained in:
@@ -89,8 +89,7 @@ static inline bool erofs_page_is_managed(const struct erofs_sb_info *sbi,
|
|||||||
|
|
||||||
int z_erofs_fixup_insize(struct z_erofs_decompress_req *rq, const char *padbuf,
|
int z_erofs_fixup_insize(struct z_erofs_decompress_req *rq, const char *padbuf,
|
||||||
unsigned int padbufsize);
|
unsigned int padbufsize);
|
||||||
int z_erofs_decompress(struct z_erofs_decompress_req *rq,
|
extern const struct z_erofs_decompressor erofs_decompressors[];
|
||||||
struct page **pagepool);
|
|
||||||
|
|
||||||
/* prototypes for specific algorithms */
|
/* prototypes for specific algorithms */
|
||||||
int z_erofs_lzma_decompress(struct z_erofs_decompress_req *rq,
|
int z_erofs_lzma_decompress(struct z_erofs_decompress_req *rq,
|
||||||
|
|||||||
@@ -363,7 +363,7 @@ static int z_erofs_transform_plain(struct z_erofs_decompress_req *rq,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct z_erofs_decompressor decompressors[] = {
|
const struct z_erofs_decompressor erofs_decompressors[] = {
|
||||||
[Z_EROFS_COMPRESSION_SHIFTED] = {
|
[Z_EROFS_COMPRESSION_SHIFTED] = {
|
||||||
.decompress = z_erofs_transform_plain,
|
.decompress = z_erofs_transform_plain,
|
||||||
.name = "shifted"
|
.name = "shifted"
|
||||||
@@ -383,9 +383,3 @@ static struct z_erofs_decompressor decompressors[] = {
|
|||||||
},
|
},
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
int z_erofs_decompress(struct z_erofs_decompress_req *rq,
|
|
||||||
struct page **pagepool)
|
|
||||||
{
|
|
||||||
return decompressors[rq->alg].decompress(rq, pagepool);
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1256,6 +1256,8 @@ static int z_erofs_decompress_pcluster(struct z_erofs_decompress_backend *be,
|
|||||||
struct erofs_sb_info *const sbi = EROFS_SB(be->sb);
|
struct erofs_sb_info *const sbi = EROFS_SB(be->sb);
|
||||||
struct z_erofs_pcluster *pcl = be->pcl;
|
struct z_erofs_pcluster *pcl = be->pcl;
|
||||||
unsigned int pclusterpages = z_erofs_pclusterpages(pcl);
|
unsigned int pclusterpages = z_erofs_pclusterpages(pcl);
|
||||||
|
const struct z_erofs_decompressor *decompressor =
|
||||||
|
&erofs_decompressors[pcl->algorithmformat];
|
||||||
unsigned int i, inputsize;
|
unsigned int i, inputsize;
|
||||||
int err2;
|
int err2;
|
||||||
struct page *page;
|
struct page *page;
|
||||||
@@ -1299,7 +1301,7 @@ static int z_erofs_decompress_pcluster(struct z_erofs_decompress_backend *be,
|
|||||||
else
|
else
|
||||||
inputsize = pclusterpages * PAGE_SIZE;
|
inputsize = pclusterpages * PAGE_SIZE;
|
||||||
|
|
||||||
err = z_erofs_decompress(&(struct z_erofs_decompress_req) {
|
err = decompressor->decompress(&(struct z_erofs_decompress_req) {
|
||||||
.sb = be->sb,
|
.sb = be->sb,
|
||||||
.in = be->compressed_pages,
|
.in = be->compressed_pages,
|
||||||
.out = be->decompressed_pages,
|
.out = be->decompressed_pages,
|
||||||
|
|||||||
Reference in New Issue
Block a user