diff options
author | Allan Stephens <Allan.Stephens@windriver.com> | 2010-12-31 13:59:20 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-01-01 16:57:50 -0500 |
commit | 7a488fd3d40a127d0d6057ecd2696f39e11e63c3 (patch) | |
tree | 040b7d8005c5e5cb604aab75b82d0a1c14ddffd1 /net | |
parent | 8f92df6ad49da958d97e171762d0a97a3dc738f1 (diff) |
tipc: Eliminate use of user registry by configuration service
Simplifies TIPC's configuration service so that it no longer registers
its port 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')
-rw-r--r-- | net/tipc/config.c | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/net/tipc/config.c b/net/tipc/config.c index bc512102eebd..322367b2618f 100644 --- a/net/tipc/config.c +++ b/net/tipc/config.c | |||
@@ -38,15 +38,9 @@ | |||
38 | #include "port.h" | 38 | #include "port.h" |
39 | #include "link.h" | 39 | #include "link.h" |
40 | #include "name_table.h" | 40 | #include "name_table.h" |
41 | #include "user_reg.h" | ||
42 | #include "config.h" | 41 | #include "config.h" |
43 | 42 | ||
44 | struct manager { | 43 | static u32 config_port_ref; |
45 | u32 user_ref; | ||
46 | u32 port_ref; | ||
47 | }; | ||
48 | |||
49 | static struct manager mng = { 0}; | ||
50 | 44 | ||
51 | static DEFINE_SPINLOCK(config_lock); | 45 | static DEFINE_SPINLOCK(config_lock); |
52 | 46 | ||
@@ -506,20 +500,16 @@ int tipc_cfg_init(void) | |||
506 | struct tipc_name_seq seq; | 500 | struct tipc_name_seq seq; |
507 | int res; | 501 | int res; |
508 | 502 | ||
509 | res = tipc_attach(&mng.user_ref); | 503 | res = tipc_createport(0, NULL, TIPC_CRITICAL_IMPORTANCE, |
510 | if (res) | ||
511 | goto failed; | ||
512 | |||
513 | res = tipc_createport(mng.user_ref, NULL, TIPC_CRITICAL_IMPORTANCE, | ||
514 | NULL, NULL, NULL, | 504 | NULL, NULL, NULL, |
515 | NULL, cfg_named_msg_event, NULL, | 505 | NULL, cfg_named_msg_event, NULL, |
516 | NULL, &mng.port_ref); | 506 | NULL, &config_port_ref); |
517 | if (res) | 507 | if (res) |
518 | goto failed; | 508 | goto failed; |
519 | 509 | ||
520 | seq.type = TIPC_CFG_SRV; | 510 | seq.type = TIPC_CFG_SRV; |
521 | seq.lower = seq.upper = tipc_own_addr; | 511 | seq.lower = seq.upper = tipc_own_addr; |
522 | res = tipc_nametbl_publish_rsv(mng.port_ref, TIPC_ZONE_SCOPE, &seq); | 512 | res = tipc_nametbl_publish_rsv(config_port_ref, TIPC_ZONE_SCOPE, &seq); |
523 | if (res) | 513 | if (res) |
524 | goto failed; | 514 | goto failed; |
525 | 515 | ||
@@ -527,15 +517,13 @@ int tipc_cfg_init(void) | |||
527 | 517 | ||
528 | failed: | 518 | failed: |
529 | err("Unable to create configuration service\n"); | 519 | err("Unable to create configuration service\n"); |
530 | tipc_detach(mng.user_ref); | ||
531 | mng.user_ref = 0; | ||
532 | return res; | 520 | return res; |
533 | } | 521 | } |
534 | 522 | ||
535 | void tipc_cfg_stop(void) | 523 | void tipc_cfg_stop(void) |
536 | { | 524 | { |
537 | if (mng.user_ref) { | 525 | if (config_port_ref) { |
538 | tipc_detach(mng.user_ref); | 526 | tipc_deleteport(config_port_ref); |
539 | mng.user_ref = 0; | 527 | config_port_ref = 0; |
540 | } | 528 | } |
541 | } | 529 | } |