diff options
Diffstat (limited to 'fs/btrfs/scrub.c')
-rw-r--r-- | fs/btrfs/scrub.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index b679bf68861e..4f76fc3f8e89 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c @@ -1091,7 +1091,7 @@ static void scrub_recheck_block_checksum(struct btrfs_fs_info *fs_info, if (is_metadata) { struct btrfs_header *h; - mapped_buffer = kmap_atomic(sblock->pagev[0].page, KM_USER0); + mapped_buffer = kmap_atomic(sblock->pagev[0].page); h = (struct btrfs_header *)mapped_buffer; if (sblock->pagev[0].logical != le64_to_cpu(h->bytenr) || @@ -1105,7 +1105,7 @@ static void scrub_recheck_block_checksum(struct btrfs_fs_info *fs_info, if (!have_csum) return; - mapped_buffer = kmap_atomic(sblock->pagev[0].page, KM_USER0); + mapped_buffer = kmap_atomic(sblock->pagev[0].page); } for (page_num = 0;;) { @@ -1117,14 +1117,13 @@ static void scrub_recheck_block_checksum(struct btrfs_fs_info *fs_info, crc = btrfs_csum_data(root, mapped_buffer, crc, PAGE_SIZE); - kunmap_atomic(mapped_buffer, KM_USER0); + kunmap_atomic(mapped_buffer); page_num++; if (page_num >= sblock->page_count) break; BUG_ON(!sblock->pagev[page_num].page); - mapped_buffer = kmap_atomic(sblock->pagev[page_num].page, - KM_USER0); + mapped_buffer = kmap_atomic(sblock->pagev[page_num].page); } btrfs_csum_final(crc, calculated_csum); @@ -1235,7 +1234,7 @@ static int scrub_checksum_data(struct scrub_block *sblock) on_disk_csum = sblock->pagev[0].csum; page = sblock->pagev[0].page; - buffer = kmap_atomic(page, KM_USER0); + buffer = kmap_atomic(page); len = sdev->sectorsize; index = 0; @@ -1243,7 +1242,7 @@ static int scrub_checksum_data(struct scrub_block *sblock) u64 l = min_t(u64, len, PAGE_SIZE); crc = btrfs_csum_data(root, buffer, crc, l); - kunmap_atomic(buffer, KM_USER0); + kunmap_atomic(buffer); len -= l; if (len == 0) break; @@ -1251,7 +1250,7 @@ static int scrub_checksum_data(struct scrub_block *sblock) BUG_ON(index >= sblock->page_count); BUG_ON(!sblock->pagev[index].page); page = sblock->pagev[index].page; - buffer = kmap_atomic(page, KM_USER0); + buffer = kmap_atomic(page); } btrfs_csum_final(crc, csum); @@ -1281,7 +1280,7 @@ static int scrub_checksum_tree_block(struct scrub_block *sblock) BUG_ON(sblock->page_count < 1); page = sblock->pagev[0].page; - mapped_buffer = kmap_atomic(page, KM_USER0); + mapped_buffer = kmap_atomic(page); h = (struct btrfs_header *)mapped_buffer; memcpy(on_disk_csum, h->csum, sdev->csum_size); @@ -1313,7 +1312,7 @@ static int scrub_checksum_tree_block(struct scrub_block *sblock) u64 l = min_t(u64, len, mapped_size); crc = btrfs_csum_data(root, p, crc, l); - kunmap_atomic(mapped_buffer, KM_USER0); + kunmap_atomic(mapped_buffer); len -= l; if (len == 0) break; @@ -1321,7 +1320,7 @@ static int scrub_checksum_tree_block(struct scrub_block *sblock) BUG_ON(index >= sblock->page_count); BUG_ON(!sblock->pagev[index].page); page = sblock->pagev[index].page; - mapped_buffer = kmap_atomic(page, KM_USER0); + mapped_buffer = kmap_atomic(page); mapped_size = PAGE_SIZE; p = mapped_buffer; } @@ -1352,7 +1351,7 @@ static int scrub_checksum_super(struct scrub_block *sblock) BUG_ON(sblock->page_count < 1); page = sblock->pagev[0].page; - mapped_buffer = kmap_atomic(page, KM_USER0); + mapped_buffer = kmap_atomic(page); s = (struct btrfs_super_block *)mapped_buffer; memcpy(on_disk_csum, s->csum, sdev->csum_size); @@ -1373,7 +1372,7 @@ static int scrub_checksum_super(struct scrub_block *sblock) u64 l = min_t(u64, len, mapped_size); crc = btrfs_csum_data(root, p, crc, l); - kunmap_atomic(mapped_buffer, KM_USER0); + kunmap_atomic(mapped_buffer); len -= l; if (len == 0) break; @@ -1381,7 +1380,7 @@ static int scrub_checksum_super(struct scrub_block *sblock) BUG_ON(index >= sblock->page_count); BUG_ON(!sblock->pagev[index].page); page = sblock->pagev[index].page; - mapped_buffer = kmap_atomic(page, KM_USER0); + mapped_buffer = kmap_atomic(page); mapped_size = PAGE_SIZE; p = mapped_buffer; } |