summaryrefslogtreecommitdiff
blob: d9ead98e82242cfad6c3cb361686ee94552d06a6 (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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
diff -uNr cluster-1.03.00.orig/gfs-kernel/src/gfs/diaper.c cluster-1.03.00/gfs-kernel/src/gfs/diaper.c
--- cluster-1.03.00.orig/gfs-kernel/src/gfs/diaper.c	2006-06-26 23:53:51.000000000 +0200
+++ cluster-1.03.00/gfs-kernel/src/gfs/diaper.c	2006-08-30 18:18:06.000000000 +0200
@@ -232,9 +232,9 @@
 	struct inode *inode;
 	int error;
 
-	mutex_lock(&real->bd_mount_mutex);
+	down(&real->bd_mount_sem);
 	sb = sget(&gfs_fs_type, gfs_test_bdev_super, gfs_set_bdev_super, real);
-	mutex_unlock(&real->bd_mount_mutex);
+	up(&real->bd_mount_sem);
 	if (IS_ERR(sb))
 		return PTR_ERR(sb);
 
@@ -363,7 +363,7 @@
 	if (!diaper)
 		goto fail_remove;
 
-	mutex_lock(&diaper->bd_mutex);
+	down(&diaper->bd_sem);
 	if (!diaper->bd_openers) {
 		diaper->bd_disk = gd;
 		diaper->bd_contains = diaper;
@@ -372,7 +372,7 @@
 	} else
 		printk("GFS: diaper: reopening\n");
 	diaper->bd_openers++;
-	mutex_unlock(&diaper->bd_mutex);
+	up(&diaper->bd_sem);
 
 	dh->dh_mempool = mempool_create(512,
 					mempool_alloc_slab, mempool_free_slab,
@@ -395,14 +395,14 @@
 	mempool_destroy(dh->dh_mempool);
 
  fail_bdput:
-	mutex_lock(&diaper->bd_mutex);
+	down(&diaper->bd_sem);
 	if (!--diaper->bd_openers) {
 		invalidate_bdev(diaper, 1);
 		diaper->bd_contains = NULL;
 		diaper->bd_disk = NULL;
 	} else
 		printk("GFS: diaper: not closed\n");
-	mutex_unlock(&diaper->bd_mutex);
+	up(&diaper->bd_sem);
 	bdput(diaper);	
 
  fail_remove:
@@ -437,14 +437,14 @@
 
 	mempool_destroy(dh->dh_mempool);
 
-	mutex_lock(&diaper->bd_mutex);
+	down(&diaper->bd_sem);
 	if (!--diaper->bd_openers) {
 		invalidate_bdev(diaper, 1);
 		diaper->bd_contains = NULL;
 		diaper->bd_disk = NULL;
 	} else
 		printk("GFS: diaper: not closed\n");
-	mutex_unlock(&diaper->bd_mutex);
+	up(&diaper->bd_sem);
 
 	bdput(diaper);
 	del_gendisk(gd);
diff -uNr cluster-1.03.00.orig/gfs-kernel/src/gfs/ops_file.c cluster-1.03.00/gfs-kernel/src/gfs/ops_file.c
--- cluster-1.03.00.orig/gfs-kernel/src/gfs/ops_file.c	2006-06-29 18:50:41.000000000 +0200
+++ cluster-1.03.00/gfs-kernel/src/gfs/ops_file.c	2006-08-30 18:18:06.000000000 +0200
@@ -1465,13 +1465,12 @@
 
 	if (sdp->sd_args.ar_localflocks) {
 		if (IS_GETLK(cmd)) {
-			struct file_lock tmp;
-			int ret;
+			struct file_lock *tmp;
 			lock_kernel();
-			ret = posix_test_lock(file, fl, &tmp);
+			tmp = posix_test_lock(file, fl);
 			fl->fl_type = F_UNLCK;
-			if (ret)
-				memcpy(fl, &tmp, sizeof(struct file_lock));
+			if (tmp)
+				memcpy(fl, tmp, sizeof(struct file_lock));
 			unlock_kernel();
 		        return 0;
 		} else {
diff -uNr cluster-1.03.00.orig/gfs-kernel/src/gfs/ops_fstype.c cluster-1.03.00/gfs-kernel/src/gfs/ops_fstype.c
--- cluster-1.03.00.orig/gfs-kernel/src/gfs/ops_fstype.c	2006-06-29 18:50:41.000000000 +0200
+++ cluster-1.03.00/gfs-kernel/src/gfs/ops_fstype.c	2006-08-30 18:18:06.000000000 +0200
@@ -697,9 +697,9 @@
 		return (struct super_block *)diaper;
 	}
 
-	mutex_lock(&diaper->bd_mount_mutex);
+	down(&diaper->bd_mount_sem);
 	sb = sget(fs_type, gfs_test_bdev_super, gfs_set_bdev_super, diaper);
-	mutex_unlock(&diaper->bd_mount_mutex);
+	up(&diaper->bd_mount_sem);
 	if (IS_ERR(sb))
 		goto out;
 
diff -uNr cluster-1.03.00.orig/gfs-kernel/src/nolock/main.c cluster-1.03.00/gfs-kernel/src/nolock/main.c
--- cluster-1.03.00.orig/gfs-kernel/src/nolock/main.c	2006-08-16 23:53:20.000000000 +0200
+++ cluster-1.03.00/gfs-kernel/src/nolock/main.c	2006-08-30 18:18:06.000000000 +0200
@@ -243,14 +243,13 @@
 		 struct lm_lockname *name,
 		 struct file *file, struct file_lock *fl)
 {
-	struct file_lock tmp;
-	int ret;
+	struct file_lock *tmp;
 
 	lock_kernel();
-	ret = posix_test_lock(file, fl, &tmp);
+	tmp = posix_test_lock(file, fl);
 	fl->fl_type = F_UNLCK;
-	if (ret)
-		memcpy(fl, &tmp, sizeof(struct file_lock));
+	if (tmp)
+		memcpy(fl, tmp, sizeof(struct file_lock));
 	unlock_kernel();
 
 	return 0;