diff options
author | Geert Uytterhoeven <geert@linux-m68k.org> | 2013-08-20 07:20:14 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@fusionio.com> | 2013-09-01 08:16:15 -0400 |
commit | fba6aa75654394fccf2530041e9451414c28084f (patch) | |
tree | b204c6ad9f1c7c0a3dcab4508081acd5afd57963 /fs | |
parent | 231e88f41027d90e9516d257d8085069b65686dd (diff) |
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: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/ctree.c | 15 | ||||
-rw-r--r-- | fs/btrfs/ctree.h | 5 | ||||
-rw-r--r-- | fs/btrfs/disk-io.c | 9 | ||||
-rw-r--r-- | fs/btrfs/ioctl.c | 3 |
4 files changed, 11 insertions, 21 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 1d94242ec002..8e3efe3bad24 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c | |||
@@ -274,8 +274,7 @@ int btrfs_copy_root(struct btrfs_trans_handle *trans, | |||
274 | else | 274 | else |
275 | btrfs_set_header_owner(cow, new_root_objectid); | 275 | btrfs_set_header_owner(cow, new_root_objectid); |
276 | 276 | ||
277 | write_extent_buffer(cow, root->fs_info->fsid, | 277 | write_extent_buffer(cow, root->fs_info->fsid, btrfs_header_fsid(cow), |
278 | (unsigned long)btrfs_header_fsid(cow), | ||
279 | BTRFS_FSID_SIZE); | 278 | BTRFS_FSID_SIZE); |
280 | 279 | ||
281 | WARN_ON(btrfs_header_generation(buf) > trans->transid); | 280 | WARN_ON(btrfs_header_generation(buf) > trans->transid); |
@@ -997,8 +996,7 @@ static noinline int __btrfs_cow_block(struct btrfs_trans_handle *trans, | |||
997 | else | 996 | else |
998 | btrfs_set_header_owner(cow, root->root_key.objectid); | 997 | btrfs_set_header_owner(cow, root->root_key.objectid); |
999 | 998 | ||
1000 | write_extent_buffer(cow, root->fs_info->fsid, | 999 | write_extent_buffer(cow, root->fs_info->fsid, btrfs_header_fsid(cow), |
1001 | (unsigned long)btrfs_header_fsid(cow), | ||
1002 | BTRFS_FSID_SIZE); | 1000 | BTRFS_FSID_SIZE); |
1003 | 1001 | ||
1004 | ret = update_ref_for_cow(trans, root, buf, cow, &last_ref); | 1002 | 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 | btrfs_set_header_backref_rev(c, BTRFS_MIXED_BACKREF_REV); | 3107 | btrfs_set_header_backref_rev(c, BTRFS_MIXED_BACKREF_REV); |
3110 | btrfs_set_header_owner(c, root->root_key.objectid); | 3108 | btrfs_set_header_owner(c, root->root_key.objectid); |
3111 | 3109 | ||
3112 | write_extent_buffer(c, root->fs_info->fsid, | 3110 | write_extent_buffer(c, root->fs_info->fsid, btrfs_header_fsid(c), |
3113 | (unsigned long)btrfs_header_fsid(c), | ||
3114 | BTRFS_FSID_SIZE); | 3111 | BTRFS_FSID_SIZE); |
3115 | 3112 | ||
3116 | write_extent_buffer(c, root->fs_info->chunk_tree_uuid, | 3113 | 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 | btrfs_set_header_backref_rev(split, BTRFS_MIXED_BACKREF_REV); | 3247 | btrfs_set_header_backref_rev(split, BTRFS_MIXED_BACKREF_REV); |
3251 | btrfs_set_header_owner(split, root->root_key.objectid); | 3248 | btrfs_set_header_owner(split, root->root_key.objectid); |
3252 | write_extent_buffer(split, root->fs_info->fsid, | 3249 | write_extent_buffer(split, root->fs_info->fsid, |
3253 | (unsigned long)btrfs_header_fsid(split), | 3250 | btrfs_header_fsid(split), BTRFS_FSID_SIZE); |
3254 | BTRFS_FSID_SIZE); | ||
3255 | write_extent_buffer(split, root->fs_info->chunk_tree_uuid, | 3251 | write_extent_buffer(split, root->fs_info->chunk_tree_uuid, |
3256 | (unsigned long)btrfs_header_chunk_tree_uuid(split), | 3252 | (unsigned long)btrfs_header_chunk_tree_uuid(split), |
3257 | BTRFS_UUID_SIZE); | 3253 | BTRFS_UUID_SIZE); |
@@ -4006,8 +4002,7 @@ again: | |||
4006 | btrfs_set_header_owner(right, root->root_key.objectid); | 4002 | btrfs_set_header_owner(right, root->root_key.objectid); |
4007 | btrfs_set_header_level(right, 0); | 4003 | btrfs_set_header_level(right, 0); |
4008 | write_extent_buffer(right, root->fs_info->fsid, | 4004 | write_extent_buffer(right, root->fs_info->fsid, |
4009 | (unsigned long)btrfs_header_fsid(right), | 4005 | btrfs_header_fsid(right), BTRFS_FSID_SIZE); |
4010 | BTRFS_FSID_SIZE); | ||
4011 | 4006 | ||
4012 | write_extent_buffer(right, root->fs_info->chunk_tree_uuid, | 4007 | write_extent_buffer(right, root->fs_info->chunk_tree_uuid, |
4013 | (unsigned long)btrfs_header_chunk_tree_uuid(right), | 4008 | (unsigned long)btrfs_header_chunk_tree_uuid(right), |
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 2202bd8c5e16..1b8f5def29c7 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -2675,10 +2675,9 @@ static inline void btrfs_set_header_backref_rev(struct extent_buffer *eb, | |||
2675 | btrfs_set_header_flags(eb, flags); | 2675 | btrfs_set_header_flags(eb, flags); |
2676 | } | 2676 | } |
2677 | 2677 | ||
2678 | static inline u8 *btrfs_header_fsid(struct extent_buffer *eb) | 2678 | static inline unsigned long btrfs_header_fsid(struct extent_buffer *eb) |
2679 | { | 2679 | { |
2680 | unsigned long ptr = offsetof(struct btrfs_header, fsid); | 2680 | return offsetof(struct btrfs_header, fsid); |
2681 | return (u8 *)ptr; | ||
2682 | } | 2681 | } |
2683 | 2682 | ||
2684 | static inline u8 *btrfs_header_chunk_tree_uuid(struct extent_buffer *eb) | 2683 | static inline u8 *btrfs_header_chunk_tree_uuid(struct extent_buffer *eb) |
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 5003466b00d2..d67a2ddb3ce6 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -495,8 +495,7 @@ static int check_tree_block_fsid(struct btrfs_root *root, | |||
495 | u8 fsid[BTRFS_UUID_SIZE]; | 495 | u8 fsid[BTRFS_UUID_SIZE]; |
496 | int ret = 1; | 496 | int ret = 1; |
497 | 497 | ||
498 | read_extent_buffer(eb, fsid, (unsigned long)btrfs_header_fsid(eb), | 498 | read_extent_buffer(eb, fsid, btrfs_header_fsid(eb), BTRFS_FSID_SIZE); |
499 | BTRFS_FSID_SIZE); | ||
500 | while (fs_devices) { | 499 | while (fs_devices) { |
501 | if (!memcmp(fsid, fs_devices->fsid, BTRFS_FSID_SIZE)) { | 500 | if (!memcmp(fsid, fs_devices->fsid, BTRFS_FSID_SIZE)) { |
502 | ret = 0; | 501 | ret = 0; |
@@ -1292,8 +1291,7 @@ struct btrfs_root *btrfs_create_tree(struct btrfs_trans_handle *trans, | |||
1292 | btrfs_set_header_owner(leaf, objectid); | 1291 | btrfs_set_header_owner(leaf, objectid); |
1293 | root->node = leaf; | 1292 | root->node = leaf; |
1294 | 1293 | ||
1295 | write_extent_buffer(leaf, fs_info->fsid, | 1294 | write_extent_buffer(leaf, fs_info->fsid, btrfs_header_fsid(leaf), |
1296 | (unsigned long)btrfs_header_fsid(leaf), | ||
1297 | BTRFS_FSID_SIZE); | 1295 | BTRFS_FSID_SIZE); |
1298 | write_extent_buffer(leaf, fs_info->chunk_tree_uuid, | 1296 | write_extent_buffer(leaf, fs_info->chunk_tree_uuid, |
1299 | (unsigned long)btrfs_header_chunk_tree_uuid(leaf), | 1297 | (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 | root->node = leaf; | 1378 | root->node = leaf; |
1381 | 1379 | ||
1382 | write_extent_buffer(root->node, root->fs_info->fsid, | 1380 | write_extent_buffer(root->node, root->fs_info->fsid, |
1383 | (unsigned long)btrfs_header_fsid(root->node), | 1381 | btrfs_header_fsid(root->node), BTRFS_FSID_SIZE); |
1384 | BTRFS_FSID_SIZE); | ||
1385 | btrfs_mark_buffer_dirty(root->node); | 1382 | btrfs_mark_buffer_dirty(root->node); |
1386 | btrfs_tree_unlock(root->node); | 1383 | btrfs_tree_unlock(root->node); |
1387 | return root; | 1384 | return root; |
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 996951a8d28d..41addd502bc9 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c | |||
@@ -436,8 +436,7 @@ static noinline int create_subvol(struct inode *dir, | |||
436 | btrfs_set_header_backref_rev(leaf, BTRFS_MIXED_BACKREF_REV); | 436 | btrfs_set_header_backref_rev(leaf, BTRFS_MIXED_BACKREF_REV); |
437 | btrfs_set_header_owner(leaf, objectid); | 437 | btrfs_set_header_owner(leaf, objectid); |
438 | 438 | ||
439 | write_extent_buffer(leaf, root->fs_info->fsid, | 439 | write_extent_buffer(leaf, root->fs_info->fsid, btrfs_header_fsid(leaf), |
440 | (unsigned long)btrfs_header_fsid(leaf), | ||
441 | BTRFS_FSID_SIZE); | 440 | BTRFS_FSID_SIZE); |
442 | write_extent_buffer(leaf, root->fs_info->chunk_tree_uuid, | 441 | write_extent_buffer(leaf, root->fs_info->chunk_tree_uuid, |
443 | (unsigned long)btrfs_header_chunk_tree_uuid(leaf), | 442 | (unsigned long)btrfs_header_chunk_tree_uuid(leaf), |