]> 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>
Tue, 1 Mar 2022 12:17:27 +0000 (14:17 +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>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
arch/xtensa/platforms/iss/simdisk.c

index 8eb6ad1a3a1dec402dd852aa60224f250d4da440..0f0e0724397f4224ac8cce3ceceae7a52b217c28 100644 (file)
@@ -108,13 +108,13 @@ static void 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);