Loading fs/erofs/compress.h +2 −2 Original line number Diff line number Diff line Loading @@ -70,8 +70,8 @@ struct z_erofs_stream_dctx { bool bounced; /* is the bounce buffer used now? */ }; int z_erofs_stream_switch_bufs(struct z_erofs_stream_dctx *dctx, void **dst, void **src, struct page **pgpl); const char *z_erofs_stream_switch_bufs(struct z_erofs_stream_dctx *dctx, void **dst, void **src, struct page **pgpl); int z_erofs_fixup_insize(struct z_erofs_decompress_req *rq, const char *padbuf, unsigned int padbufsize); int __init z_erofs_init_decompressor(void); Loading fs/erofs/decompressor.c +9 −14 Original line number Diff line number Diff line Loading @@ -342,19 +342,16 @@ static const char *z_erofs_transform_plain(struct z_erofs_decompress_req *rq, return NULL; } int z_erofs_stream_switch_bufs(struct z_erofs_stream_dctx *dctx, void **dst, void **src, struct page **pgpl) const char *z_erofs_stream_switch_bufs(struct z_erofs_stream_dctx *dctx, void **dst, void **src, struct page **pgpl) { struct z_erofs_decompress_req *rq = dctx->rq; struct super_block *sb = rq->sb; struct page **pgo, *tmppage; unsigned int j; if (!dctx->avail_out) { if (++dctx->no >= rq->outpages || !rq->outputsize) { erofs_err(sb, "insufficient space for decompressed data"); return -EFSCORRUPTED; } if (++dctx->no >= rq->outpages || !rq->outputsize) return "insufficient space for decompressed data"; if (dctx->kout) kunmap_local(dctx->kout); Loading @@ -365,7 +362,7 @@ int z_erofs_stream_switch_bufs(struct z_erofs_stream_dctx *dctx, void **dst, *pgo = erofs_allocpage(pgpl, rq->gfp); if (!*pgo) { dctx->kout = NULL; return -ENOMEM; return ERR_PTR(-ENOMEM); } set_page_private(*pgo, Z_EROFS_SHORTLIVED_PAGE); } Loading @@ -379,10 +376,8 @@ int z_erofs_stream_switch_bufs(struct z_erofs_stream_dctx *dctx, void **dst, } if (dctx->inbuf_pos == dctx->inbuf_sz && rq->inputsize) { if (++dctx->ni >= rq->inpages) { erofs_err(sb, "invalid compressed data"); return -EFSCORRUPTED; } if (++dctx->ni >= rq->inpages) return "invalid compressed data"; if (dctx->kout) /* unlike kmap(), take care of the orders */ kunmap_local(dctx->kout); kunmap_local(dctx->kin); Loading Loading @@ -417,12 +412,12 @@ int z_erofs_stream_switch_bufs(struct z_erofs_stream_dctx *dctx, void **dst, continue; tmppage = erofs_allocpage(pgpl, rq->gfp); if (!tmppage) return -ENOMEM; return ERR_PTR(-ENOMEM); set_page_private(tmppage, Z_EROFS_SHORTLIVED_PAGE); copy_highpage(tmppage, rq->in[j]); rq->in[j] = tmppage; } return 0; return NULL; } const struct z_erofs_decompressor *z_erofs_decomp[] = { Loading fs/erofs/decompressor_deflate.c +2 −2 Original line number Diff line number Diff line Loading @@ -144,10 +144,10 @@ static const char *__z_erofs_deflate_decompress(struct z_erofs_decompress_req *r while (1) { dctx.avail_out = strm->z.avail_out; dctx.inbuf_sz = strm->z.avail_in; err = z_erofs_stream_switch_bufs(&dctx, reason = z_erofs_stream_switch_bufs(&dctx, (void **)&strm->z.next_out, (void **)&strm->z.next_in, pgpl); if (err) if (reason) break; strm->z.avail_out = dctx.avail_out; strm->z.avail_in = dctx.inbuf_sz; Loading fs/erofs/decompressor_lzma.c +3 −3 Original line number Diff line number Diff line Loading @@ -189,9 +189,9 @@ static const char *z_erofs_lzma_decompress(struct z_erofs_decompress_req *rq, dctx.avail_out = buf.out_size - buf.out_pos; dctx.inbuf_sz = buf.in_size; dctx.inbuf_pos = buf.in_pos; err = z_erofs_stream_switch_bufs(&dctx, (void **)&buf.out, reason = z_erofs_stream_switch_bufs(&dctx, (void **)&buf.out, (void **)&buf.in, pgpl); if (err) if (reason) break; if (buf.out_size == buf.out_pos) { Loading fs/erofs/decompressor_zstd.c +2 −2 Original line number Diff line number Diff line Loading @@ -175,9 +175,9 @@ static const char *z_erofs_zstd_decompress(struct z_erofs_decompress_req *rq, do { dctx.inbuf_sz = in_buf.size; dctx.inbuf_pos = in_buf.pos; err = z_erofs_stream_switch_bufs(&dctx, &out_buf.dst, reason = z_erofs_stream_switch_bufs(&dctx, &out_buf.dst, (void **)&in_buf.src, pgpl); if (err) if (reason) break; if (out_buf.size == out_buf.pos) { Loading Loading
fs/erofs/compress.h +2 −2 Original line number Diff line number Diff line Loading @@ -70,8 +70,8 @@ struct z_erofs_stream_dctx { bool bounced; /* is the bounce buffer used now? */ }; int z_erofs_stream_switch_bufs(struct z_erofs_stream_dctx *dctx, void **dst, void **src, struct page **pgpl); const char *z_erofs_stream_switch_bufs(struct z_erofs_stream_dctx *dctx, void **dst, void **src, struct page **pgpl); int z_erofs_fixup_insize(struct z_erofs_decompress_req *rq, const char *padbuf, unsigned int padbufsize); int __init z_erofs_init_decompressor(void); Loading
fs/erofs/decompressor.c +9 −14 Original line number Diff line number Diff line Loading @@ -342,19 +342,16 @@ static const char *z_erofs_transform_plain(struct z_erofs_decompress_req *rq, return NULL; } int z_erofs_stream_switch_bufs(struct z_erofs_stream_dctx *dctx, void **dst, void **src, struct page **pgpl) const char *z_erofs_stream_switch_bufs(struct z_erofs_stream_dctx *dctx, void **dst, void **src, struct page **pgpl) { struct z_erofs_decompress_req *rq = dctx->rq; struct super_block *sb = rq->sb; struct page **pgo, *tmppage; unsigned int j; if (!dctx->avail_out) { if (++dctx->no >= rq->outpages || !rq->outputsize) { erofs_err(sb, "insufficient space for decompressed data"); return -EFSCORRUPTED; } if (++dctx->no >= rq->outpages || !rq->outputsize) return "insufficient space for decompressed data"; if (dctx->kout) kunmap_local(dctx->kout); Loading @@ -365,7 +362,7 @@ int z_erofs_stream_switch_bufs(struct z_erofs_stream_dctx *dctx, void **dst, *pgo = erofs_allocpage(pgpl, rq->gfp); if (!*pgo) { dctx->kout = NULL; return -ENOMEM; return ERR_PTR(-ENOMEM); } set_page_private(*pgo, Z_EROFS_SHORTLIVED_PAGE); } Loading @@ -379,10 +376,8 @@ int z_erofs_stream_switch_bufs(struct z_erofs_stream_dctx *dctx, void **dst, } if (dctx->inbuf_pos == dctx->inbuf_sz && rq->inputsize) { if (++dctx->ni >= rq->inpages) { erofs_err(sb, "invalid compressed data"); return -EFSCORRUPTED; } if (++dctx->ni >= rq->inpages) return "invalid compressed data"; if (dctx->kout) /* unlike kmap(), take care of the orders */ kunmap_local(dctx->kout); kunmap_local(dctx->kin); Loading Loading @@ -417,12 +412,12 @@ int z_erofs_stream_switch_bufs(struct z_erofs_stream_dctx *dctx, void **dst, continue; tmppage = erofs_allocpage(pgpl, rq->gfp); if (!tmppage) return -ENOMEM; return ERR_PTR(-ENOMEM); set_page_private(tmppage, Z_EROFS_SHORTLIVED_PAGE); copy_highpage(tmppage, rq->in[j]); rq->in[j] = tmppage; } return 0; return NULL; } const struct z_erofs_decompressor *z_erofs_decomp[] = { Loading
fs/erofs/decompressor_deflate.c +2 −2 Original line number Diff line number Diff line Loading @@ -144,10 +144,10 @@ static const char *__z_erofs_deflate_decompress(struct z_erofs_decompress_req *r while (1) { dctx.avail_out = strm->z.avail_out; dctx.inbuf_sz = strm->z.avail_in; err = z_erofs_stream_switch_bufs(&dctx, reason = z_erofs_stream_switch_bufs(&dctx, (void **)&strm->z.next_out, (void **)&strm->z.next_in, pgpl); if (err) if (reason) break; strm->z.avail_out = dctx.avail_out; strm->z.avail_in = dctx.inbuf_sz; Loading
fs/erofs/decompressor_lzma.c +3 −3 Original line number Diff line number Diff line Loading @@ -189,9 +189,9 @@ static const char *z_erofs_lzma_decompress(struct z_erofs_decompress_req *rq, dctx.avail_out = buf.out_size - buf.out_pos; dctx.inbuf_sz = buf.in_size; dctx.inbuf_pos = buf.in_pos; err = z_erofs_stream_switch_bufs(&dctx, (void **)&buf.out, reason = z_erofs_stream_switch_bufs(&dctx, (void **)&buf.out, (void **)&buf.in, pgpl); if (err) if (reason) break; if (buf.out_size == buf.out_pos) { Loading
fs/erofs/decompressor_zstd.c +2 −2 Original line number Diff line number Diff line Loading @@ -175,9 +175,9 @@ static const char *z_erofs_zstd_decompress(struct z_erofs_decompress_req *rq, do { dctx.inbuf_sz = in_buf.size; dctx.inbuf_pos = in_buf.pos; err = z_erofs_stream_switch_bufs(&dctx, &out_buf.dst, reason = z_erofs_stream_switch_bufs(&dctx, &out_buf.dst, (void **)&in_buf.src, pgpl); if (err) if (reason) break; if (out_buf.size == out_buf.pos) { Loading