Commit c12d205d authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Mike Snitzer

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: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
parent 08997537
...@@ -1770,7 +1770,7 @@ static void integrity_metadata(struct work_struct *w) ...@@ -1770,7 +1770,7 @@ static void integrity_metadata(struct work_struct *w)
char *mem, *checksums_ptr; char *mem, *checksums_ptr;
again: again:
mem = (char *)kmap_atomic(bv.bv_page) + bv.bv_offset; mem = bvec_kmap_local(&bv);
pos = 0; pos = 0;
checksums_ptr = checksums; checksums_ptr = checksums;
do { do {
...@@ -1780,7 +1780,7 @@ static void integrity_metadata(struct work_struct *w) ...@@ -1780,7 +1780,7 @@ static void integrity_metadata(struct work_struct *w)
pos += ic->sectors_per_block << SECTOR_SHIFT; pos += ic->sectors_per_block << SECTOR_SHIFT;
sector += ic->sectors_per_block; sector += ic->sectors_per_block;
} while (pos < bv.bv_len && sectors_to_process && checksums != checksums_onstack); } while (pos < bv.bv_len && sectors_to_process && checksums != checksums_onstack);
kunmap_atomic(mem); kunmap_local(mem);
r = dm_integrity_rw_tag(ic, checksums, &dio->metadata_block, &dio->metadata_offset, r = dm_integrity_rw_tag(ic, checksums, &dio->metadata_block, &dio->metadata_offset,
checksums_ptr - checksums, dio->op == REQ_OP_READ ? TAG_CMP : TAG_WRITE); checksums_ptr - checksums, dio->op == REQ_OP_READ ? TAG_CMP : TAG_WRITE);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment