]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - fs/jffs2/background.c
ENGR00296519 USB: EHCI: wait more than 3ms until the device enters full-speed idle
[karo-tx-linux.git] / fs / jffs2 / background.c
index 2b60ce1996aa2ea63f38b4f4d1990f0dd5a7a916..bb9cebc9ca8acb7e5e321e7b6fc8484174fd5fce 100644 (file)
@@ -75,10 +75,13 @@ void jffs2_stop_garbage_collect_thread(struct jffs2_sb_info *c)
 static int jffs2_garbage_collect_thread(void *_c)
 {
        struct jffs2_sb_info *c = _c;
+       sigset_t hupmask;
 
+       siginitset(&hupmask, sigmask(SIGHUP));
        allow_signal(SIGKILL);
        allow_signal(SIGSTOP);
        allow_signal(SIGCONT);
+       allow_signal(SIGHUP);
 
        c->gc_task = current;
        complete(&c->gc_thread_start);
@@ -87,7 +90,7 @@ static int jffs2_garbage_collect_thread(void *_c)
 
        set_freezable();
        for (;;) {
-               allow_signal(SIGHUP);
+               sigprocmask(SIG_UNBLOCK, &hupmask, NULL);
        again:
                spin_lock(&c->erase_completion_lock);
                if (!jffs2_thread_should_wake(c)) {
@@ -95,10 +98,9 @@ static int jffs2_garbage_collect_thread(void *_c)
                        spin_unlock(&c->erase_completion_lock);
                        jffs2_dbg(1, "%s(): sleeping...\n", __func__);
                        schedule();
-               } else
+               } else {
                        spin_unlock(&c->erase_completion_lock);
-                       
-
+               }
                /* Problem - immediately after bootup, the GCD spends a lot
                 * of time in places like jffs2_kill_fragtree(); so much so
                 * that userspace processes (like gdm and X) are starved
@@ -150,7 +152,7 @@ static int jffs2_garbage_collect_thread(void *_c)
                        }
                }
                /* We don't want SIGHUP to interrupt us. STOP and KILL are OK though. */
-               disallow_signal(SIGHUP);
+               sigprocmask(SIG_BLOCK, &hupmask, NULL);
 
                jffs2_dbg(1, "%s(): pass\n", __func__);
                if (jffs2_garbage_collect_pass(c) == -ENOSPC) {