Skip to content

Commit 20072ec

Browse files
Christoph Hellwigaxboe
authored andcommitted
nvdimm-blk: use bvec_kmap_local in nd_blk_rw_integrity
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> Link: https://lore.kernel.org/r/20220303111905.321089-6-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent bd3d320 commit 20072ec

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

drivers/nvdimm/blk.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,9 @@ static int nd_blk_rw_integrity(struct nd_namespace_blk *nsblk,
8888
*/
8989

9090
cur_len = min(len, bv.bv_len);
91-
iobuf = kmap_atomic(bv.bv_page);
92-
err = ndbr->do_io(ndbr, dev_offset, iobuf + bv.bv_offset,
93-
cur_len, rw);
94-
kunmap_atomic(iobuf);
91+
iobuf = bvec_kmap_local(&bv);
92+
err = ndbr->do_io(ndbr, dev_offset, iobuf, cur_len, rw);
93+
kunmap_local(iobuf);
9594
if (err)
9695
return err;
9796

0 commit comments

Comments
 (0)