diff options
Diffstat (limited to 'fs/jffs2/background.c')
-rw-r--r-- | fs/jffs2/background.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/fs/jffs2/background.c b/fs/jffs2/background.c index 404111b016c9..26ce06cd4d0f 100644 --- a/fs/jffs2/background.c +++ b/fs/jffs2/background.c | |||
@@ -47,7 +47,8 @@ int jffs2_start_garbage_collect_thread(struct jffs2_sb_info *c) | |||
47 | ret = PTR_ERR(tsk); | 47 | ret = PTR_ERR(tsk); |
48 | } else { | 48 | } else { |
49 | /* Wait for it... */ | 49 | /* Wait for it... */ |
50 | D1(printk(KERN_DEBUG "JFFS2: Garbage collect thread is pid %d\n", tsk->pid)); | 50 | jffs2_dbg(1, "JFFS2: Garbage collect thread is pid %d\n", |
51 | tsk->pid); | ||
51 | wait_for_completion(&c->gc_thread_start); | 52 | wait_for_completion(&c->gc_thread_start); |
52 | ret = tsk->pid; | 53 | ret = tsk->pid; |
53 | } | 54 | } |
@@ -60,7 +61,7 @@ void jffs2_stop_garbage_collect_thread(struct jffs2_sb_info *c) | |||
60 | int wait = 0; | 61 | int wait = 0; |
61 | spin_lock(&c->erase_completion_lock); | 62 | spin_lock(&c->erase_completion_lock); |
62 | if (c->gc_task) { | 63 | if (c->gc_task) { |
63 | D1(printk(KERN_DEBUG "jffs2: Killing GC task %d\n", c->gc_task->pid)); | 64 | jffs2_dbg(1, "jffs2: Killing GC task %d\n", c->gc_task->pid); |
64 | send_sig(SIGKILL, c->gc_task, 1); | 65 | send_sig(SIGKILL, c->gc_task, 1); |
65 | wait = 1; | 66 | wait = 1; |
66 | } | 67 | } |
@@ -90,7 +91,7 @@ static int jffs2_garbage_collect_thread(void *_c) | |||
90 | if (!jffs2_thread_should_wake(c)) { | 91 | if (!jffs2_thread_should_wake(c)) { |
91 | set_current_state (TASK_INTERRUPTIBLE); | 92 | set_current_state (TASK_INTERRUPTIBLE); |
92 | spin_unlock(&c->erase_completion_lock); | 93 | spin_unlock(&c->erase_completion_lock); |
93 | D1(printk(KERN_DEBUG "jffs2_garbage_collect_thread sleeping...\n")); | 94 | jffs2_dbg(1, "%s(): sleeping...\n", __func__); |
94 | schedule(); | 95 | schedule(); |
95 | } else | 96 | } else |
96 | spin_unlock(&c->erase_completion_lock); | 97 | spin_unlock(&c->erase_completion_lock); |
@@ -109,7 +110,7 @@ static int jffs2_garbage_collect_thread(void *_c) | |||
109 | schedule_timeout_interruptible(msecs_to_jiffies(50)); | 110 | schedule_timeout_interruptible(msecs_to_jiffies(50)); |
110 | 111 | ||
111 | if (kthread_should_stop()) { | 112 | if (kthread_should_stop()) { |
112 | D1(printk(KERN_DEBUG "jffs2_garbage_collect_thread(): kthread_stop() called.\n")); | 113 | jffs2_dbg(1, "%s(): kthread_stop() called\n", __func__); |
113 | goto die; | 114 | goto die; |
114 | } | 115 | } |
115 | 116 | ||
@@ -126,26 +127,30 @@ static int jffs2_garbage_collect_thread(void *_c) | |||
126 | 127 | ||
127 | switch(signr) { | 128 | switch(signr) { |
128 | case SIGSTOP: | 129 | case SIGSTOP: |
129 | D1(printk(KERN_DEBUG "jffs2_garbage_collect_thread(): SIGSTOP received.\n")); | 130 | jffs2_dbg(1, "%s(): SIGSTOP received\n", |
131 | __func__); | ||
130 | set_current_state(TASK_STOPPED); | 132 | set_current_state(TASK_STOPPED); |
131 | schedule(); | 133 | schedule(); |
132 | break; | 134 | break; |
133 | 135 | ||
134 | case SIGKILL: | 136 | case SIGKILL: |
135 | D1(printk(KERN_DEBUG "jffs2_garbage_collect_thread(): SIGKILL received.\n")); | 137 | jffs2_dbg(1, "%s(): SIGKILL received\n", |
138 | __func__); | ||
136 | goto die; | 139 | goto die; |
137 | 140 | ||
138 | case SIGHUP: | 141 | case SIGHUP: |
139 | D1(printk(KERN_DEBUG "jffs2_garbage_collect_thread(): SIGHUP received.\n")); | 142 | jffs2_dbg(1, "%s(): SIGHUP received\n", |
143 | __func__); | ||
140 | break; | 144 | break; |
141 | default: | 145 | default: |
142 | D1(printk(KERN_DEBUG "jffs2_garbage_collect_thread(): signal %ld received\n", signr)); | 146 | jffs2_dbg(1, "%s(): signal %ld received\n", |
147 | __func__, signr); | ||
143 | } | 148 | } |
144 | } | 149 | } |
145 | /* We don't want SIGHUP to interrupt us. STOP and KILL are OK though. */ | 150 | /* We don't want SIGHUP to interrupt us. STOP and KILL are OK though. */ |
146 | disallow_signal(SIGHUP); | 151 | disallow_signal(SIGHUP); |
147 | 152 | ||
148 | D1(printk(KERN_DEBUG "jffs2_garbage_collect_thread(): pass\n")); | 153 | jffs2_dbg(1, "%s(): pass\n", __func__); |
149 | if (jffs2_garbage_collect_pass(c) == -ENOSPC) { | 154 | if (jffs2_garbage_collect_pass(c) == -ENOSPC) { |
150 | printk(KERN_NOTICE "No space for garbage collection. Aborting GC thread\n"); | 155 | printk(KERN_NOTICE "No space for garbage collection. Aborting GC thread\n"); |
151 | goto die; | 156 | goto die; |