forked from Minki/linux
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: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
4c2bf276b5
commit
5da3847992
@ -1509,10 +1509,8 @@ static void btrfsic_release_block_ctx(struct btrfsic_block_data_ctx *block_ctx)
|
||||
/* Pages must be unmapped in reverse order */
|
||||
while (num_pages > 0) {
|
||||
num_pages--;
|
||||
if (block_ctx->datav[num_pages]) {
|
||||
kunmap_local(block_ctx->datav[num_pages]);
|
||||
if (block_ctx->datav[num_pages])
|
||||
block_ctx->datav[num_pages] = NULL;
|
||||
}
|
||||
if (block_ctx->pagev[num_pages]) {
|
||||
__free_page(block_ctx->pagev[num_pages]);
|
||||
block_ctx->pagev[num_pages] = NULL;
|
||||
@ -1589,7 +1587,7 @@ static int btrfsic_read_block(struct btrfsic_state *state,
|
||||
i = j;
|
||||
}
|
||||
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;
|
||||
}
|
||||
@ -2654,7 +2652,7 @@ static void __btrfsic_submit_bio(struct bio *bio)
|
||||
|
||||
bio_for_each_segment(bvec, bio, iter) {
|
||||
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++;
|
||||
|
||||
if (dev_state->state->print_mask &
|
||||
@ -2667,9 +2665,6 @@ static void __btrfsic_submit_bio(struct bio *bio)
|
||||
mapped_datav, segs,
|
||||
bio, &bio_is_patched,
|
||||
bio->bi_opf);
|
||||
/* Unmap in reverse order */
|
||||
for (--i; i >= 0; i--)
|
||||
kunmap_local(mapped_datav[i]);
|
||||
kfree(mapped_datav);
|
||||
} else if (NULL != dev_state && (bio->bi_opf & REQ_PREFLUSH)) {
|
||||
if (dev_state->state->print_mask &
|
||||
|
Loading…
Reference in New Issue
Block a user