Skip to content

Commit 25058d1

Browse files
Christoph Hellwigsnitm
authored andcommitted
dm integrity: use bvec_kmap_local in __journal_read_write
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]>
1 parent c12d205 commit 25058d1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/md/dm-integrity.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1963,7 +1963,7 @@ static bool __journal_read_write(struct dm_integrity_io *dio, struct bio *bio,
19631963
n_sectors -= bv.bv_len >> SECTOR_SHIFT;
19641964
bio_advance_iter(bio, &bio->bi_iter, bv.bv_len);
19651965
retry_kmap:
1966-
mem = kmap_atomic(bv.bv_page);
1966+
mem = bvec_kmap_local(&bv);
19671967
if (likely(dio->op == REQ_OP_WRITE))
19681968
flush_dcache_page(bv.bv_page);
19691969

@@ -1977,7 +1977,7 @@ static bool __journal_read_write(struct dm_integrity_io *dio, struct bio *bio,
19771977

19781978
if (unlikely(journal_entry_is_inprogress(je))) {
19791979
flush_dcache_page(bv.bv_page);
1980-
kunmap_atomic(mem);
1980+
kunmap_local(mem);
19811981

19821982
__io_wait_event(ic->copy_to_journal_wait, !journal_entry_is_inprogress(je));
19831983
goto retry_kmap;
@@ -2070,7 +2070,7 @@ static bool __journal_read_write(struct dm_integrity_io *dio, struct bio *bio,
20702070

20712071
if (unlikely(dio->op == REQ_OP_READ))
20722072
flush_dcache_page(bv.bv_page);
2073-
kunmap_atomic(mem);
2073+
kunmap_local(mem);
20742074
} while (n_sectors);
20752075

20762076
if (likely(dio->op == REQ_OP_WRITE)) {

0 commit comments

Comments
 (0)