btrfs-progs: Make btrfs_header_chunk_tree_uuid() return unsigned long

Internally, btrfs_header_chunk_tree_uuid() calculates an unsigned
long, but casts it to a pointer, while all callers cast it to unsigned
long again.

From btrfs commit b308bc2f05a86e728bd035e21a4974acd05f4d1e

Signed-off-by: Ross Kirk <ross.kirk@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <clm@fb.com>
master
Ross Kirk 2013-10-02 13:28:27 +01:00 committed by Chris Mason
parent 1ecefced86
commit 7ff512ce38
8 changed files with 12 additions and 14 deletions

View File

@ -112,8 +112,7 @@ static struct btrfs_root *open_ctree_broken(int fd, const char *device)
eb = fs_info->chunk_root->node;
read_extent_buffer(eb, fs_info->chunk_tree_uuid,
(unsigned long)btrfs_header_chunk_tree_uuid(eb),
BTRFS_UUID_SIZE);
btrfs_header_chunk_tree_uuid(eb), BTRFS_UUID_SIZE);
return fs_info->chunk_root;
out_chunk:

View File

@ -1047,7 +1047,7 @@ static int __rebuild_chunk_root(struct btrfs_trans_handle *trans,
btrfs_header_fsid(), BTRFS_FSID_SIZE);
write_extent_buffer(cow, root->fs_info->chunk_tree_uuid,
(unsigned long)btrfs_header_chunk_tree_uuid(cow),
btrfs_header_chunk_tree_uuid(cow),
BTRFS_UUID_SIZE);
root->node = cow;
@ -1235,7 +1235,7 @@ open_ctree_with_broken_chunk(struct recover_control *rc)
eb = fs_info->tree_root->node;
read_extent_buffer(eb, fs_info->chunk_tree_uuid,
(unsigned long)btrfs_header_chunk_tree_uuid(eb),
btrfs_header_chunk_tree_uuid(eb),
BTRFS_UUID_SIZE);
return fs_info->fs_root;

View File

@ -5697,7 +5697,7 @@ init:
btrfs_header_fsid(), BTRFS_FSID_SIZE);
write_extent_buffer(c, root->fs_info->chunk_tree_uuid,
(unsigned long)btrfs_header_chunk_tree_uuid(c),
btrfs_header_chunk_tree_uuid(c),
BTRFS_UUID_SIZE);
btrfs_mark_buffer_dirty(c);

View File

@ -1344,7 +1344,7 @@ static int noinline insert_new_root(struct btrfs_trans_handle *trans,
btrfs_header_fsid(), BTRFS_FSID_SIZE);
write_extent_buffer(c, root->fs_info->chunk_tree_uuid,
(unsigned long)btrfs_header_chunk_tree_uuid(c),
btrfs_header_chunk_tree_uuid(c),
BTRFS_UUID_SIZE);
btrfs_set_node_key(c, &lower_key, 0);
@ -1463,7 +1463,7 @@ static int split_node(struct btrfs_trans_handle *trans, struct btrfs_root
write_extent_buffer(split, root->fs_info->fsid,
btrfs_header_fsid(), BTRFS_FSID_SIZE);
write_extent_buffer(split, root->fs_info->chunk_tree_uuid,
(unsigned long)btrfs_header_chunk_tree_uuid(split),
btrfs_header_chunk_tree_uuid(split),
BTRFS_UUID_SIZE);
@ -2024,7 +2024,7 @@ again:
btrfs_header_fsid(), BTRFS_FSID_SIZE);
write_extent_buffer(right, root->fs_info->chunk_tree_uuid,
(unsigned long)btrfs_header_chunk_tree_uuid(right),
btrfs_header_chunk_tree_uuid(right),
BTRFS_UUID_SIZE);
if (split == 0) {

View File

@ -1794,10 +1794,9 @@ static inline unsigned long btrfs_header_fsid(void)
return offsetof(struct btrfs_header, fsid);
}
static inline u8 *btrfs_header_chunk_tree_uuid(struct extent_buffer *eb)
static inline unsigned long btrfs_header_chunk_tree_uuid(struct extent_buffer *eb)
{
unsigned long ptr = offsetof(struct btrfs_header, chunk_tree_uuid);
return (u8 *)ptr;
return offsetof(struct btrfs_header, chunk_tree_uuid);
}
static inline u8 *btrfs_super_fsid(struct extent_buffer *eb)

View File

@ -1108,7 +1108,7 @@ static struct btrfs_fs_info *__open_ctree_fd(int fp, const char *path,
eb = fs_info->chunk_root->node;
read_extent_buffer(eb, fs_info->chunk_tree_uuid,
(unsigned long)btrfs_header_chunk_tree_uuid(eb),
btrfs_header_chunk_tree_uuid(eb),
BTRFS_UUID_SIZE);
ret = btrfs_setup_all_roots(fs_info, root_tree_bytenr, flags);

View File

@ -199,7 +199,7 @@ static void print_uuids(struct extent_buffer *eb)
uuid_unparse(disk_uuid, fs_uuid);
read_extent_buffer(eb, disk_uuid,
(unsigned long)btrfs_header_chunk_tree_uuid(eb),
btrfs_header_chunk_tree_uuid(eb),
BTRFS_UUID_SIZE);
chunk_uuid[BTRFS_UUID_UNPARSED_SIZE - 1] = '\0';

View File

@ -139,7 +139,7 @@ int make_btrfs(int fd, const char *device, const char *label,
write_extent_buffer(buf, super.fsid, btrfs_header_fsid(),
BTRFS_FSID_SIZE);
write_extent_buffer(buf, chunk_tree_uuid, (unsigned long)
write_extent_buffer(buf, chunk_tree_uuid,
btrfs_header_chunk_tree_uuid(buf),
BTRFS_UUID_SIZE);