aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/transaction.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-04-30 13:59:35 -0400
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:04:02 -0400
commitd6bfde8765668c8687de72f7a40f52acdf4f2f19 (patch)
tree2e05fc608da861dd0935dedf88d94627f13a18b3 /fs/btrfs/transaction.c
parent2fff734fafa742236aecbdcdc8b1ff4d221cbaca (diff)
Btrfs: Fixes for 2.6.18 enterprise kernels
2.6.18 seems to get caught in an infinite loop when cancel_rearming_delayed_workqueue is called more than once, so this switches to cancel_delayed_work, which is arguably more correct. Also, balance_dirty_pages can run into problems with 2.6.18 based kernels because it doesn't have the per-bdi dirty limits. This avoids calling balance_dirty_pages on the btree inode unless there is actually something to balance, which is a good optimization in general. Finally there's a compile fix for ordered-data.h Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/transaction.c')
-rw-r--r--fs/btrfs/transaction.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index c85cb48d95ee..9826942fa18a 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -814,6 +814,9 @@ void btrfs_transaction_cleaner(struct work_struct *work)
814 int ret; 814 int ret;
815 815
816 mutex_lock(&root->fs_info->fs_mutex); 816 mutex_lock(&root->fs_info->fs_mutex);
817 if (root->fs_info->closing)
818 goto out;
819
817 mutex_lock(&root->fs_info->trans_mutex); 820 mutex_lock(&root->fs_info->trans_mutex);
818 cur = root->fs_info->running_transaction; 821 cur = root->fs_info->running_transaction;
819 if (!cur) { 822 if (!cur) {
@@ -838,12 +841,13 @@ out:
838 841
839void btrfs_transaction_queue_work(struct btrfs_root *root, int delay) 842void btrfs_transaction_queue_work(struct btrfs_root *root, int delay)
840{ 843{
841 queue_delayed_work(trans_wq, &root->fs_info->trans_work, delay); 844 if (!root->fs_info->closing)
845 queue_delayed_work(trans_wq, &root->fs_info->trans_work, delay);
842} 846}
843 847
844void btrfs_transaction_flush_work(struct btrfs_root *root) 848void btrfs_transaction_flush_work(struct btrfs_root *root)
845{ 849{
846 cancel_rearming_delayed_workqueue(trans_wq, &root->fs_info->trans_work); 850 cancel_delayed_work(&root->fs_info->trans_work);
847 flush_workqueue(trans_wq); 851 flush_workqueue(trans_wq);
848} 852}
849 853