]> www.infradead.org Git - users/hch/block.git/commitdiff
iss-simdisk: use bvec_kmap_local in simdisk_submit_bio
authorChristoph Hellwig <hch@lst.de>
Thu, 20 May 2021 12:39:14 +0000 (14:39 +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>
arch/xtensa/platforms/iss/simdisk.c

index fc09be7b13479cbe35068ffe602a46cca4b9d929..e485b0b1d6f894877afb1459d6bd76411a44ff90 100644 (file)
@@ -109,13 +109,13 @@ static blk_qc_t simdisk_submit_bio(struct bio *bio)
        sector_t sector = bio->bi_iter.bi_sector;
 
        bio_for_each_segment(bvec, bio, iter) {
-               char *buffer = kmap_atomic(bvec.bv_page) + bvec.bv_offset;
+               char *buffer = bvec_kmap_local(&bvec);
                unsigned len = bvec.bv_len >> SECTOR_SHIFT;
 
                simdisk_transfer(dev, sector, len, buffer,
                                bio_data_dir(bio) == WRITE);
                sector += len;
-               kunmap_atomic(buffer);
+               kunmap_local(buffer);
        }
 
        bio_endio(bio);