Commit a1840b50 authored by David Sterba's avatar David Sterba

btrfs: use helper to set ulist aux from a qgroup

We have a nice helper to do proper casting of a qgroup to a ulist aux
value. And several places that could make use of it.
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 0b78877a
...@@ -2434,7 +2434,7 @@ static int qgroup_reserve(struct btrfs_root *root, u64 num_bytes, bool enforce, ...@@ -2434,7 +2434,7 @@ static int qgroup_reserve(struct btrfs_root *root, u64 num_bytes, bool enforce,
*/ */
ulist_reinit(fs_info->qgroup_ulist); ulist_reinit(fs_info->qgroup_ulist);
ret = ulist_add(fs_info->qgroup_ulist, qgroup->qgroupid, ret = ulist_add(fs_info->qgroup_ulist, qgroup->qgroupid,
(uintptr_t)qgroup, GFP_ATOMIC); qgroup_to_aux(qgroup), GFP_ATOMIC);
if (ret < 0) if (ret < 0)
goto out; goto out;
ULIST_ITER_INIT(&uiter); ULIST_ITER_INIT(&uiter);
...@@ -2452,7 +2452,7 @@ static int qgroup_reserve(struct btrfs_root *root, u64 num_bytes, bool enforce, ...@@ -2452,7 +2452,7 @@ static int qgroup_reserve(struct btrfs_root *root, u64 num_bytes, bool enforce,
list_for_each_entry(glist, &qg->groups, next_group) { list_for_each_entry(glist, &qg->groups, next_group) {
ret = ulist_add(fs_info->qgroup_ulist, ret = ulist_add(fs_info->qgroup_ulist,
glist->group->qgroupid, glist->group->qgroupid,
(uintptr_t)glist->group, GFP_ATOMIC); qgroup_to_aux(glist->group), GFP_ATOMIC);
if (ret < 0) if (ret < 0)
goto out; goto out;
} }
...@@ -2524,7 +2524,7 @@ void btrfs_qgroup_free_refroot(struct btrfs_fs_info *fs_info, ...@@ -2524,7 +2524,7 @@ void btrfs_qgroup_free_refroot(struct btrfs_fs_info *fs_info,
ulist_reinit(fs_info->qgroup_ulist); ulist_reinit(fs_info->qgroup_ulist);
ret = ulist_add(fs_info->qgroup_ulist, qgroup->qgroupid, ret = ulist_add(fs_info->qgroup_ulist, qgroup->qgroupid,
(uintptr_t)qgroup, GFP_ATOMIC); qgroup_to_aux(qgroup), GFP_ATOMIC);
if (ret < 0) if (ret < 0)
goto out; goto out;
ULIST_ITER_INIT(&uiter); ULIST_ITER_INIT(&uiter);
...@@ -2540,7 +2540,7 @@ void btrfs_qgroup_free_refroot(struct btrfs_fs_info *fs_info, ...@@ -2540,7 +2540,7 @@ void btrfs_qgroup_free_refroot(struct btrfs_fs_info *fs_info,
list_for_each_entry(glist, &qg->groups, next_group) { list_for_each_entry(glist, &qg->groups, next_group) {
ret = ulist_add(fs_info->qgroup_ulist, ret = ulist_add(fs_info->qgroup_ulist,
glist->group->qgroupid, glist->group->qgroupid,
(uintptr_t)glist->group, GFP_ATOMIC); qgroup_to_aux(glist->group), GFP_ATOMIC);
if (ret < 0) if (ret < 0)
goto out; goto out;
} }
...@@ -3186,7 +3186,7 @@ static void qgroup_convert_meta(struct btrfs_fs_info *fs_info, u64 ref_root, ...@@ -3186,7 +3186,7 @@ static void qgroup_convert_meta(struct btrfs_fs_info *fs_info, u64 ref_root,
goto out; goto out;
ulist_reinit(fs_info->qgroup_ulist); ulist_reinit(fs_info->qgroup_ulist);
ret = ulist_add(fs_info->qgroup_ulist, qgroup->qgroupid, ret = ulist_add(fs_info->qgroup_ulist, qgroup->qgroupid,
(uintptr_t)qgroup, GFP_ATOMIC); qgroup_to_aux(qgroup), GFP_ATOMIC);
if (ret < 0) if (ret < 0)
goto out; goto out;
ULIST_ITER_INIT(&uiter); ULIST_ITER_INIT(&uiter);
...@@ -3203,7 +3203,7 @@ static void qgroup_convert_meta(struct btrfs_fs_info *fs_info, u64 ref_root, ...@@ -3203,7 +3203,7 @@ static void qgroup_convert_meta(struct btrfs_fs_info *fs_info, u64 ref_root,
list_for_each_entry(glist, &qg->groups, next_group) { list_for_each_entry(glist, &qg->groups, next_group) {
ret = ulist_add(fs_info->qgroup_ulist, ret = ulist_add(fs_info->qgroup_ulist,
glist->group->qgroupid, glist->group->qgroupid,
(uintptr_t)glist->group, GFP_ATOMIC); qgroup_to_aux(glist->group), GFP_ATOMIC);
if (ret < 0) if (ret < 0)
goto out; goto out;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment