@@ -644,6 +644,7 @@ int btrfs_alloc_chunk(struct btrfs_trans_handle *trans,
u64 avail;
u64 max_avail = 0;
u64 percent_max;
+ u64 offset;
int num_stripes = 1;
int min_stripes = 1;
int sub_stripes = 0;
@@ -760,7 +761,8 @@ again:
key.objectid = BTRFS_FIRST_CHUNK_TREE_OBJECTID;
key.type = BTRFS_CHUNK_ITEM_KEY;
ret = find_next_chunk(chunk_root, BTRFS_FIRST_CHUNK_TREE_OBJECTID,
- &key.offset);
+ &offset);
+ key.offset = offset;
if (ret)
return ret;
@@ -864,6 +866,7 @@ int btrfs_alloc_data_chunk(struct btrfs_trans_handle *trans,
struct list_head *cur;
struct map_lookup *map;
u64 calc_size = 8 * 1024 * 1024;
+ u64 offset;
int num_stripes = 1;
int sub_stripes = 0;
int ret;
@@ -874,7 +877,8 @@ int btrfs_alloc_data_chunk(struct btrfs_trans_handle *trans,
key.objectid = BTRFS_FIRST_CHUNK_TREE_OBJECTID;
key.type = BTRFS_CHUNK_ITEM_KEY;
ret = find_next_chunk(chunk_root, BTRFS_FIRST_CHUNK_TREE_OBJECTID,
- &key.offset);
+ &offset);
+ key.offset = offset;
if (ret)
return ret;