Skip to content

Commit 143a70b

Browse files
Christoph Hellwigaxboe
authored andcommitted
iss-simdisk: use bvec_kmap_local in simdisk_submit_bio
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> Acked-by: Max Filippov <jcmvbkbc@gmail.com> Link: https://lore.kernel.org/r/20220303111905.321089-2-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent c48d8c5 commit 143a70b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

arch/xtensa/platforms/iss/simdisk.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,13 @@ static void simdisk_submit_bio(struct bio *bio)
108108
sector_t sector = bio->bi_iter.bi_sector;
109109

110110
bio_for_each_segment(bvec, bio, iter) {
111-
char *buffer = kmap_atomic(bvec.bv_page) + bvec.bv_offset;
111+
char *buffer = bvec_kmap_local(&bvec);
112112
unsigned len = bvec.bv_len >> SECTOR_SHIFT;
113113

114114
simdisk_transfer(dev, sector, len, buffer,
115115
bio_data_dir(bio) == WRITE);
116116
sector += len;
117-
kunmap_atomic(buffer);
117+
kunmap_local(buffer);
118118
}
119119

120120
bio_endio(bio);

0 commit comments

Comments
 (0)