summaryrefslogtreecommitdiff
blob: a40648c0f5f1ff3f4e46fe220de60f73e865c79b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
--- submount-0.9/subfs-0.9/subfs.c.orig	2006-03-22 10:06:33.000000000 +0100
+++ submount-0.9/subfs-0.9/subfs.c	2006-03-22 10:08:11.000000000 +0100
@@ -25,6 +25,7 @@
 #include <asm/signal.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
+#include <linux/version.h>
 
 #include "subfs.h"
 
@@ -221,14 +222,30 @@
 	struct vfsmount *child;
 
 	/* This is ugly, but prevents a lockup during mount. */
+
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
+	mutex_unlock(&dir->i_mutex);
+#else
 	up(&dir->i_sem);
+#endif
+
 	if (down_interruptible(&sfs_mnt->sem)) {
-		down(&dir->i_sem);/*put the dir sem back down if interrupted*/
+
+# if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
+		mutex_lock(&dir->i_mutex); /*put the dir sem back down if interrupted*/
+#else
+		down(&dir->i_sem); /*put the dir sem back down if interrupted*/
+#endif
 		return ERR_PTR(-ERESTARTSYS);
 	}
 	child = get_child_mount(sfs_mnt);
 	up(&sfs_mnt->sem);
+
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
+	mutex_lock(&dir->i_mutex); /*put the dir sem back down if interrupted*/
+#else
 	down(&dir->i_sem);
+#endif
 	if (IS_ERR(child))
 		return (void *) child;
 	subfs_send_signal();