From: Paul Gortmaker <paul.gortmaker@windriver.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, allan.stephens@windriver.com,
Allan Stephens <Allan.Stephens@windriver.com>,
Paul Gortmaker <paul.gortmaker@windriver.com>
Subject: [PATCH net-next 06/20] tipc: Eliminate use of user registry by topology service
Date: Fri, 31 Dec 2010 23:59:21 -0500 [thread overview]
Message-ID: <1293857975-30267-7-git-send-email-paul.gortmaker@windriver.com> (raw)
In-Reply-To: <1293857975-30267-1-git-send-email-paul.gortmaker@windriver.com>
From: Allan Stephens <Allan.Stephens@windriver.com>
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>
---
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;
}
}
--
1.7.3.3
next prev parent reply other threads:[~2011-01-01 5:00 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-01 4:59 [PATCH net-next 00/20] Delete more semi-useless stuff from TIPC Paul Gortmaker
2011-01-01 4:59 ` [PATCH net-next 01/20] tipc: Remove prototype code for supporting multiple zones Paul Gortmaker
2011-01-01 4:59 ` [PATCH net-next 02/20] tipc: Remove prototype code for supporting slave nodes Paul Gortmaker
2011-01-01 4:59 ` [PATCH net-next 03/20] tipc: Remove prototype code for supporting inter-cluster routing Paul Gortmaker
2011-01-01 4:59 ` [PATCH net-next 04/20] tipc: Remove prototype code for supporting multiple clusters Paul Gortmaker
2011-01-01 4:59 ` [PATCH net-next 05/20] tipc: Eliminate use of user registry by configuration service Paul Gortmaker
2011-01-01 4:59 ` Paul Gortmaker [this message]
2011-01-01 4:59 ` [PATCH net-next 07/20] tipc: Remove user registry subsystem Paul Gortmaker
2011-01-01 4:59 ` [PATCH net-next 08/20] tipc: Remove internal linked list of node objects Paul Gortmaker
2011-01-01 4:59 ` [PATCH net-next 09/20] tipc: rename dbg.[ch] to log.[ch] Paul Gortmaker
2011-01-01 4:59 ` [PATCH net-next 10/20] tipc: remove calls to dbg() and msg_dbg() Paul Gortmaker
2011-01-01 4:59 ` [PATCH net-next 11/20] tipc: remove dump() and tipc_dump_dbg() Paul Gortmaker
2011-01-01 4:59 ` [PATCH net-next 12/20] tipc: Prune down link-specific debugging code Paul Gortmaker
2011-01-01 4:59 ` [PATCH net-next 13/20] tipc: Finish streamlining of " Paul Gortmaker
2011-01-01 4:59 ` [PATCH net-next 14/20] tipc: remove redundant #includes Paul Gortmaker
2011-01-01 4:59 ` [PATCH net-next 15/20] tipc: remove pointless check for NULL prior to kfree Paul Gortmaker
2011-01-01 4:59 ` [PATCH net-next 16/20] tipc: recode getsockopt error handling for better readability Paul Gortmaker
2011-01-01 4:59 ` [PATCH net-next 17/20] tipc: cleanup various cosmetic whitespace issues Paul Gortmaker
2011-01-01 4:59 ` [PATCH net-next 18/20] tipc: split variable assignments out of conditional expressions Paul Gortmaker
2011-01-01 4:59 ` [PATCH net-next 19/20] tipc: remove zeroing assignments to static global variables Paul Gortmaker
2011-01-01 4:59 ` [PATCH net-next 20/20] tipc: remove extraneous braces from single statements Paul Gortmaker
2011-01-01 21:59 ` [PATCH net-next 00/20] Delete more semi-useless stuff from TIPC David Miller
2011-01-01 22:53 ` Paul Gortmaker
2011-01-01 22:56 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1293857975-30267-7-git-send-email-paul.gortmaker@windriver.com \
--to=paul.gortmaker@windriver.com \
--cc=allan.stephens@windriver.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).