summaryrefslogtreecommitdiff
path: root/fs/ubifs
diff options
context:
space:
mode:
authorAdrian Hunter <ext-adrian.hunter@nokia.com>2008-05-26 12:58:39 +0300
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2008-06-06 18:50:34 +0300
commit8915c194ddeb67506838e01e3db4dedf42c40e50 (patch)
treec6da884443e572b1babb81e074c14f88a6630ded /fs/ubifs
parent67097ae31f0da37d866eb40666ef106e46c1581b (diff)
UBIFS: remove unnecessary 'if' in bg thread
Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
Diffstat (limited to 'fs/ubifs')
-rw-r--r--fs/ubifs/commit.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/fs/ubifs/commit.c b/fs/ubifs/commit.c
index 188ced185d08..950396faefd0 100644
--- a/fs/ubifs/commit.c
+++ b/fs/ubifs/commit.c
@@ -246,25 +246,20 @@ int ubifs_bg_thread(void *info)
if (try_to_freeze())
continue;
+ set_current_state(TASK_INTERRUPTIBLE);
+ /* Check if there is something to do */
if (!c->need_bgt) {
- set_current_state(TASK_INTERRUPTIBLE);
/*
- * Check for the second time to make sure we have not
- * missed a wake_up event.
+ * Nothing prevents us from going sleep now and
+ * be never woken up and block the task which
+ * could wait in 'kthread_stop()' forever.
*/
- if (!c->need_bgt) {
- /*
- * Nothing prevents us from going sleep now and
- * be never woken up and block the task which
- * could wait in 'kthread_stop()' forever.
- */
- if (kthread_should_stop())
- break;
- schedule();
- continue;
- } else
- __set_current_state(TASK_RUNNING);
- }
+ if (kthread_should_stop())
+ break;
+ schedule();
+ continue;
+ } else
+ __set_current_state(TASK_RUNNING);
c->need_bgt = 0;
err = ubifs_bg_wbufs_sync(c);