Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/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
  • Loading branch information
Linus Torvalds committed May 19, 2008
2 parents 88d5376 + c3cc3bd commit 8c4bab3
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
27 changes: 14 additions & 13 deletions fs/dlm/lowcomms.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
#include <linux/pagemap.h>
#include <linux/idr.h>
#include <linux/file.h>
#include <linux/mutex.h>
#include <linux/sctp.h>
#include <net/sctp/user.h>

Expand Down Expand Up @@ -138,7 +139,7 @@ static struct workqueue_struct *recv_workqueue;
static struct workqueue_struct *send_workqueue;

static DEFINE_IDR(connections_idr);
static DECLARE_MUTEX(connections_lock);
static DEFINE_MUTEX(connections_lock);
static int max_nodeid;
static struct kmem_cache *con_cache;

Expand Down Expand Up @@ -205,9 +206,9 @@ static struct connection *nodeid2con(int nodeid, gfp_t allocation)
{
struct connection *con;

down(&connections_lock);
mutex_lock(&connections_lock);
con = __nodeid2con(nodeid, allocation);
up(&connections_lock);
mutex_unlock(&connections_lock);

return con;
}
Expand All @@ -218,15 +219,15 @@ static struct connection *assoc2con(int assoc_id)
int i;
struct connection *con;

down(&connections_lock);
mutex_lock(&connections_lock);
for (i=0; i<=max_nodeid; i++) {
con = __nodeid2con(i, 0);
if (con && con->sctp_assoc == assoc_id) {
up(&connections_lock);
mutex_unlock(&connections_lock);
return con;
}
}
up(&connections_lock);
mutex_unlock(&connections_lock);
return NULL;
}

Expand Down Expand Up @@ -381,7 +382,7 @@ static void sctp_init_failed(void)
int i;
struct connection *con;

down(&connections_lock);
mutex_lock(&connections_lock);
for (i=1; i<=max_nodeid; i++) {
con = __nodeid2con(i, 0);
if (!con)
Expand All @@ -393,7 +394,7 @@ static void sctp_init_failed(void)
}
}
}
up(&connections_lock);
mutex_unlock(&connections_lock);
}

/* Something happened to an association */
Expand Down Expand Up @@ -930,7 +931,7 @@ static void tcp_connect_to_sock(struct connection *con)
* errors we try again until the max number of retries is reached.
*/
if (result != -EHOSTUNREACH && result != -ENETUNREACH &&
result != -ENETDOWN && result != EINVAL
result != -ENETDOWN && result != -EINVAL
&& result != -EPROTONOSUPPORT) {
lowcomms_connect_sock(con);
result = 0;
Expand Down Expand Up @@ -1417,7 +1418,7 @@ void dlm_lowcomms_stop(void)
/* Set all the flags to prevent any
socket activity.
*/
down(&connections_lock);
mutex_lock(&connections_lock);
for (i = 0; i <= max_nodeid; i++) {
con = __nodeid2con(i, 0);
if (con) {
Expand All @@ -1426,11 +1427,11 @@ void dlm_lowcomms_stop(void)
con->sock->sk->sk_user_data = NULL;
}
}
up(&connections_lock);
mutex_unlock(&connections_lock);

work_stop();

down(&connections_lock);
mutex_lock(&connections_lock);
clean_writequeues();

for (i = 0; i <= max_nodeid; i++) {
Expand All @@ -1443,7 +1444,7 @@ void dlm_lowcomms_stop(void)
}
}
max_nodeid = 0;
up(&connections_lock);
mutex_unlock(&connections_lock);
kmem_cache_destroy(con_cache);
idr_init(&connections_idr);
}
Expand Down
2 changes: 1 addition & 1 deletion fs/dlm/netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ int __init dlm_netlink_init(void)
return rv;
}

void __exit dlm_netlink_exit(void)
void dlm_netlink_exit(void)
{
genl_unregister_ops(&family, &dlm_nl_ops);
genl_unregister_family(&family);
Expand Down
2 changes: 1 addition & 1 deletion fs/dlm/plock.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ static ssize_t dev_write(struct file *file, const char __user *u, size_t count,
struct plock_xop *xop;
xop = (struct plock_xop *)op;
if (xop->callback)
count = dlm_plock_callback(op);
dlm_plock_callback(op);
else
wake_up(&recv_wq);
} else
Expand Down
2 changes: 1 addition & 1 deletion include/linux/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ header-y += ixjuser.h
header-y += jffs2.h
header-y += keyctl.h
header-y += limits.h
header-y += dlm_plock.h
header-y += magic.h
header-y += major.h
header-y += matroxfb.h
Expand Down Expand Up @@ -190,6 +189,7 @@ unifdef-y += cyclades.h
unifdef-y += dccp.h
unifdef-y += dirent.h
unifdef-y += dlm.h
unifdef-y += dlm_plock.h
unifdef-y += edd.h
unifdef-y += elf.h
unifdef-y += elfcore.h
Expand Down

0 comments on commit 8c4bab3

Please sign in to comment.