[Ocfs2-commits] manish commits r1006 - in branches/format-changes/src: . inc

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Fri Jun 4 18:03:46 CDT 2004


Author: manish
Date: 2004-06-04 17:03:45 -0500 (Fri, 04 Jun 2004)
New Revision: 1006

Modified:
   branches/format-changes/src/inc/ocfs_compat.h
   branches/format-changes/src/journal.c
   branches/format-changes/src/nm.c
Log:
dequeue_signal_lock compat for 2.4. From Christoph Hellwig.


Modified: branches/format-changes/src/inc/ocfs_compat.h
===================================================================
--- branches/format-changes/src/inc/ocfs_compat.h	2004-06-04 21:57:11 UTC (rev 1005)
+++ branches/format-changes/src/inc/ocfs_compat.h	2004-06-04 22:03:45 UTC (rev 1006)
@@ -61,6 +61,24 @@
 #define io_schedule            schedule
 #endif
 
+#ifdef HAVE_NPTL
+static inline void dequeue_signal_lock(struct task_struct *task,
+				       sigset_t *blocked, siginfo_t *info)
+{
+	spin_lock_irq(&task->sighand->siglock);
+	dequeue_signal(blocked, info);
+	spin_unlock_irq(&task->sighand->siglock);
+}
+#else
+static inline void dequeue_signal_lock(struct task_struct *task,
+				       sigset_t *blocked, siginfo_t *info)
+{
+	spin_lock_irq(&task->sigmask_lock);
+	dequeue_signal(blocked, info);
+	spin_unlock_irq(&task->sigmask_lock);
+}
+#endif
+
 static inline dev_t ocfs_decode_dev(u64 val)
 {
 	u16 val16 = (u16)(val & 0xFFFFULL);

Modified: branches/format-changes/src/journal.c
===================================================================
--- branches/format-changes/src/journal.c	2004-06-04 21:57:11 UTC (rev 1005)
+++ branches/format-changes/src/journal.c	2004-06-04 22:03:45 UTC (rev 1006)
@@ -1594,26 +1594,14 @@
 				 * one last commit cache and then exit */
 				if (journal->state == OCFS_JOURNAL_IN_SHUTDOWN)
 					finish = 1;
+
+				/* ignore the actual signal */
 				if (signal_pending(current)) {
-					/* ignore the actual signal */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
 					dequeue_signal_lock(current, 
 							    &current->blocked, 
 							    &info);
-#else
-#ifdef HAVE_NPTL
-					spin_lock_irq (&current->sighand->siglock);
-					dequeue_signal(&current->blocked, 
-						       &info);
-					spin_unlock_irq(&current->sighand->siglock);					
-#else 
-					spin_lock_irq(&current->sigmask_lock);
-					dequeue_signal(&current->blocked, 
-						       &info);
-					spin_unlock_irq(&current->sigmask_lock);
-#endif /* !HAVE_NPTL */
-#endif /* 2.4.x kernel */
 				}
+
 				LOG_TRACE_STR("FLUSH_EVENT: interrupted");
 				break;
 			case 0:

Modified: branches/format-changes/src/nm.c
===================================================================
--- branches/format-changes/src/nm.c	2004-06-04 21:57:11 UTC (rev 1005)
+++ branches/format-changes/src/nm.c	2004-06-04 22:03:45 UTC (rev 1006)
@@ -455,23 +455,10 @@
 		}
 		set_current_state (TASK_INTERRUPTIBLE);
 		schedule_timeout (osb->hbt - j);
-		/* this should all just be in some common function as
-		 * it's totally duplicated. */
+
+		/* ignore the actual signal */
 		if (signal_pending(current)) {
-			/* ignore the actual signal */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
 			dequeue_signal_lock(current, &current->blocked, &info);
-#else
-#ifdef HAVE_NPTL
-			spin_lock_irq (&current->sighand->siglock);
-			dequeue_signal(&current->blocked, &info);
-			spin_unlock_irq(&current->sighand->siglock);
-#else 
-			spin_lock_irq(&current->sigmask_lock);
-			dequeue_signal(&current->blocked, &info);
-			spin_unlock_irq(&current->sigmask_lock);
-#endif /* !HAVE_NPTL */
-#endif /* 2.4.x kernel */
 		}
 	}
 
@@ -1436,23 +1423,9 @@
 	ocfs_daemonize (OCFS_DROP_RO_THREAD_NAME, strlen(OCFS_DROP_RO_THREAD_NAME));
 	status = _ocfs_drop_readonly_cache_lock(arg);
 
-	/* this should all just be in some common function as
-	 * it's totally duplicated. */
+	/* ignore the actual signal */
 	if (signal_pending(current)) {
-		/* ignore the actual signal */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
 		dequeue_signal_lock(current, &current->blocked, &info);
-#else
-#ifdef HAVE_NPTL
-		spin_lock_irq (&current->sighand->siglock);
-		dequeue_signal(&current->blocked, &info);
-		spin_unlock_irq(&current->sighand->siglock);
-#else 
-		spin_lock_irq(&current->sigmask_lock);
-		dequeue_signal(&current->blocked, &info);
-		spin_unlock_irq(&current->sigmask_lock);
-#endif /* !HAVE_NPTL */
-#endif /* 2.4.x kernel */
 	}
 
 	/* Flush all scheduled tasks */



More information about the Ocfs2-commits mailing list