diff options
author | Geert Uytterhoeven <geert@linux-m68k.org> | 2013-08-20 07:20:15 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@fusionio.com> | 2013-09-01 08:16:16 -0400 |
commit | b308bc2f05a86e728bd035e21a4974acd05f4d1e (patch) | |
tree | 507644cc1836ade17d45cd1640c33f1db74088a2 | |
parent | fba6aa75654394fccf2530041e9451414c28084f (diff) |
Btrfs: 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.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
-rw-r--r-- | fs/btrfs/ctree.c | 7 | ||||
-rw-r--r-- | fs/btrfs/ctree.h | 5 | ||||
-rw-r--r-- | fs/btrfs/disk-io.c | 5 | ||||
-rw-r--r-- | fs/btrfs/ioctl.c | 2 |
4 files changed, 8 insertions, 11 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 8e3efe3bad24..5fa521bec07b 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c | |||
@@ -3111,8 +3111,7 @@ static noinline int insert_new_root(struct btrfs_trans_handle *trans, | |||
3111 | BTRFS_FSID_SIZE); | 3111 | BTRFS_FSID_SIZE); |
3112 | 3112 | ||
3113 | write_extent_buffer(c, root->fs_info->chunk_tree_uuid, | 3113 | write_extent_buffer(c, root->fs_info->chunk_tree_uuid, |
3114 | (unsigned long)btrfs_header_chunk_tree_uuid(c), | 3114 | btrfs_header_chunk_tree_uuid(c), BTRFS_UUID_SIZE); |
3115 | BTRFS_UUID_SIZE); | ||
3116 | 3115 | ||
3117 | btrfs_set_node_key(c, &lower_key, 0); | 3116 | btrfs_set_node_key(c, &lower_key, 0); |
3118 | btrfs_set_node_blockptr(c, 0, lower->start); | 3117 | btrfs_set_node_blockptr(c, 0, lower->start); |
@@ -3249,7 +3248,7 @@ static noinline int split_node(struct btrfs_trans_handle *trans, | |||
3249 | write_extent_buffer(split, root->fs_info->fsid, | 3248 | write_extent_buffer(split, root->fs_info->fsid, |
3250 | btrfs_header_fsid(split), BTRFS_FSID_SIZE); | 3249 | btrfs_header_fsid(split), BTRFS_FSID_SIZE); |
3251 | write_extent_buffer(split, root->fs_info->chunk_tree_uuid, | 3250 | write_extent_buffer(split, root->fs_info->chunk_tree_uuid, |
3252 | (unsigned long)btrfs_header_chunk_tree_uuid(split), | 3251 | btrfs_header_chunk_tree_uuid(split), |
3253 | BTRFS_UUID_SIZE); | 3252 | BTRFS_UUID_SIZE); |
3254 | 3253 | ||
3255 | tree_mod_log_eb_copy(root->fs_info, split, c, 0, mid, c_nritems - mid); | 3254 | tree_mod_log_eb_copy(root->fs_info, split, c, 0, mid, c_nritems - mid); |
@@ -4005,7 +4004,7 @@ again: | |||
4005 | btrfs_header_fsid(right), BTRFS_FSID_SIZE); | 4004 | btrfs_header_fsid(right), BTRFS_FSID_SIZE); |
4006 | 4005 | ||
4007 | write_extent_buffer(right, root->fs_info->chunk_tree_uuid, | 4006 | write_extent_buffer(right, root->fs_info->chunk_tree_uuid, |
4008 | (unsigned long)btrfs_header_chunk_tree_uuid(right), | 4007 | btrfs_header_chunk_tree_uuid(right), |
4009 | BTRFS_UUID_SIZE); | 4008 | BTRFS_UUID_SIZE); |
4010 | 4009 | ||
4011 | if (split == 0) { | 4010 | if (split == 0) { |
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 1b8f5def29c7..c90be01cbe67 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -2680,10 +2680,9 @@ static inline unsigned long btrfs_header_fsid(struct extent_buffer *eb) | |||
2680 | return offsetof(struct btrfs_header, fsid); | 2680 | return offsetof(struct btrfs_header, fsid); |
2681 | } | 2681 | } |
2682 | 2682 | ||
2683 | static inline u8 *btrfs_header_chunk_tree_uuid(struct extent_buffer *eb) | 2683 | static inline unsigned long btrfs_header_chunk_tree_uuid(struct extent_buffer *eb) |
2684 | { | 2684 | { |
2685 | unsigned long ptr = offsetof(struct btrfs_header, chunk_tree_uuid); | 2685 | return offsetof(struct btrfs_header, chunk_tree_uuid); |
2686 | return (u8 *)ptr; | ||
2687 | } | 2686 | } |
2688 | 2687 | ||
2689 | static inline int btrfs_is_leaf(struct extent_buffer *eb) | 2688 | static inline int btrfs_is_leaf(struct extent_buffer *eb) |
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index d67a2ddb3ce6..940bc486a0f8 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -1294,7 +1294,7 @@ struct btrfs_root *btrfs_create_tree(struct btrfs_trans_handle *trans, | |||
1294 | write_extent_buffer(leaf, fs_info->fsid, btrfs_header_fsid(leaf), | 1294 | write_extent_buffer(leaf, fs_info->fsid, btrfs_header_fsid(leaf), |
1295 | BTRFS_FSID_SIZE); | 1295 | BTRFS_FSID_SIZE); |
1296 | write_extent_buffer(leaf, fs_info->chunk_tree_uuid, | 1296 | write_extent_buffer(leaf, fs_info->chunk_tree_uuid, |
1297 | (unsigned long)btrfs_header_chunk_tree_uuid(leaf), | 1297 | btrfs_header_chunk_tree_uuid(leaf), |
1298 | BTRFS_UUID_SIZE); | 1298 | BTRFS_UUID_SIZE); |
1299 | btrfs_mark_buffer_dirty(leaf); | 1299 | btrfs_mark_buffer_dirty(leaf); |
1300 | 1300 | ||
@@ -2629,8 +2629,7 @@ int open_ctree(struct super_block *sb, | |||
2629 | chunk_root->commit_root = btrfs_root_node(chunk_root); | 2629 | chunk_root->commit_root = btrfs_root_node(chunk_root); |
2630 | 2630 | ||
2631 | read_extent_buffer(chunk_root->node, fs_info->chunk_tree_uuid, | 2631 | read_extent_buffer(chunk_root->node, fs_info->chunk_tree_uuid, |
2632 | (unsigned long)btrfs_header_chunk_tree_uuid(chunk_root->node), | 2632 | btrfs_header_chunk_tree_uuid(chunk_root->node), BTRFS_UUID_SIZE); |
2633 | BTRFS_UUID_SIZE); | ||
2634 | 2633 | ||
2635 | ret = btrfs_read_chunk_tree(chunk_root); | 2634 | ret = btrfs_read_chunk_tree(chunk_root); |
2636 | if (ret) { | 2635 | if (ret) { |
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 41addd502bc9..0ce93ac17f69 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c | |||
@@ -439,7 +439,7 @@ static noinline int create_subvol(struct inode *dir, | |||
439 | write_extent_buffer(leaf, root->fs_info->fsid, btrfs_header_fsid(leaf), | 439 | write_extent_buffer(leaf, root->fs_info->fsid, btrfs_header_fsid(leaf), |
440 | BTRFS_FSID_SIZE); | 440 | BTRFS_FSID_SIZE); |
441 | write_extent_buffer(leaf, root->fs_info->chunk_tree_uuid, | 441 | write_extent_buffer(leaf, root->fs_info->chunk_tree_uuid, |
442 | (unsigned long)btrfs_header_chunk_tree_uuid(leaf), | 442 | btrfs_header_chunk_tree_uuid(leaf), |
443 | BTRFS_UUID_SIZE); | 443 | BTRFS_UUID_SIZE); |
444 | btrfs_mark_buffer_dirty(leaf); | 444 | btrfs_mark_buffer_dirty(leaf); |
445 | 445 | ||