Commit fba6aa75 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Chris Mason

Btrfs: Make btrfs_header_fsid() return unsigned long

Internally, btrfs_header_fsid() calculates an unsigned long, but casts
it to a pointer, while all callers cast it to unsigned long again.
Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarJosef Bacik <jbacik@fusionio.com>
Signed-off-by: default avatarChris Mason <chris.mason@fusionio.com>
parent 231e88f4
...@@ -274,8 +274,7 @@ int btrfs_copy_root(struct btrfs_trans_handle *trans, ...@@ -274,8 +274,7 @@ int btrfs_copy_root(struct btrfs_trans_handle *trans,
else else
btrfs_set_header_owner(cow, new_root_objectid); btrfs_set_header_owner(cow, new_root_objectid);
write_extent_buffer(cow, root->fs_info->fsid, write_extent_buffer(cow, root->fs_info->fsid, btrfs_header_fsid(cow),
(unsigned long)btrfs_header_fsid(cow),
BTRFS_FSID_SIZE); BTRFS_FSID_SIZE);
WARN_ON(btrfs_header_generation(buf) > trans->transid); WARN_ON(btrfs_header_generation(buf) > trans->transid);
...@@ -997,8 +996,7 @@ static noinline int __btrfs_cow_block(struct btrfs_trans_handle *trans, ...@@ -997,8 +996,7 @@ static noinline int __btrfs_cow_block(struct btrfs_trans_handle *trans,
else else
btrfs_set_header_owner(cow, root->root_key.objectid); btrfs_set_header_owner(cow, root->root_key.objectid);
write_extent_buffer(cow, root->fs_info->fsid, write_extent_buffer(cow, root->fs_info->fsid, btrfs_header_fsid(cow),
(unsigned long)btrfs_header_fsid(cow),
BTRFS_FSID_SIZE); BTRFS_FSID_SIZE);
ret = update_ref_for_cow(trans, root, buf, cow, &last_ref); ret = update_ref_for_cow(trans, root, buf, cow, &last_ref);
...@@ -3109,8 +3107,7 @@ static noinline int insert_new_root(struct btrfs_trans_handle *trans, ...@@ -3109,8 +3107,7 @@ static noinline int insert_new_root(struct btrfs_trans_handle *trans,
btrfs_set_header_backref_rev(c, BTRFS_MIXED_BACKREF_REV); btrfs_set_header_backref_rev(c, BTRFS_MIXED_BACKREF_REV);
btrfs_set_header_owner(c, root->root_key.objectid); btrfs_set_header_owner(c, root->root_key.objectid);
write_extent_buffer(c, root->fs_info->fsid, write_extent_buffer(c, root->fs_info->fsid, btrfs_header_fsid(c),
(unsigned long)btrfs_header_fsid(c),
BTRFS_FSID_SIZE); BTRFS_FSID_SIZE);
write_extent_buffer(c, root->fs_info->chunk_tree_uuid, write_extent_buffer(c, root->fs_info->chunk_tree_uuid,
...@@ -3250,8 +3247,7 @@ static noinline int split_node(struct btrfs_trans_handle *trans, ...@@ -3250,8 +3247,7 @@ static noinline int split_node(struct btrfs_trans_handle *trans,
btrfs_set_header_backref_rev(split, BTRFS_MIXED_BACKREF_REV); btrfs_set_header_backref_rev(split, BTRFS_MIXED_BACKREF_REV);
btrfs_set_header_owner(split, root->root_key.objectid); btrfs_set_header_owner(split, root->root_key.objectid);
write_extent_buffer(split, root->fs_info->fsid, write_extent_buffer(split, root->fs_info->fsid,
(unsigned long)btrfs_header_fsid(split), btrfs_header_fsid(split), BTRFS_FSID_SIZE);
BTRFS_FSID_SIZE);
write_extent_buffer(split, root->fs_info->chunk_tree_uuid, write_extent_buffer(split, root->fs_info->chunk_tree_uuid,
(unsigned long)btrfs_header_chunk_tree_uuid(split), (unsigned long)btrfs_header_chunk_tree_uuid(split),
BTRFS_UUID_SIZE); BTRFS_UUID_SIZE);
...@@ -4006,8 +4002,7 @@ static noinline int split_leaf(struct btrfs_trans_handle *trans, ...@@ -4006,8 +4002,7 @@ static noinline int split_leaf(struct btrfs_trans_handle *trans,
btrfs_set_header_owner(right, root->root_key.objectid); btrfs_set_header_owner(right, root->root_key.objectid);
btrfs_set_header_level(right, 0); btrfs_set_header_level(right, 0);
write_extent_buffer(right, root->fs_info->fsid, write_extent_buffer(right, root->fs_info->fsid,
(unsigned long)btrfs_header_fsid(right), btrfs_header_fsid(right), BTRFS_FSID_SIZE);
BTRFS_FSID_SIZE);
write_extent_buffer(right, root->fs_info->chunk_tree_uuid, write_extent_buffer(right, root->fs_info->chunk_tree_uuid,
(unsigned long)btrfs_header_chunk_tree_uuid(right), (unsigned long)btrfs_header_chunk_tree_uuid(right),
......
...@@ -2675,10 +2675,9 @@ static inline void btrfs_set_header_backref_rev(struct extent_buffer *eb, ...@@ -2675,10 +2675,9 @@ static inline void btrfs_set_header_backref_rev(struct extent_buffer *eb,
btrfs_set_header_flags(eb, flags); btrfs_set_header_flags(eb, flags);
} }
static inline u8 *btrfs_header_fsid(struct extent_buffer *eb) static inline unsigned long btrfs_header_fsid(struct extent_buffer *eb)
{ {
unsigned long ptr = offsetof(struct btrfs_header, fsid); return offsetof(struct btrfs_header, fsid);
return (u8 *)ptr;
} }
static inline u8 *btrfs_header_chunk_tree_uuid(struct extent_buffer *eb) static inline u8 *btrfs_header_chunk_tree_uuid(struct extent_buffer *eb)
......
...@@ -495,8 +495,7 @@ static int check_tree_block_fsid(struct btrfs_root *root, ...@@ -495,8 +495,7 @@ static int check_tree_block_fsid(struct btrfs_root *root,
u8 fsid[BTRFS_UUID_SIZE]; u8 fsid[BTRFS_UUID_SIZE];
int ret = 1; int ret = 1;
read_extent_buffer(eb, fsid, (unsigned long)btrfs_header_fsid(eb), read_extent_buffer(eb, fsid, btrfs_header_fsid(eb), BTRFS_FSID_SIZE);
BTRFS_FSID_SIZE);
while (fs_devices) { while (fs_devices) {
if (!memcmp(fsid, fs_devices->fsid, BTRFS_FSID_SIZE)) { if (!memcmp(fsid, fs_devices->fsid, BTRFS_FSID_SIZE)) {
ret = 0; ret = 0;
...@@ -1292,8 +1291,7 @@ struct btrfs_root *btrfs_create_tree(struct btrfs_trans_handle *trans, ...@@ -1292,8 +1291,7 @@ struct btrfs_root *btrfs_create_tree(struct btrfs_trans_handle *trans,
btrfs_set_header_owner(leaf, objectid); btrfs_set_header_owner(leaf, objectid);
root->node = leaf; root->node = leaf;
write_extent_buffer(leaf, fs_info->fsid, write_extent_buffer(leaf, fs_info->fsid, btrfs_header_fsid(leaf),
(unsigned long)btrfs_header_fsid(leaf),
BTRFS_FSID_SIZE); BTRFS_FSID_SIZE);
write_extent_buffer(leaf, fs_info->chunk_tree_uuid, write_extent_buffer(leaf, fs_info->chunk_tree_uuid,
(unsigned long)btrfs_header_chunk_tree_uuid(leaf), (unsigned long)btrfs_header_chunk_tree_uuid(leaf),
...@@ -1380,8 +1378,7 @@ static struct btrfs_root *alloc_log_tree(struct btrfs_trans_handle *trans, ...@@ -1380,8 +1378,7 @@ static struct btrfs_root *alloc_log_tree(struct btrfs_trans_handle *trans,
root->node = leaf; root->node = leaf;
write_extent_buffer(root->node, root->fs_info->fsid, write_extent_buffer(root->node, root->fs_info->fsid,
(unsigned long)btrfs_header_fsid(root->node), btrfs_header_fsid(root->node), BTRFS_FSID_SIZE);
BTRFS_FSID_SIZE);
btrfs_mark_buffer_dirty(root->node); btrfs_mark_buffer_dirty(root->node);
btrfs_tree_unlock(root->node); btrfs_tree_unlock(root->node);
return root; return root;
......
...@@ -436,8 +436,7 @@ static noinline int create_subvol(struct inode *dir, ...@@ -436,8 +436,7 @@ static noinline int create_subvol(struct inode *dir,
btrfs_set_header_backref_rev(leaf, BTRFS_MIXED_BACKREF_REV); btrfs_set_header_backref_rev(leaf, BTRFS_MIXED_BACKREF_REV);
btrfs_set_header_owner(leaf, objectid); btrfs_set_header_owner(leaf, objectid);
write_extent_buffer(leaf, root->fs_info->fsid, write_extent_buffer(leaf, root->fs_info->fsid, btrfs_header_fsid(leaf),
(unsigned long)btrfs_header_fsid(leaf),
BTRFS_FSID_SIZE); BTRFS_FSID_SIZE);
write_extent_buffer(leaf, root->fs_info->chunk_tree_uuid, write_extent_buffer(leaf, root->fs_info->chunk_tree_uuid,
(unsigned long)btrfs_header_chunk_tree_uuid(leaf), (unsigned long)btrfs_header_chunk_tree_uuid(leaf),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment