Commit 5da38479 authored by David Sterba's avatar David Sterba

btrfs: check-integrity: drop kmap/kunmap for block pages

The pages in block_ctx have never been allocated from highmem (in
btrfsic_read_block) so the mapping is pointless and can be removed.
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 4c2bf276
...@@ -1509,10 +1509,8 @@ static void btrfsic_release_block_ctx(struct btrfsic_block_data_ctx *block_ctx) ...@@ -1509,10 +1509,8 @@ static void btrfsic_release_block_ctx(struct btrfsic_block_data_ctx *block_ctx)
/* Pages must be unmapped in reverse order */ /* Pages must be unmapped in reverse order */
while (num_pages > 0) { while (num_pages > 0) {
num_pages--; num_pages--;
if (block_ctx->datav[num_pages]) { if (block_ctx->datav[num_pages])
kunmap_local(block_ctx->datav[num_pages]);
block_ctx->datav[num_pages] = NULL; block_ctx->datav[num_pages] = NULL;
}
if (block_ctx->pagev[num_pages]) { if (block_ctx->pagev[num_pages]) {
__free_page(block_ctx->pagev[num_pages]); __free_page(block_ctx->pagev[num_pages]);
block_ctx->pagev[num_pages] = NULL; block_ctx->pagev[num_pages] = NULL;
...@@ -1589,7 +1587,7 @@ static int btrfsic_read_block(struct btrfsic_state *state, ...@@ -1589,7 +1587,7 @@ static int btrfsic_read_block(struct btrfsic_state *state,
i = j; i = j;
} }
for (i = 0; i < num_pages; i++) for (i = 0; i < num_pages; i++)
block_ctx->datav[i] = kmap_local_page(block_ctx->pagev[i]); block_ctx->datav[i] = page_address(block_ctx->pagev[i]);
return block_ctx->len; return block_ctx->len;
} }
...@@ -2654,7 +2652,7 @@ static void __btrfsic_submit_bio(struct bio *bio) ...@@ -2654,7 +2652,7 @@ static void __btrfsic_submit_bio(struct bio *bio)
bio_for_each_segment(bvec, bio, iter) { bio_for_each_segment(bvec, bio, iter) {
BUG_ON(bvec.bv_len != PAGE_SIZE); BUG_ON(bvec.bv_len != PAGE_SIZE);
mapped_datav[i] = kmap_local_page(bvec.bv_page); mapped_datav[i] = page_address(bvec.bv_page);
i++; i++;
if (dev_state->state->print_mask & if (dev_state->state->print_mask &
...@@ -2667,9 +2665,6 @@ static void __btrfsic_submit_bio(struct bio *bio) ...@@ -2667,9 +2665,6 @@ static void __btrfsic_submit_bio(struct bio *bio)
mapped_datav, segs, mapped_datav, segs,
bio, &bio_is_patched, bio, &bio_is_patched,
bio->bi_opf); bio->bi_opf);
/* Unmap in reverse order */
for (--i; i >= 0; i--)
kunmap_local(mapped_datav[i]);
kfree(mapped_datav); kfree(mapped_datav);
} else if (NULL != dev_state && (bio->bi_opf & REQ_PREFLUSH)) { } else if (NULL != dev_state && (bio->bi_opf & REQ_PREFLUSH)) {
if (dev_state->state->print_mask & if (dev_state->state->print_mask &
......
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