Btrfs: make aux field of ulist 64 bit
Btrfs send/receive uses the aux field to store inode numbers. On 32 bit machines this may become a problem. Also fix all users of ulist_add and ulist_add_merged. Reported-by: Arne Jansen <sensille@gmx.net> Signed-off-by: Alexander Block <ablock84@googlemail.com>
This commit is contained in:

committed by
Chris Mason

parent
7e0926fe5f
commit
34d73f54e2
@@ -1145,7 +1145,7 @@ int btrfs_qgroup_account_ref(struct btrfs_trans_handle *trans,
|
||||
|
||||
ulist_reinit(tmp);
|
||||
/* XXX id not needed */
|
||||
ulist_add(tmp, qg->qgroupid, (unsigned long)qg, GFP_ATOMIC);
|
||||
ulist_add(tmp, qg->qgroupid, (u64)qg, GFP_ATOMIC);
|
||||
ULIST_ITER_INIT(&tmp_uiter);
|
||||
while ((tmp_unode = ulist_next(tmp, &tmp_uiter))) {
|
||||
struct btrfs_qgroup_list *glist;
|
||||
@@ -1158,7 +1158,7 @@ int btrfs_qgroup_account_ref(struct btrfs_trans_handle *trans,
|
||||
|
||||
list_for_each_entry(glist, &qg->groups, next_group) {
|
||||
ulist_add(tmp, glist->group->qgroupid,
|
||||
(unsigned long)glist->group,
|
||||
(u64)glist->group,
|
||||
GFP_ATOMIC);
|
||||
}
|
||||
}
|
||||
@@ -1168,7 +1168,7 @@ int btrfs_qgroup_account_ref(struct btrfs_trans_handle *trans,
|
||||
* step 2: walk from the new root
|
||||
*/
|
||||
ulist_reinit(tmp);
|
||||
ulist_add(tmp, qgroup->qgroupid, (unsigned long)qgroup, GFP_ATOMIC);
|
||||
ulist_add(tmp, qgroup->qgroupid, (u64)qgroup, GFP_ATOMIC);
|
||||
ULIST_ITER_INIT(&uiter);
|
||||
while ((unode = ulist_next(tmp, &uiter))) {
|
||||
struct btrfs_qgroup *qg;
|
||||
@@ -1190,7 +1190,7 @@ int btrfs_qgroup_account_ref(struct btrfs_trans_handle *trans,
|
||||
|
||||
list_for_each_entry(glist, &qg->groups, next_group) {
|
||||
ulist_add(tmp, glist->group->qgroupid,
|
||||
(unsigned long)glist->group, GFP_ATOMIC);
|
||||
(u64)glist->group, GFP_ATOMIC);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1208,7 +1208,7 @@ int btrfs_qgroup_account_ref(struct btrfs_trans_handle *trans,
|
||||
continue;
|
||||
|
||||
ulist_reinit(tmp);
|
||||
ulist_add(tmp, qg->qgroupid, (unsigned long)qg, GFP_ATOMIC);
|
||||
ulist_add(tmp, qg->qgroupid, (u64)qg, GFP_ATOMIC);
|
||||
ULIST_ITER_INIT(&tmp_uiter);
|
||||
while ((tmp_unode = ulist_next(tmp, &tmp_uiter))) {
|
||||
struct btrfs_qgroup_list *glist;
|
||||
@@ -1225,7 +1225,7 @@ int btrfs_qgroup_account_ref(struct btrfs_trans_handle *trans,
|
||||
|
||||
list_for_each_entry(glist, &qg->groups, next_group) {
|
||||
ulist_add(tmp, glist->group->qgroupid,
|
||||
(unsigned long)glist->group,
|
||||
(u64)glist->group,
|
||||
GFP_ATOMIC);
|
||||
}
|
||||
}
|
||||
@@ -1469,7 +1469,7 @@ int btrfs_qgroup_reserve(struct btrfs_root *root, u64 num_bytes)
|
||||
* be exceeded
|
||||
*/
|
||||
ulist = ulist_alloc(GFP_ATOMIC);
|
||||
ulist_add(ulist, qgroup->qgroupid, (unsigned long)qgroup, GFP_ATOMIC);
|
||||
ulist_add(ulist, qgroup->qgroupid, (u64)qgroup, GFP_ATOMIC);
|
||||
ULIST_ITER_INIT(&uiter);
|
||||
while ((unode = ulist_next(ulist, &uiter))) {
|
||||
struct btrfs_qgroup *qg;
|
||||
@@ -1489,7 +1489,7 @@ int btrfs_qgroup_reserve(struct btrfs_root *root, u64 num_bytes)
|
||||
|
||||
list_for_each_entry(glist, &qg->groups, next_group) {
|
||||
ulist_add(ulist, glist->group->qgroupid,
|
||||
(unsigned long)glist->group, GFP_ATOMIC);
|
||||
(u64)glist->group, GFP_ATOMIC);
|
||||
}
|
||||
}
|
||||
if (ret)
|
||||
@@ -1541,7 +1541,7 @@ void btrfs_qgroup_free(struct btrfs_root *root, u64 num_bytes)
|
||||
goto out;
|
||||
|
||||
ulist = ulist_alloc(GFP_ATOMIC);
|
||||
ulist_add(ulist, qgroup->qgroupid, (unsigned long)qgroup, GFP_ATOMIC);
|
||||
ulist_add(ulist, qgroup->qgroupid, (u64)qgroup, GFP_ATOMIC);
|
||||
ULIST_ITER_INIT(&uiter);
|
||||
while ((unode = ulist_next(ulist, &uiter))) {
|
||||
struct btrfs_qgroup *qg;
|
||||
@@ -1553,7 +1553,7 @@ void btrfs_qgroup_free(struct btrfs_root *root, u64 num_bytes)
|
||||
|
||||
list_for_each_entry(glist, &qg->groups, next_group) {
|
||||
ulist_add(ulist, glist->group->qgroupid,
|
||||
(unsigned long)glist->group, GFP_ATOMIC);
|
||||
(u64)glist->group, GFP_ATOMIC);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user