summaryrefslogtreecommitdiffstats
path: root/drivers/nvdimm
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2022-03-03 14:19:00 +0300
committerJens Axboe <axboe@kernel.dk>2022-03-04 12:29:21 -0700
commit20072ec828640b7d23a0cfdbccf0dea48e77ba3e (patch)
tree62f0c3fcec0b6509792cb1e0a96835231051ed10 /drivers/nvdimm
parentbd3d3203eb84d08a6daef805efe9316b79d3bf3c (diff)
downloadlinux-20072ec828640b7d23a0cfdbccf0dea48e77ba3e.tar.gz
linux-20072ec828640b7d23a0cfdbccf0dea48e77ba3e.tar.bz2
linux-20072ec828640b7d23a0cfdbccf0dea48e77ba3e.zip
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>
Diffstat (limited to 'drivers/nvdimm')
-rw-r--r--drivers/nvdimm/blk.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/nvdimm/blk.c b/drivers/nvdimm/blk.c
index c1db43524d75..0a3873833594 100644
--- a/drivers/nvdimm/blk.c
+++ b/drivers/nvdimm/blk.c
@@ -88,10 +88,9 @@ static int nd_blk_rw_integrity(struct nd_namespace_blk *nsblk,
*/
cur_len = min(len, bv.bv_len);
- iobuf = kmap_atomic(bv.bv_page);
- err = ndbr->do_io(ndbr, dev_offset, iobuf + bv.bv_offset,
- cur_len, rw);
- kunmap_atomic(iobuf);
+ iobuf = bvec_kmap_local(&bv);
+ err = ndbr->do_io(ndbr, dev_offset, iobuf, cur_len, rw);
+ kunmap_local(iobuf);
if (err)
return err;