summaryrefslogtreecommitdiff
path: root/utils.c
diff options
context:
space:
mode:
authorQu Wenruo <quwenruo@cn.fujitsu.com>2013-06-26 13:27:08 +0800
committerDavid Sterba <dsterba@suse.cz>2013-08-09 14:32:32 +0200
commit6c10240e4ed096ea028bb0b18d1eb71280329a3c (patch)
tree4d2711690e99a669736b1ca7b6142ab41caae7c4 /utils.c
parent9d3a4cb00c156077784d0f113c2d733488c6c79e (diff)
btrfs-progs: 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 and btrfs_super. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'utils.c')
-rw-r--r--utils.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/utils.c b/utils.c
index 7b4cd74f..1eeda0f7 100644
--- a/utils.c
+++ b/utils.c
@@ -115,7 +115,7 @@ int make_btrfs(int fd, const char *device, const char *label,
btrfs_set_super_bytenr(&super, blocks[0]);
btrfs_set_super_num_devices(&super, 1);
- super.magic = cpu_to_le64(BTRFS_MAGIC);
+ btrfs_set_super_magic(&super, BTRFS_MAGIC);
btrfs_set_super_generation(&super, 1);
btrfs_set_super_root(&super, blocks[1]);
btrfs_set_super_chunk_root(&super, blocks[3]);
@@ -1139,7 +1139,7 @@ int btrfs_device_already_in_root(struct btrfs_root *root, int fd,
ret = 0;
disk_super = (struct btrfs_super_block *)buf;
- if (disk_super->magic != cpu_to_le64(BTRFS_MAGIC))
+ if (btrfs_super_magic(disk_super) != BTRFS_MAGIC)
goto brelse;
if (!memcmp(disk_super->fsid, root->fs_info->super_copy->fsid,