Skip to content

Commit b7ab461

Browse files
Christoph Hellwigaxboe
authored andcommitted
aoe: use bvec_kmap_local in bvcpy
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> Link: https://lore.kernel.org/r/20220303111905.321089-3-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 143a70b commit b7ab461

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/block/aoe/aoecmd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,9 +1018,9 @@ bvcpy(struct sk_buff *skb, struct bio *bio, struct bvec_iter iter, long cnt)
10181018
iter.bi_size = cnt;
10191019

10201020
__bio_for_each_segment(bv, bio, iter, iter) {
1021-
char *p = kmap_atomic(bv.bv_page) + bv.bv_offset;
1021+
char *p = bvec_kmap_local(&bv);
10221022
skb_copy_bits(skb, soff, p, bv.bv_len);
1023-
kunmap_atomic(p);
1023+
kunmap_local(p);
10241024
soff += bv.bv_len;
10251025
}
10261026
}

0 commit comments

Comments
 (0)