Skip to content

Commit c12d205

Browse files
Christoph Hellwigsnitm
authored andcommitted
dm integrity: use bvec_kmap_local in integrity_metadata
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 0899753 commit c12d205

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/md/dm-integrity.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1770,7 +1770,7 @@ static void integrity_metadata(struct work_struct *w)
17701770
char *mem, *checksums_ptr;
17711771

17721772
again:
1773-
mem = (char *)kmap_atomic(bv.bv_page) + bv.bv_offset;
1773+
mem = bvec_kmap_local(&bv);
17741774
pos = 0;
17751775
checksums_ptr = checksums;
17761776
do {
@@ -1780,7 +1780,7 @@ static void integrity_metadata(struct work_struct *w)
17801780
pos += ic->sectors_per_block << SECTOR_SHIFT;
17811781
sector += ic->sectors_per_block;
17821782
} while (pos < bv.bv_len && sectors_to_process && checksums != checksums_onstack);
1783-
kunmap_atomic(mem);
1783+
kunmap_local(mem);
17841784

17851785
r = dm_integrity_rw_tag(ic, checksums, &dio->metadata_block, &dio->metadata_offset,
17861786
checksums_ptr - checksums, dio->op == REQ_OP_READ ? TAG_CMP : TAG_WRITE);

0 commit comments

Comments
 (0)