aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/btrfs/ctree.h4
-rw-r--r--fs/btrfs/volumes.c8
2 files changed, 5 insertions, 7 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index b4e70537cada..b71bc3a99342 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -2169,9 +2169,9 @@ static inline unsigned long btrfs_device_uuid(struct btrfs_dev_item *d)
2169 return (unsigned long)d + offsetof(struct btrfs_dev_item, uuid); 2169 return (unsigned long)d + offsetof(struct btrfs_dev_item, uuid);
2170} 2170}
2171 2171
2172static inline char *btrfs_device_fsid(struct btrfs_dev_item *d) 2172static inline unsigned long btrfs_device_fsid(struct btrfs_dev_item *d)
2173{ 2173{
2174 return (char *)d + offsetof(struct btrfs_dev_item, fsid); 2174 return (unsigned long)d + offsetof(struct btrfs_dev_item, fsid);
2175} 2175}
2176 2176
2177BTRFS_SETGET_FUNCS(chunk_length, struct btrfs_chunk, length, 64); 2177BTRFS_SETGET_FUNCS(chunk_length, struct btrfs_chunk, length, 64);
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 9ea500465256..8b8c4397165c 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -1426,7 +1426,7 @@ static int btrfs_add_device(struct btrfs_trans_handle *trans,
1426 1426
1427 ptr = btrfs_device_uuid(dev_item); 1427 ptr = btrfs_device_uuid(dev_item);
1428 write_extent_buffer(leaf, device->uuid, ptr, BTRFS_UUID_SIZE); 1428 write_extent_buffer(leaf, device->uuid, ptr, BTRFS_UUID_SIZE);
1429 ptr = (unsigned long)btrfs_device_fsid(dev_item); 1429 ptr = btrfs_device_fsid(dev_item);
1430 write_extent_buffer(leaf, root->fs_info->fsid, ptr, BTRFS_UUID_SIZE); 1430 write_extent_buffer(leaf, root->fs_info->fsid, ptr, BTRFS_UUID_SIZE);
1431 btrfs_mark_buffer_dirty(leaf); 1431 btrfs_mark_buffer_dirty(leaf);
1432 1432
@@ -1926,8 +1926,7 @@ next_slot:
1926 devid = btrfs_device_id(leaf, dev_item); 1926 devid = btrfs_device_id(leaf, dev_item);
1927 read_extent_buffer(leaf, dev_uuid, btrfs_device_uuid(dev_item), 1927 read_extent_buffer(leaf, dev_uuid, btrfs_device_uuid(dev_item),
1928 BTRFS_UUID_SIZE); 1928 BTRFS_UUID_SIZE);
1929 read_extent_buffer(leaf, fs_uuid, 1929 read_extent_buffer(leaf, fs_uuid, btrfs_device_fsid(dev_item),
1930 (unsigned long)btrfs_device_fsid(dev_item),
1931 BTRFS_UUID_SIZE); 1930 BTRFS_UUID_SIZE);
1932 device = btrfs_find_device(root->fs_info, devid, dev_uuid, 1931 device = btrfs_find_device(root->fs_info, devid, dev_uuid,
1933 fs_uuid); 1932 fs_uuid);
@@ -5824,8 +5823,7 @@ static int read_one_dev(struct btrfs_root *root,
5824 devid = btrfs_device_id(leaf, dev_item); 5823 devid = btrfs_device_id(leaf, dev_item);
5825 read_extent_buffer(leaf, dev_uuid, btrfs_device_uuid(dev_item), 5824 read_extent_buffer(leaf, dev_uuid, btrfs_device_uuid(dev_item),
5826 BTRFS_UUID_SIZE); 5825 BTRFS_UUID_SIZE);
5827 read_extent_buffer(leaf, fs_uuid, 5826 read_extent_buffer(leaf, fs_uuid, btrfs_device_fsid(dev_item),
5828 (unsigned long)btrfs_device_fsid(dev_item),
5829 BTRFS_UUID_SIZE); 5827 BTRFS_UUID_SIZE);
5830 5828
5831 if (memcmp(fs_uuid, root->fs_info->fsid, BTRFS_UUID_SIZE)) { 5829 if (memcmp(fs_uuid, root->fs_info->fsid, BTRFS_UUID_SIZE)) {