diff options
author | Chris Mason <chris.mason@oracle.com> | 2007-06-09 08:19:57 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@hera.kernel.org> | 2007-06-09 08:19:57 -0400 |
commit | ad693af684757478e5fcb225aef319cab7ba6c75 (patch) | |
tree | 10340bc4d3c10d500487aa337ac58eef60808739 /fs/btrfs/transaction.c | |
parent | facda1e787d43191a3368c322f682054991c41b8 (diff) |
Btrfs: reap dead roots right after commit
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/transaction.c')
-rw-r--r-- | fs/btrfs/transaction.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index b859db395fd5..a2c5820f1d3d 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c | |||
@@ -371,13 +371,6 @@ void btrfs_transaction_cleaner(struct work_struct *work) | |||
371 | int ret; | 371 | int ret; |
372 | 372 | ||
373 | INIT_LIST_HEAD(&dirty_roots); | 373 | INIT_LIST_HEAD(&dirty_roots); |
374 | mutex_lock(&root->fs_info->trans_mutex); | ||
375 | list_splice_init(&root->fs_info->dead_roots, &dirty_roots); | ||
376 | mutex_unlock(&root->fs_info->trans_mutex); | ||
377 | |||
378 | if (!list_empty(&dirty_roots)) { | ||
379 | drop_dirty_roots(root, &dirty_roots); | ||
380 | } | ||
381 | mutex_lock(&root->fs_info->fs_mutex); | 374 | mutex_lock(&root->fs_info->fs_mutex); |
382 | mutex_lock(&root->fs_info->trans_mutex); | 375 | mutex_lock(&root->fs_info->trans_mutex); |
383 | cur = root->fs_info->running_transaction; | 376 | cur = root->fs_info->running_transaction; |
@@ -396,6 +389,14 @@ void btrfs_transaction_cleaner(struct work_struct *work) | |||
396 | ret = btrfs_commit_transaction(trans, root); | 389 | ret = btrfs_commit_transaction(trans, root); |
397 | out: | 390 | out: |
398 | mutex_unlock(&root->fs_info->fs_mutex); | 391 | mutex_unlock(&root->fs_info->fs_mutex); |
392 | |||
393 | mutex_lock(&root->fs_info->trans_mutex); | ||
394 | list_splice_init(&root->fs_info->dead_roots, &dirty_roots); | ||
395 | mutex_unlock(&root->fs_info->trans_mutex); | ||
396 | |||
397 | if (!list_empty(&dirty_roots)) { | ||
398 | drop_dirty_roots(root, &dirty_roots); | ||
399 | } | ||
399 | btrfs_transaction_queue_work(root, delay); | 400 | btrfs_transaction_queue_work(root, delay); |
400 | } | 401 | } |
401 | 402 | ||