Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 360496
b: refs/heads/master
c: 06b3a86
h: refs/heads/master
v: v3
  • Loading branch information
Wang Shilong authored and Josef Bacik committed Mar 1, 2013
1 parent 62bb13a commit c70f83d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b8dae3138876080d4dd98cc438ff759338d632ef
refs/heads/master: 06b3a860dcf596bdc2bb1cca3252d3907b581938
34 changes: 21 additions & 13 deletions trunk/fs/btrfs/qgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,9 @@ static int btrfs_clean_quota_tree(struct btrfs_trans_handle *trans,
{
struct btrfs_path *path;
struct btrfs_key key;
struct extent_buffer *leaf = NULL;
int ret;
int nr = 0;

if (!root)
return -EINVAL;
Expand All @@ -741,24 +743,30 @@ static int btrfs_clean_quota_tree(struct btrfs_trans_handle *trans,
if (!path)
return -ENOMEM;

while (1) {
key.objectid = 0;
key.offset = 0;
key.type = 0;
path->leave_spinning = 1;

path->leave_spinning = 1;
key.objectid = 0;
key.offset = 0;
key.type = 0;

while (1) {
ret = btrfs_search_slot(trans, root, &key, path, -1, 1);
if (ret > 0) {
if (path->slots[0] == 0)
break;
path->slots[0]--;
} else if (ret < 0) {
if (ret < 0)
goto out;
leaf = path->nodes[0];
nr = btrfs_header_nritems(leaf);
if (!nr)
break;
}

ret = btrfs_del_item(trans, root, path);
/*
* delete the leaf one by one
* since the whole tree is going
* to be deleted.
*/
path->slots[0] = 0;
ret = btrfs_del_items(trans, root, path, 0, nr);
if (ret)
goto out;

btrfs_release_path(path);
}
ret = 0;
Expand Down

0 comments on commit c70f83d

Please sign in to comment.