Skip to content

Commit 123ec24

Browse files
committed
erofs: get rid of the remaining kmap_atomic()
It's unnecessary to use kmap_atomic() compared with kmap_local_page(). In addition, kmap_atomic() is deprecated now. Signed-off-by: Gao Xiang <[email protected]> Reviewed-by: Yue Hu <[email protected]> Reviewed-by: Chao Yu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Gao Xiang <[email protected]>
1 parent 06c2afb commit 123ec24

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

fs/erofs/decompressor.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ static void *z_erofs_lz4_handle_overlap(struct z_erofs_lz4_decompress_ctx *ctx,
148148
*maptype = 0;
149149
return inpage;
150150
}
151-
kunmap_atomic(inpage);
151+
kunmap_local(inpage);
152152
might_sleep();
153153
src = erofs_vm_map_ram(rq->in, ctx->inpages);
154154
if (!src)
@@ -162,7 +162,7 @@ static void *z_erofs_lz4_handle_overlap(struct z_erofs_lz4_decompress_ctx *ctx,
162162
src = erofs_get_pcpubuf(ctx->inpages);
163163
if (!src) {
164164
DBG_BUGON(1);
165-
kunmap_atomic(inpage);
165+
kunmap_local(inpage);
166166
return ERR_PTR(-EFAULT);
167167
}
168168

@@ -173,9 +173,9 @@ static void *z_erofs_lz4_handle_overlap(struct z_erofs_lz4_decompress_ctx *ctx,
173173
min_t(unsigned int, total, PAGE_SIZE - *inputmargin);
174174

175175
if (!inpage)
176-
inpage = kmap_atomic(*in);
176+
inpage = kmap_local_page(*in);
177177
memcpy(tmp, inpage + *inputmargin, page_copycnt);
178-
kunmap_atomic(inpage);
178+
kunmap_local(inpage);
179179
inpage = NULL;
180180
tmp += page_copycnt;
181181
total -= page_copycnt;
@@ -214,7 +214,7 @@ static int z_erofs_lz4_decompress_mem(struct z_erofs_lz4_decompress_ctx *ctx,
214214
int ret, maptype;
215215

216216
DBG_BUGON(*rq->in == NULL);
217-
headpage = kmap_atomic(*rq->in);
217+
headpage = kmap_local_page(*rq->in);
218218

219219
/* LZ4 decompression inplace is only safe if zero_padding is enabled */
220220
if (erofs_sb_has_zero_padding(EROFS_SB(rq->sb))) {
@@ -223,7 +223,7 @@ static int z_erofs_lz4_decompress_mem(struct z_erofs_lz4_decompress_ctx *ctx,
223223
min_t(unsigned int, rq->inputsize,
224224
rq->sb->s_blocksize - rq->pageofs_in));
225225
if (ret) {
226-
kunmap_atomic(headpage);
226+
kunmap_local(headpage);
227227
return ret;
228228
}
229229
may_inplace = !((rq->pageofs_in + rq->inputsize) &
@@ -261,7 +261,7 @@ static int z_erofs_lz4_decompress_mem(struct z_erofs_lz4_decompress_ctx *ctx,
261261
}
262262

263263
if (maptype == 0) {
264-
kunmap_atomic(headpage);
264+
kunmap_local(headpage);
265265
} else if (maptype == 1) {
266266
vm_unmap_ram(src, ctx->inpages);
267267
} else if (maptype == 2) {
@@ -289,7 +289,7 @@ static int z_erofs_lz4_decompress(struct z_erofs_decompress_req *rq,
289289
/* one optimized fast path only for non bigpcluster cases yet */
290290
if (ctx.inpages == 1 && ctx.outpages == 1 && !rq->inplace_io) {
291291
DBG_BUGON(!*rq->out);
292-
dst = kmap_atomic(*rq->out);
292+
dst = kmap_local_page(*rq->out);
293293
dst_maptype = 0;
294294
goto dstmap_out;
295295
}
@@ -311,7 +311,7 @@ static int z_erofs_lz4_decompress(struct z_erofs_decompress_req *rq,
311311
dstmap_out:
312312
ret = z_erofs_lz4_decompress_mem(&ctx, dst + rq->pageofs_out);
313313
if (!dst_maptype)
314-
kunmap_atomic(dst);
314+
kunmap_local(dst);
315315
else if (dst_maptype == 2)
316316
vm_unmap_ram(dst, ctx.outpages);
317317
return ret;

0 commit comments

Comments
 (0)