[Ocfs2-commits] manish commits r1028 - trunk/src

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Tue Jun 8 21:05:09 CDT 2004


Author: manish
Date: 2004-06-08 20:05:08 -0500 (Tue, 08 Jun 2004)
New Revision: 1028

Modified:
   trunk/src/namei.c
Log:
Quick fix so 2.6 builds.. (provide double_down/up ourselves)


Modified: trunk/src/namei.c
===================================================================
--- trunk/src/namei.c	2004-06-08 23:04:39 UTC (rev 1027)
+++ trunk/src/namei.c	2004-06-09 01:05:08 UTC (rev 1028)
@@ -849,8 +849,28 @@
 	return(status);
 } /* ocfs_double_lock */
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+static inline void double_down(struct semaphore *s1, struct semaphore *s2)
+{
+	if (s1 != s2) {
+		if ((unsigned long) s1 < (unsigned long) s2) {
+			struct semaphore *tmp = s2;
+			s2 = s1; s1 = tmp;
+		}
+		down(s1);
+	}
+	down(s2);
+}
 
+static inline void double_up(struct semaphore *s1, struct semaphore *s2)
+{
+	up(s1);
+	if (s1 != s2)
+		up(s2);
+}
 
+#endif
+
 #define PARENT_INO(buffer) \
 	((struct ocfs2_dir_entry *) ((char *) buffer + \
 	le16_to_cpu(((struct ocfs2_dir_entry *) buffer)->rec_len)))->inode



More information about the Ocfs2-commits mailing list