diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-05-19 17:04:47 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-05-19 17:04:47 -0400 |
commit | 8c4bab3a1aadaf4e38b2bfaf557eab74322a9fd4 (patch) | |
tree | d77b8771823f137a24d8af554e01f3305729f79e | |
parent | 88d53766bd0f3bc6e46a0dff25be147a2b98c511 (diff) | |
parent | c3cc3bd0d36d1b16d4cb17e8fc64fff613f0b902 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/dlm
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/dlm:
dlm: <linux/dlm_plock.h> should be "unifdef"ed.
dlm: fix plock dev_write return value
dlm: tcp_connect_to_sock should check for -EINVAL, not EINVAL
dlm: section mismatch warning fix
dlm: convert connections_lock in a mutex
-rw-r--r-- | fs/dlm/lowcomms.c | 27 | ||||
-rw-r--r-- | fs/dlm/netlink.c | 2 | ||||
-rw-r--r-- | fs/dlm/plock.c | 2 | ||||
-rw-r--r-- | include/linux/Kbuild | 2 |
4 files changed, 17 insertions, 16 deletions
diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c index 7c1e5e5cccd8..637018c891ef 100644 --- a/fs/dlm/lowcomms.c +++ b/fs/dlm/lowcomms.c | |||
@@ -50,6 +50,7 @@ | |||
50 | #include <linux/pagemap.h> | 50 | #include <linux/pagemap.h> |
51 | #include <linux/idr.h> | 51 | #include <linux/idr.h> |
52 | #include <linux/file.h> | 52 | #include <linux/file.h> |
53 | #include <linux/mutex.h> | ||
53 | #include <linux/sctp.h> | 54 | #include <linux/sctp.h> |
54 | #include <net/sctp/user.h> | 55 | #include <net/sctp/user.h> |
55 | 56 | ||
@@ -138,7 +139,7 @@ static struct workqueue_struct *recv_workqueue; | |||
138 | static struct workqueue_struct *send_workqueue; | 139 | static struct workqueue_struct *send_workqueue; |
139 | 140 | ||
140 | static DEFINE_IDR(connections_idr); | 141 | static DEFINE_IDR(connections_idr); |
141 | static DECLARE_MUTEX(connections_lock); | 142 | static DEFINE_MUTEX(connections_lock); |
142 | static int max_nodeid; | 143 | static int max_nodeid; |
143 | static struct kmem_cache *con_cache; | 144 | static struct kmem_cache *con_cache; |
144 | 145 | ||
@@ -205,9 +206,9 @@ static struct connection *nodeid2con(int nodeid, gfp_t allocation) | |||
205 | { | 206 | { |
206 | struct connection *con; | 207 | struct connection *con; |
207 | 208 | ||
208 | down(&connections_lock); | 209 | mutex_lock(&connections_lock); |
209 | con = __nodeid2con(nodeid, allocation); | 210 | con = __nodeid2con(nodeid, allocation); |
210 | up(&connections_lock); | 211 | mutex_unlock(&connections_lock); |
211 | 212 | ||
212 | return con; | 213 | return con; |
213 | } | 214 | } |
@@ -218,15 +219,15 @@ static struct connection *assoc2con(int assoc_id) | |||
218 | int i; | 219 | int i; |
219 | struct connection *con; | 220 | struct connection *con; |
220 | 221 | ||
221 | down(&connections_lock); | 222 | mutex_lock(&connections_lock); |
222 | for (i=0; i<=max_nodeid; i++) { | 223 | for (i=0; i<=max_nodeid; i++) { |
223 | con = __nodeid2con(i, 0); | 224 | con = __nodeid2con(i, 0); |
224 | if (con && con->sctp_assoc == assoc_id) { | 225 | if (con && con->sctp_assoc == assoc_id) { |
225 | up(&connections_lock); | 226 | mutex_unlock(&connections_lock); |
226 | return con; | 227 | return con; |
227 | } | 228 | } |
228 | } | 229 | } |
229 | up(&connections_lock); | 230 | mutex_unlock(&connections_lock); |
230 | return NULL; | 231 | return NULL; |
231 | } | 232 | } |
232 | 233 | ||
@@ -381,7 +382,7 @@ static void sctp_init_failed(void) | |||
381 | int i; | 382 | int i; |
382 | struct connection *con; | 383 | struct connection *con; |
383 | 384 | ||
384 | down(&connections_lock); | 385 | mutex_lock(&connections_lock); |
385 | for (i=1; i<=max_nodeid; i++) { | 386 | for (i=1; i<=max_nodeid; i++) { |
386 | con = __nodeid2con(i, 0); | 387 | con = __nodeid2con(i, 0); |
387 | if (!con) | 388 | if (!con) |
@@ -393,7 +394,7 @@ static void sctp_init_failed(void) | |||
393 | } | 394 | } |
394 | } | 395 | } |
395 | } | 396 | } |
396 | up(&connections_lock); | 397 | mutex_unlock(&connections_lock); |
397 | } | 398 | } |
398 | 399 | ||
399 | /* Something happened to an association */ | 400 | /* Something happened to an association */ |
@@ -930,7 +931,7 @@ out_err: | |||
930 | * errors we try again until the max number of retries is reached. | 931 | * errors we try again until the max number of retries is reached. |
931 | */ | 932 | */ |
932 | if (result != -EHOSTUNREACH && result != -ENETUNREACH && | 933 | if (result != -EHOSTUNREACH && result != -ENETUNREACH && |
933 | result != -ENETDOWN && result != EINVAL | 934 | result != -ENETDOWN && result != -EINVAL |
934 | && result != -EPROTONOSUPPORT) { | 935 | && result != -EPROTONOSUPPORT) { |
935 | lowcomms_connect_sock(con); | 936 | lowcomms_connect_sock(con); |
936 | result = 0; | 937 | result = 0; |
@@ -1417,7 +1418,7 @@ void dlm_lowcomms_stop(void) | |||
1417 | /* Set all the flags to prevent any | 1418 | /* Set all the flags to prevent any |
1418 | socket activity. | 1419 | socket activity. |
1419 | */ | 1420 | */ |
1420 | down(&connections_lock); | 1421 | mutex_lock(&connections_lock); |
1421 | for (i = 0; i <= max_nodeid; i++) { | 1422 | for (i = 0; i <= max_nodeid; i++) { |
1422 | con = __nodeid2con(i, 0); | 1423 | con = __nodeid2con(i, 0); |
1423 | if (con) { | 1424 | if (con) { |
@@ -1426,11 +1427,11 @@ void dlm_lowcomms_stop(void) | |||
1426 | con->sock->sk->sk_user_data = NULL; | 1427 | con->sock->sk->sk_user_data = NULL; |
1427 | } | 1428 | } |
1428 | } | 1429 | } |
1429 | up(&connections_lock); | 1430 | mutex_unlock(&connections_lock); |
1430 | 1431 | ||
1431 | work_stop(); | 1432 | work_stop(); |
1432 | 1433 | ||
1433 | down(&connections_lock); | 1434 | mutex_lock(&connections_lock); |
1434 | clean_writequeues(); | 1435 | clean_writequeues(); |
1435 | 1436 | ||
1436 | for (i = 0; i <= max_nodeid; i++) { | 1437 | for (i = 0; i <= max_nodeid; i++) { |
@@ -1443,7 +1444,7 @@ void dlm_lowcomms_stop(void) | |||
1443 | } | 1444 | } |
1444 | } | 1445 | } |
1445 | max_nodeid = 0; | 1446 | max_nodeid = 0; |
1446 | up(&connections_lock); | 1447 | mutex_unlock(&connections_lock); |
1447 | kmem_cache_destroy(con_cache); | 1448 | kmem_cache_destroy(con_cache); |
1448 | idr_init(&connections_idr); | 1449 | idr_init(&connections_idr); |
1449 | } | 1450 | } |
diff --git a/fs/dlm/netlink.c b/fs/dlm/netlink.c index 714593621f4f..18bda83cc892 100644 --- a/fs/dlm/netlink.c +++ b/fs/dlm/netlink.c | |||
@@ -95,7 +95,7 @@ int __init dlm_netlink_init(void) | |||
95 | return rv; | 95 | return rv; |
96 | } | 96 | } |
97 | 97 | ||
98 | void __exit dlm_netlink_exit(void) | 98 | void dlm_netlink_exit(void) |
99 | { | 99 | { |
100 | genl_unregister_ops(&family, &dlm_nl_ops); | 100 | genl_unregister_ops(&family, &dlm_nl_ops); |
101 | genl_unregister_family(&family); | 101 | genl_unregister_family(&family); |
diff --git a/fs/dlm/plock.c b/fs/dlm/plock.c index d6d6e370f89c..78878c5781ca 100644 --- a/fs/dlm/plock.c +++ b/fs/dlm/plock.c | |||
@@ -379,7 +379,7 @@ static ssize_t dev_write(struct file *file, const char __user *u, size_t count, | |||
379 | struct plock_xop *xop; | 379 | struct plock_xop *xop; |
380 | xop = (struct plock_xop *)op; | 380 | xop = (struct plock_xop *)op; |
381 | if (xop->callback) | 381 | if (xop->callback) |
382 | count = dlm_plock_callback(op); | 382 | dlm_plock_callback(op); |
383 | else | 383 | else |
384 | wake_up(&recv_wq); | 384 | wake_up(&recv_wq); |
385 | } else | 385 | } else |
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index b7d81b2a9041..5dfa739045c8 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -105,7 +105,6 @@ header-y += ixjuser.h | |||
105 | header-y += jffs2.h | 105 | header-y += jffs2.h |
106 | header-y += keyctl.h | 106 | header-y += keyctl.h |
107 | header-y += limits.h | 107 | header-y += limits.h |
108 | header-y += dlm_plock.h | ||
109 | header-y += magic.h | 108 | header-y += magic.h |
110 | header-y += major.h | 109 | header-y += major.h |
111 | header-y += matroxfb.h | 110 | header-y += matroxfb.h |
@@ -190,6 +189,7 @@ unifdef-y += cyclades.h | |||
190 | unifdef-y += dccp.h | 189 | unifdef-y += dccp.h |
191 | unifdef-y += dirent.h | 190 | unifdef-y += dirent.h |
192 | unifdef-y += dlm.h | 191 | unifdef-y += dlm.h |
192 | unifdef-y += dlm_plock.h | ||
193 | unifdef-y += edd.h | 193 | unifdef-y += edd.h |
194 | unifdef-y += elf.h | 194 | unifdef-y += elf.h |
195 | unifdef-y += elfcore.h | 195 | unifdef-y += elfcore.h |