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 c9a2c1aef4bd..90acc82046c3 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c @@ -1089,7 +1089,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) || @@ -1103,7 +1103,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;;) { @@ -1115,14 +1115,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); @@ -1231,7 +1230,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; @@ -1239,7 +1238,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; @@ -1247,7 +1246,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); @@ -1283,7 +1282,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); @@ -1315,7 +1314,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; @@ -1323,7 +1322,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; } @@ -1363,7 +1362,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); @@ -1384,7 +1383,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; @@ -1392,7 +1391,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; } |