Commit b7ab4611 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

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: default avatarChristoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20220303111905.321089-3-hch@lst.deSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 143a70b8
...@@ -1018,9 +1018,9 @@ bvcpy(struct sk_buff *skb, struct bio *bio, struct bvec_iter iter, long cnt) ...@@ -1018,9 +1018,9 @@ bvcpy(struct sk_buff *skb, struct bio *bio, struct bvec_iter iter, long cnt)
iter.bi_size = cnt; iter.bi_size = cnt;
__bio_for_each_segment(bv, bio, iter, iter) { __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); skb_copy_bits(skb, soff, p, bv.bv_len);
kunmap_atomic(p); kunmap_local(p);
soff += bv.bv_len; soff += bv.bv_len;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment