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 <hch@lst.de>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
This commit is contained in:
Christoph Hellwig 2021-10-19 15:44:06 +02:00 committed by Mike Snitzer
parent 27db271708
commit 30495e688d

View file

@ -427,14 +427,14 @@ int verity_for_bv_block(struct dm_verity *v, struct dm_verity_io *io,
unsigned len;
struct bio_vec bv = bio_iter_iovec(bio, *iter);
page = kmap_atomic(bv.bv_page);
page = bvec_kmap_local(&bv);
len = bv.bv_len;
if (likely(len >= todo))
len = todo;
r = process(v, io, page + bv.bv_offset, len);
kunmap_atomic(page);
r = process(v, io, page, len);
kunmap_local(page);
if (r < 0)
return r;