]> www.infradead.org Git - users/hch/block.git/commitdiff
aoe: use bvec_kmap_local in bvcpy
authorChristoph Hellwig <hch@lst.de>
Thu, 20 May 2021 12:45:33 +0000 (14:45 +0200)
committerChristoph Hellwig <hch@lst.de>
Fri, 21 May 2021 05:55:28 +0000 (07:55 +0200)
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>
drivers/block/aoe/aoecmd.c

index 588889bea7c3032684432ca70889317e4a2cefd1..9fbab5b682cbdb15ec5466f1a1fb8028da9838c1 100644 (file)
@@ -1019,7 +1019,7 @@ bvcpy(struct sk_buff *skb, struct bio *bio, struct bvec_iter iter, long cnt)
        iter.bi_size = cnt;
 
        __bio_for_each_segment(bv, bio, iter, iter) {
-               char *p = kmap_atomic(bv.bv_page) + bv.bv_offset;
+               char *p = bvec_kmap_local(&bv);
                skb_copy_bits(skb, soff, p, bv.bv_len);
                kunmap_atomic(p);
                soff += bv.bv_len;