]> git.karo-electronics.de Git - linux-beck.git/blobdiff - fs/btrfs/async-thread.c
Merge branch 'next' of master.kernel.org:/pub/scm/linux/kernel/git/galak/powerpc...
[linux-beck.git] / fs / btrfs / async-thread.c
index c84ca1f5259a5408f538d8254f939677567924a4..51bfdfc8fcdac00b5f13599bed87922563a38f07 100644 (file)
@@ -20,7 +20,6 @@
 #include <linux/list.h>
 #include <linux/spinlock.h>
 #include <linux/freezer.h>
-#include <linux/ftrace.h>
 #include "async-thread.h"
 
 #define WORK_QUEUED_BIT 0
@@ -195,6 +194,9 @@ again_locked:
                                if (!list_empty(&worker->pending))
                                        continue;
 
+                               if (kthread_should_stop())
+                                       break;
+
                                /* still no more work?, sleep for real */
                                spin_lock_irq(&worker->lock);
                                set_current_state(TASK_INTERRUPTIBLE);
@@ -208,7 +210,8 @@ again_locked:
                                worker->working = 0;
                                spin_unlock_irq(&worker->lock);
 
-                               schedule();
+                               if (!kthread_should_stop())
+                                       schedule();
                        }
                        __set_current_state(TASK_RUNNING);
                }