summaryrefslogtreecommitdiff
path: root/disk-io.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 /disk-io.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 'disk-io.c')
-rw-r--r--disk-io.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/disk-io.c b/disk-io.c
index 13dbe277..9cfbea17 100644
--- a/disk-io.c
+++ b/disk-io.c
@@ -1137,7 +1137,7 @@ int btrfs_read_dev_super(int fd, struct btrfs_super_block *sb, u64 sb_bytenr)
return -1;
if (btrfs_super_bytenr(&buf) != sb_bytenr ||
- buf.magic != cpu_to_le64(BTRFS_MAGIC))
+ btrfs_super_magic(&buf) != BTRFS_MAGIC)
return -1;
memcpy(sb, &buf, sizeof(*sb));
@@ -1153,9 +1153,9 @@ int btrfs_read_dev_super(int fd, struct btrfs_super_block *sb, u64 sb_bytenr)
if (btrfs_super_bytenr(&buf) != bytenr )
continue;
/* if magic is NULL, the device was removed */
- if (buf.magic == 0 && i == 0)
+ if (btrfs_super_magic(&buf) == 0 && i == 0)
return -1;
- if (buf.magic != cpu_to_le64(BTRFS_MAGIC))
+ if (btrfs_super_magic(&buf) != BTRFS_MAGIC)
continue;
if (!fsid_is_initialized) {