diff options
Diffstat (limited to 'fs/jffs2/background.c')
-rw-r--r-- | fs/jffs2/background.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/jffs2/background.c b/fs/jffs2/background.c index 143c5530caf3..d568ae846741 100644 --- a/fs/jffs2/background.c +++ b/fs/jffs2/background.c | |||
@@ -23,8 +23,8 @@ static int jffs2_garbage_collect_thread(void *); | |||
23 | void jffs2_garbage_collect_trigger(struct jffs2_sb_info *c) | 23 | void jffs2_garbage_collect_trigger(struct jffs2_sb_info *c) |
24 | { | 24 | { |
25 | spin_lock(&c->erase_completion_lock); | 25 | spin_lock(&c->erase_completion_lock); |
26 | if (c->gc_task && jffs2_thread_should_wake(c)) | 26 | if (c->gc_task && jffs2_thread_should_wake(c)) |
27 | send_sig(SIGHUP, c->gc_task, 1); | 27 | send_sig(SIGHUP, c->gc_task, 1); |
28 | spin_unlock(&c->erase_completion_lock); | 28 | spin_unlock(&c->erase_completion_lock); |
29 | } | 29 | } |
30 | 30 | ||
@@ -84,7 +84,7 @@ static int jffs2_garbage_collect_thread(void *_c) | |||
84 | set_freezable(); | 84 | set_freezable(); |
85 | for (;;) { | 85 | for (;;) { |
86 | allow_signal(SIGHUP); | 86 | allow_signal(SIGHUP); |
87 | 87 | again: | |
88 | if (!jffs2_thread_should_wake(c)) { | 88 | if (!jffs2_thread_should_wake(c)) { |
89 | set_current_state (TASK_INTERRUPTIBLE); | 89 | set_current_state (TASK_INTERRUPTIBLE); |
90 | D1(printk(KERN_DEBUG "jffs2_garbage_collect_thread sleeping...\n")); | 90 | D1(printk(KERN_DEBUG "jffs2_garbage_collect_thread sleeping...\n")); |
@@ -95,9 +95,6 @@ static int jffs2_garbage_collect_thread(void *_c) | |||
95 | schedule(); | 95 | schedule(); |
96 | } | 96 | } |
97 | 97 | ||
98 | if (try_to_freeze()) | ||
99 | continue; | ||
100 | |||
101 | /* This thread is purely an optimisation. But if it runs when | 98 | /* This thread is purely an optimisation. But if it runs when |
102 | other things could be running, it actually makes things a | 99 | other things could be running, it actually makes things a |
103 | lot worse. Use yield() and put it at the back of the runqueue | 100 | lot worse. Use yield() and put it at the back of the runqueue |
@@ -112,6 +109,9 @@ static int jffs2_garbage_collect_thread(void *_c) | |||
112 | siginfo_t info; | 109 | siginfo_t info; |
113 | unsigned long signr; | 110 | unsigned long signr; |
114 | 111 | ||
112 | if (try_to_freeze()) | ||
113 | goto again; | ||
114 | |||
115 | signr = dequeue_signal_lock(current, ¤t->blocked, &info); | 115 | signr = dequeue_signal_lock(current, ¤t->blocked, &info); |
116 | 116 | ||
117 | switch(signr) { | 117 | switch(signr) { |