Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 274628
b: refs/heads/master
c: 9c8d86d
h: refs/heads/master
v: v3
  • Loading branch information
Josef Bacik committed Oct 19, 2011
1 parent ea3fee2 commit 3dcef2c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4a92b1b8d2810db4ea0c34616b94c0b3810fa027
refs/heads/master: 9c8d86db9aee6f85866d480e0f9b37817264814c
11 changes: 11 additions & 0 deletions trunk/fs/btrfs/transaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,17 +427,26 @@ int btrfs_should_end_transaction(struct btrfs_trans_handle *trans,
struct btrfs_root *root)
{
struct btrfs_transaction *cur_trans = trans->transaction;
struct btrfs_block_rsv *rsv = trans->block_rsv;
int updates;

smp_mb();
if (cur_trans->blocked || cur_trans->delayed_refs.flushing)
return 1;

/*
* We need to do this in case we're deleting csums so the global block
* rsv get's used instead of the csum block rsv.
*/
trans->block_rsv = NULL;

updates = trans->delayed_ref_updates;
trans->delayed_ref_updates = 0;
if (updates)
btrfs_run_delayed_refs(trans, root, updates);

trans->block_rsv = rsv;

return should_end_transaction(trans, root);
}

Expand Down Expand Up @@ -1167,6 +1176,8 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans,

btrfs_run_ordered_operations(root, 0);

trans->block_rsv = NULL;

/* make a pass through all the delayed refs we have so far
* any runnings procs may add more while we are here
*/
Expand Down

0 comments on commit 3dcef2c

Please sign in to comment.