git://ftp.safe.ca
/
safe
/
jmp
/
linux-2.6
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
headers: smp_lock.h redux
[safe/jmp/linux-2.6]
/
net
/
tipc
/
node_subscr.c
diff --git
a/net/tipc/node_subscr.c
b/net/tipc/node_subscr.c
index
f271b61
..
19194d4
100644
(file)
--- a/
net/tipc/node_subscr.c
+++ b/
net/tipc/node_subscr.c
@@
-1,7
+1,7
@@
/*
* net/tipc/node_subscr.c: TIPC "node down" subscription handling
/*
* net/tipc/node_subscr.c: TIPC "node down" subscription handling
- *
- * Copyright (c)
2003
-2006, Ericsson AB
+ *
+ * Copyright (c)
1995
-2006, Ericsson AB
* Copyright (c) 2005, Wind River Systems
* All rights reserved.
*
* Copyright (c) 2005, Wind River Systems
* All rights reserved.
*
@@
-41,39
+41,40
@@
#include "addr.h"
/**
#include "addr.h"
/**
- * nodesub_subscribe - create "node down" subscription for specified node
+ *
tipc_
nodesub_subscribe - create "node down" subscription for specified node
*/
*/
-void
nodesub_subscribe(struct node_subscr *node_sub, u32 addr,
+void
tipc_nodesub_subscribe(struct tipc_node_subscr *node_sub, u32 addr,
void *usr_handle, net_ev_handler handle_down)
{
void *usr_handle, net_ev_handler handle_down)
{
- node_sub->node = 0;
- if (addr == tipc_own_addr)
- return;
- if (!addr_node_valid(addr)) {
- warn("node_subscr with illegal %x\n", addr);
+ if (addr == tipc_own_addr) {
+ node_sub->node = NULL;
return;
}
return;
}
+ node_sub->node = tipc_node_find(addr);
+ if (!node_sub->node) {
+ warn("Node subscription rejected, unknown node 0x%x\n", addr);
+ return;
+ }
node_sub->handle_node_down = handle_down;
node_sub->usr_handle = usr_handle;
node_sub->handle_node_down = handle_down;
node_sub->usr_handle = usr_handle;
- node_sub->node = node_find(addr);
- assert(node_sub->node);
- node_lock(node_sub->node);
+
+ tipc_node_lock(node_sub->node);
list_add_tail(&node_sub->nodesub_list, &node_sub->node->nsub);
list_add_tail(&node_sub->nodesub_list, &node_sub->node->nsub);
- node_unlock(node_sub->node);
+
tipc_
node_unlock(node_sub->node);
}
/**
}
/**
- * nodesub_unsubscribe - cancel "node down" subscription (if any)
+ *
tipc_
nodesub_unsubscribe - cancel "node down" subscription (if any)
*/
*/
-void
nodesub_unsubscribe(struct
node_subscr *node_sub)
+void
tipc_nodesub_unsubscribe(struct tipc_
node_subscr *node_sub)
{
if (!node_sub->node)
return;
{
if (!node_sub->node)
return;
- node_lock(node_sub->node);
+
tipc_
node_lock(node_sub->node);
list_del_init(&node_sub->nodesub_list);
list_del_init(&node_sub->nodesub_list);
- node_unlock(node_sub->node);
+
tipc_
node_unlock(node_sub->node);
}
}