Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 139472
b: refs/heads/master
c: 1a81af4
h: refs/heads/master
v: v3
  • Loading branch information
Chris Mason committed Mar 25, 2009
1 parent 7fa730f commit d2e6617
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 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: af4176b49c5ee15a9c9b10720c92456b28e7aac7
refs/heads/master: 1a81af4d1d9c60d4313309f937a1fc5567205a87
10 changes: 7 additions & 3 deletions trunk/fs/btrfs/delayed-ref.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,8 +450,12 @@ static noinline int __btrfs_add_delayed_ref(struct btrfs_trans_handle *trans,
* the head node stores the sum of all the mods, so dropping a ref
* should drop the sum in the head node by one.
*/
if (parent == (u64)-1 && action == BTRFS_DROP_DELAYED_REF)
count_mod = -1;
if (parent == (u64)-1) {
if (action == BTRFS_DROP_DELAYED_REF)
count_mod = -1;
else if (action == BTRFS_UPDATE_DELAYED_HEAD)
count_mod = 0;
}

/*
* BTRFS_ADD_DELAYED_EXTENT means that we need to update
Expand Down Expand Up @@ -647,7 +651,7 @@ int btrfs_update_delayed_ref(struct btrfs_trans_handle *trans,
*/
ret = __btrfs_add_delayed_ref(trans, &head_ref->node, bytenr, num_bytes,
(u64)-1, 0, 0, 0,
BTRFS_ADD_DELAYED_REF, 0);
BTRFS_UPDATE_DELAYED_HEAD, 0);
BUG_ON(ret);

ret = __btrfs_add_delayed_ref(trans, &ref->node, bytenr, num_bytes,
Expand Down
1 change: 1 addition & 0 deletions trunk/fs/btrfs/delayed-ref.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#define BTRFS_ADD_DELAYED_REF 1 /* add one backref to the tree */
#define BTRFS_DROP_DELAYED_REF 2 /* delete one backref from the tree */
#define BTRFS_ADD_DELAYED_EXTENT 3 /* record a full extent allocation */
#define BTRFS_UPDATE_DELAYED_HEAD 4 /* not changing ref count on head ref */

struct btrfs_delayed_ref_node {
struct rb_node rb_node;
Expand Down

0 comments on commit d2e6617

Please sign in to comment.