]> www.infradead.org Git - users/hch/block.git/commitdiff
nvdimm-blk: use bvec_kmap_local in nd_blk_rw_integrity
authorChristoph Hellwig <hch@lst.de>
Thu, 20 May 2021 12:58:47 +0000 (14:58 +0200)
committerChristoph Hellwig <hch@lst.de>
Tue, 1 Mar 2022 12:19:54 +0000 (14:19 +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>
drivers/nvdimm/blk.c

index c1db43524d7557f2ca77d0acb92fc72ce3ce0733..0a38738335941881cd3fdc274161fa6f74ee35a8 100644 (file)
@@ -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;