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 7e487be0094e..2f3d6f917fb3 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c @@ -1098,7 +1098,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) || @@ -1112,7 +1112,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;;) { @@ -1124,14 +1124,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); @@ -1242,7 +1241,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; @@ -1250,7 +1249,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; @@ -1258,7 +1257,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); @@ -1288,7 +1287,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); @@ -1320,7 +1319,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; @@ -1328,7 +1327,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; } @@ -1359,7 +1358,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); @@ -1380,7 +1379,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; @@ -1388,7 +1387,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; } |