mtd/fs/jffs2 background.c,1.44,1.45 os-linux.h,1.35,1.36

David Woodhouse dwmw2 at infradead.org
Thu Oct 9 09:42:44 EDT 2003


Update of /home/cvs/mtd/fs/jffs2
In directory phoenix.infradead.org:/tmp/cvs-serv10402/fs/jffs2

Modified Files:
	background.c os-linux.h 
Log Message:
Convert to allow_signal() and disallow_signal()


Index: background.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/background.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- background.c	8 Oct 2003 13:29:55 -0000	1.44
+++ background.c	9 Oct 2003 13:42:42 -0000	1.45
@@ -29,7 +29,7 @@
 {
 	spin_lock(&c->erase_completion_lock);
         if (c->gc_task && thread_should_wake(c))
-                send_sig(SIGWINCH, c->gc_task, 1);
+                send_sig(SIGHUP, c->gc_task, 1);
 	spin_unlock(&c->erase_completion_lock);
 }
 
@@ -75,17 +75,19 @@
 	struct jffs2_sb_info *c = _c;
 
 	daemonize("jffs2_gcd_mtd%d", c->mtd->index);
-
+	
 	c->gc_task = current;
+
+	allow_signal(SIGKILL);
+	allow_signal(SIGSTOP);
+	allow_signal(SIGCONT);
+	
 	up(&c->gc_thread_start);
 
 	set_user_nice(current, 10);
 
 	for (;;) {
-		spin_lock_irq(&current_sig_lock);
-		siginitsetinv (&current->blocked, sigmask(SIGWINCH) | sigmask(SIGKILL) | sigmask(SIGSTOP) | sigmask(SIGCONT));
-		recalc_sigpending();
-		spin_unlock_irq(&current_sig_lock);
+		allow_signal(SIGHUP);
 
 		if (!thread_should_wake(c)) {
 			set_current_state (TASK_INTERRUPTIBLE);
@@ -105,9 +107,7 @@
 			siginfo_t info;
 			unsigned long signr;
 
-			spin_lock_irq(&current_sig_lock);
-			signr = dequeue_signal(current, &current->blocked, &info);
-			spin_unlock_irq(&current_sig_lock);
+			signr = dequeue_signal_lock(current, &current->blocked, &info);
 
 			switch(signr) {
 			case SIGSTOP:
@@ -124,18 +124,15 @@
 				spin_unlock(&c->erase_completion_lock);
 				complete_and_exit(&c->gc_thread_exit, 0);
 
-			case SIGWINCH:
-				D1(printk(KERN_DEBUG "jffs2_garbage_collect_thread(): SIGWINCH received.\n"));
+			case SIGHUP:
+				D1(printk(KERN_DEBUG "jffs2_garbage_collect_thread(): SIGHUP received.\n"));
 				break;
 			default:
 				D1(printk(KERN_DEBUG "jffs2_garbage_collect_thread(): signal %ld received\n", signr));
 			}
 		}
-		/* We don't want SIGWINCH to interrupt us. STOP and KILL are OK though. */
-		spin_lock_irq(&current_sig_lock);
-		siginitsetinv (&current->blocked, sigmask(SIGKILL) | sigmask(SIGSTOP) | sigmask(SIGCONT));
-		recalc_sigpending();
-		spin_unlock_irq(&current_sig_lock);
+		/* We don't want SIGHUP to interrupt us. STOP and KILL are OK though. */
+		disallow_signal(SIGHUP);
 
 		D1(printk(KERN_DEBUG "jffs2_garbage_collect_thread(): pass\n"));
 		if (jffs2_garbage_collect_pass(c) == -ENOSPC) {

Index: os-linux.h
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/os-linux.h,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- os-linux.h	6 Oct 2003 13:46:31 -0000	1.35
+++ os-linux.h	9 Oct 2003 13:42:42 -0000	1.36
@@ -69,14 +69,6 @@
 #define JFFS2_F_I_ATIME(f) (OFNI_EDONI_2SFFJ(f)->i_atime)
 #endif
 
-/* Hmmm. P'raps generic code should only ever see versions of signal
-   functions which do the locking automatically? */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,40) && !defined(__rh_config_h__)
-#define current_sig_lock current->sigmask_lock
-#else
-#define current_sig_lock current->sighand->siglock
-#endif
-
 #define sleep_on_spinunlock(wq, s)				\
 	do {							\
 		DECLARE_WAITQUEUE(__wait, current);		\




More information about the linux-mtd-cvs mailing list