diff options
author | Allan Stephens <Allan.Stephens@windriver.com> | 2010-12-31 18:59:21 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-01-01 13:57:50 -0800 |
commit | aa70200e001fc4d76552c974c94f65ab26020203 (patch) | |
tree | af3b17052f088dd7f078c515c45b3168d3b9200c /net/tipc | |
parent | 7a488fd3d40a127d0d6057ecd2696f39e11e63c3 (diff) | |
download | kernel_samsung_crespo-aa70200e001fc4d76552c974c94f65ab26020203.zip kernel_samsung_crespo-aa70200e001fc4d76552c974c94f65ab26020203.tar.gz kernel_samsung_crespo-aa70200e001fc4d76552c974c94f65ab26020203.tar.bz2 |
tipc: Eliminate use of user registry by topology service
Simplifies TIPC's network topology service so that it no longer registers
its ports with the user registry, since the service doesn't take advantage
of any of the registry's capabilities.
Signed-off-by: Allan Stephens <Allan.Stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc')
-rw-r--r-- | net/tipc/subscr.c | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/net/tipc/subscr.c b/net/tipc/subscr.c index 23f43d0..21abf17 100644 --- a/net/tipc/subscr.c +++ b/net/tipc/subscr.c @@ -36,7 +36,7 @@ #include "core.h" #include "name_table.h" -#include "user_reg.h" +#include "port.h" #include "subscr.h" /** @@ -64,7 +64,6 @@ struct subscriber { */ struct top_srv { - u32 user_ref; u32 setup_port; atomic_t subscription_count; struct list_head subscriber_list; @@ -494,7 +493,7 @@ static void subscr_named_msg_event(void *usr_handle, /* Create server port & establish connection to subscriber */ - tipc_createport(topsrv.user_ref, + tipc_createport(0, subscriber, importance, NULL, @@ -549,13 +548,7 @@ int tipc_subscr_start(void) INIT_LIST_HEAD(&topsrv.subscriber_list); spin_lock_bh(&topsrv.lock); - res = tipc_attach(&topsrv.user_ref); - if (res) { - spin_unlock_bh(&topsrv.lock); - return res; - } - - res = tipc_createport(topsrv.user_ref, + res = tipc_createport(0, NULL, TIPC_CRITICAL_IMPORTANCE, NULL, @@ -570,16 +563,17 @@ int tipc_subscr_start(void) goto failed; res = tipc_nametbl_publish_rsv(topsrv.setup_port, TIPC_NODE_SCOPE, &seq); - if (res) + if (res) { + tipc_deleteport(topsrv.setup_port); + topsrv.setup_port = 0; goto failed; + } spin_unlock_bh(&topsrv.lock); return 0; failed: err("Failed to create subscription service\n"); - tipc_detach(topsrv.user_ref); - topsrv.user_ref = 0; spin_unlock_bh(&topsrv.lock); return res; } @@ -590,8 +584,10 @@ void tipc_subscr_stop(void) struct subscriber *subscriber_temp; spinlock_t *subscriber_lock; - if (topsrv.user_ref) { + if (topsrv.setup_port) { tipc_deleteport(topsrv.setup_port); + topsrv.setup_port = 0; + list_for_each_entry_safe(subscriber, subscriber_temp, &topsrv.subscriber_list, subscriber_list) { @@ -600,7 +596,5 @@ void tipc_subscr_stop(void) subscr_terminate(subscriber); spin_unlock_bh(subscriber_lock); } - tipc_detach(topsrv.user_ref); - topsrv.user_ref = 0; } } |