Skip to content

Commit 30495e6

Browse files
Christoph Hellwigsnitm
authored andcommitted
dm verity: use bvec_kmap_local in verity_for_bv_block
Using local kmaps slightly reduces the chances to stray writes, and the bvec interface cleans up the code a little bit. Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Mike Snitzer <[email protected]>
1 parent 27db271 commit 30495e6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/md/dm-verity-target.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -427,14 +427,14 @@ int verity_for_bv_block(struct dm_verity *v, struct dm_verity_io *io,
427427
unsigned len;
428428
struct bio_vec bv = bio_iter_iovec(bio, *iter);
429429

430-
page = kmap_atomic(bv.bv_page);
430+
page = bvec_kmap_local(&bv);
431431
len = bv.bv_len;
432432

433433
if (likely(len >= todo))
434434
len = todo;
435435

436-
r = process(v, io, page + bv.bv_offset, len);
437-
kunmap_atomic(page);
436+
r = process(v, io, page, len);
437+
kunmap_local(page);
438438

439439
if (r < 0)
440440
return r;

0 commit comments

Comments
 (0)