Btrfs: fix crash during unmount due to race with delayed inode workers
[linux-2.6-microblaze.git] / fs / btrfs / async-thread.c
index 1d32a07..309516e 100644 (file)
@@ -395,3 +395,11 @@ void btrfs_set_work_high_priority(struct btrfs_work *work)
 {
        set_bit(WORK_HIGH_PRIO_BIT, &work->flags);
 }
+
+void btrfs_flush_workqueue(struct btrfs_workqueue *wq)
+{
+       if (wq->high)
+               flush_workqueue(wq->high->normal_wq);
+
+       flush_workqueue(wq->normal->normal_wq);
+}