aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/scrub.c
diff options
context:
space:
mode:
authorQu Wenruo <quwenruo@cn.fujitsu.com>2013-07-15 23:19:18 -0400
committerChris Mason <chris.mason@fusionio.com>2013-09-01 07:57:37 -0400
commit3cae210fa529d69cb25c2a3c491f29dab687b245 (patch)
tree998853ce555cbabda25eafbc4e8fc9aaa378b693 /fs/btrfs/scrub.c
parent1e7bac1ef754b3112eb78c64a7382d286e454424 (diff)
btrfs: Cleanup for using BTRFS_SETGET_STACK instead of raw convert
Some codes still use the cpu_to_lexx instead of the BTRFS_SETGET_STACK_FUNCS declared in ctree.h. Also added some BTRFS_SETGET_STACK_FUNCS for btrfs_header btrfs_timespec and other structures. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Reviewed-by: Miao Xie <miaoxie@cn.fujitsu.com> Reviewed-by: David Sterba <dsterba@suse.cz> Signed-off-by: Josef Bacik <jbacik@fusionio.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'fs/btrfs/scrub.c')
-rw-r--r--fs/btrfs/scrub.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
index 64a157becbe5..266f24febce3 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -1345,12 +1345,12 @@ static void scrub_recheck_block_checksum(struct btrfs_fs_info *fs_info,
1345 mapped_buffer = kmap_atomic(sblock->pagev[0]->page); 1345 mapped_buffer = kmap_atomic(sblock->pagev[0]->page);
1346 h = (struct btrfs_header *)mapped_buffer; 1346 h = (struct btrfs_header *)mapped_buffer;
1347 1347
1348 if (sblock->pagev[0]->logical != le64_to_cpu(h->bytenr) || 1348 if (sblock->pagev[0]->logical != btrfs_stack_header_bytenr(h) ||
1349 memcmp(h->fsid, fs_info->fsid, BTRFS_UUID_SIZE) || 1349 memcmp(h->fsid, fs_info->fsid, BTRFS_UUID_SIZE) ||
1350 memcmp(h->chunk_tree_uuid, fs_info->chunk_tree_uuid, 1350 memcmp(h->chunk_tree_uuid, fs_info->chunk_tree_uuid,
1351 BTRFS_UUID_SIZE)) { 1351 BTRFS_UUID_SIZE)) {
1352 sblock->header_error = 1; 1352 sblock->header_error = 1;
1353 } else if (generation != le64_to_cpu(h->generation)) { 1353 } else if (generation != btrfs_stack_header_generation(h)) {
1354 sblock->header_error = 1; 1354 sblock->header_error = 1;
1355 sblock->generation_error = 1; 1355 sblock->generation_error = 1;
1356 } 1356 }
@@ -1720,10 +1720,10 @@ static int scrub_checksum_tree_block(struct scrub_block *sblock)
1720 * b) the page is already kmapped 1720 * b) the page is already kmapped
1721 */ 1721 */
1722 1722
1723 if (sblock->pagev[0]->logical != le64_to_cpu(h->bytenr)) 1723 if (sblock->pagev[0]->logical != btrfs_stack_header_bytenr(h))
1724 ++fail; 1724 ++fail;
1725 1725
1726 if (sblock->pagev[0]->generation != le64_to_cpu(h->generation)) 1726 if (sblock->pagev[0]->generation != btrfs_stack_header_generation(h))
1727 ++fail; 1727 ++fail;
1728 1728
1729 if (memcmp(h->fsid, fs_info->fsid, BTRFS_UUID_SIZE)) 1729 if (memcmp(h->fsid, fs_info->fsid, BTRFS_UUID_SIZE))
@@ -1786,10 +1786,10 @@ static int scrub_checksum_super(struct scrub_block *sblock)
1786 s = (struct btrfs_super_block *)mapped_buffer; 1786 s = (struct btrfs_super_block *)mapped_buffer;
1787 memcpy(on_disk_csum, s->csum, sctx->csum_size); 1787 memcpy(on_disk_csum, s->csum, sctx->csum_size);
1788 1788
1789 if (sblock->pagev[0]->logical != le64_to_cpu(s->bytenr)) 1789 if (sblock->pagev[0]->logical != btrfs_super_bytenr(s))
1790 ++fail_cor; 1790 ++fail_cor;
1791 1791
1792 if (sblock->pagev[0]->generation != le64_to_cpu(s->generation)) 1792 if (sblock->pagev[0]->generation != btrfs_super_generation(s))
1793 ++fail_gen; 1793 ++fail_gen;
1794 1794
1795 if (memcmp(s->fsid, fs_info->fsid, BTRFS_UUID_SIZE)) 1795 if (memcmp(s->fsid, fs_info->fsid, BTRFS_UUID_SIZE))