diff options
author | Yan Zheng <zheng.yan@oracle.com> | 2008-08-04 23:23:47 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 11:04:06 -0400 |
commit | b48652c101cce7a54379a49cc0cf854cec2c94e2 (patch) | |
tree | 13e8250b326b71fed80811e1ed3b19b00beded31 /fs/btrfs/transaction.c | |
parent | 3de9d6b649b4cc60687be92e71cef36d7d4e8f2f (diff) |
Btrfs: Various small fixes.
This trivial patch contains two locking fixes and a off by one fix.
---
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/transaction.c')
-rw-r--r-- | fs/btrfs/transaction.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index a2c821e3c3a7..ebf5362da1d2 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c | |||
@@ -389,9 +389,7 @@ int btrfs_commit_tree_roots(struct btrfs_trans_handle *trans, | |||
389 | return 0; | 389 | return 0; |
390 | } | 390 | } |
391 | 391 | ||
392 | int btrfs_add_dead_root(struct btrfs_root *root, | 392 | int btrfs_add_dead_root(struct btrfs_root *root, struct btrfs_root *latest) |
393 | struct btrfs_root *latest, | ||
394 | struct list_head *dead_list) | ||
395 | { | 393 | { |
396 | struct btrfs_dirty_root *dirty; | 394 | struct btrfs_dirty_root *dirty; |
397 | 395 | ||
@@ -400,7 +398,10 @@ int btrfs_add_dead_root(struct btrfs_root *root, | |||
400 | return -ENOMEM; | 398 | return -ENOMEM; |
401 | dirty->root = root; | 399 | dirty->root = root; |
402 | dirty->latest_root = latest; | 400 | dirty->latest_root = latest; |
403 | list_add(&dirty->list, dead_list); | 401 | |
402 | mutex_lock(&root->fs_info->trans_mutex); | ||
403 | list_add(&dirty->list, &latest->fs_info->dead_roots); | ||
404 | mutex_unlock(&root->fs_info->trans_mutex); | ||
404 | return 0; | 405 | return 0; |
405 | } | 406 | } |
406 | 407 | ||