]> Git Repo - linux.git/commitdiff
dm integrity: use bvec_kmap_local in __journal_read_write
authorChristoph Hellwig <[email protected]>
Tue, 19 Oct 2021 13:44:04 +0000 (15:44 +0200)
committerMike Snitzer <[email protected]>
Mon, 1 Nov 2021 17:28:46 +0000 (13:28 -0400)
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 <[email protected]>
Signed-off-by: Mike Snitzer <[email protected]>
drivers/md/dm-integrity.c

index d8180d2a4284cde2ab67005f1097d6de2932cc00..0af091bf99c431c9f5dc4a765d864e7695e6dc64 100644 (file)
@@ -1963,7 +1963,7 @@ static bool __journal_read_write(struct dm_integrity_io *dio, struct bio *bio,
                n_sectors -= bv.bv_len >> SECTOR_SHIFT;
                bio_advance_iter(bio, &bio->bi_iter, bv.bv_len);
 retry_kmap:
-               mem = kmap_atomic(bv.bv_page);
+               mem = bvec_kmap_local(&bv);
                if (likely(dio->op == REQ_OP_WRITE))
                        flush_dcache_page(bv.bv_page);
 
@@ -1977,7 +1977,7 @@ retry_kmap:
 
                                if (unlikely(journal_entry_is_inprogress(je))) {
                                        flush_dcache_page(bv.bv_page);
-                                       kunmap_atomic(mem);
+                                       kunmap_local(mem);
 
                                        __io_wait_event(ic->copy_to_journal_wait, !journal_entry_is_inprogress(je));
                                        goto retry_kmap;
@@ -2070,7 +2070,7 @@ retry_kmap:
 
                if (unlikely(dio->op == REQ_OP_READ))
                        flush_dcache_page(bv.bv_page);
-               kunmap_atomic(mem);
+               kunmap_local(mem);
        } while (n_sectors);
 
        if (likely(dio->op == REQ_OP_WRITE)) {
This page took 0.09454 seconds and 4 git commands to generate.