summaryrefslogtreecommitdiff
path: root/node.c
diff options
context:
space:
mode:
authorSergiu Ivanov <unlimitedscolobb@gmail.com>2009-04-13 01:03:40 +0300
committerSergiu Ivanov <unlimitedscolobb@gmail.com>2009-04-13 01:03:40 +0300
commitc9110f9c7d71fa9b157540a7aa2ade7f34b79968 (patch)
tree86723a412757f6d44ac60e8efec921fd14777987 /node.c
parent0a5fcd403943fbbdc0a2ba35283f1135f97c48dc (diff)
nsmux can shutdown all dynamic translators on exit
Now nsmux can shutdown all of its dynamic translators on exit, thus doing sufficient cleanup. One can tell nsmux to shutdown dynamic translators using the ``--recursive'' option to settrans. Note that because fsys_goaway returns immediately as the RPC is processed, while the receiver may still remain in memory, doing something like settrans -g --recursive foo where nsmux is sitting on foo will almost always result in a ``Server busy'' error message. The reason is that libnetfs counts how many open ports to its nodes there are at shutdown and in most cases it does the check *before* the dynamic translators manage to drop their references. Therefore, the aforementioned command gracefully kills all dynamic translators. Invoked the second time, this command will shutdown nsmux, too. Immediate shutdown with killing dynamic translators can be achieved via settrans -gf --recursive foo
Diffstat (limited to 'node.c')
-rw-r--r--node.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/node.c b/node.c
index 778a73be5..a7c85fd4c 100644
--- a/node.c
+++ b/node.c
@@ -98,7 +98,7 @@ error_t node_create (lnode_t * lnode, node_t ** node)
/*initialize the data fields dealing with positioning this node
in the dynamic translator stack */
- node_new->nn->trans_cntl = MACH_PORT_NULL;
+ node_new->nn->dyntrans = NULL;
node_new->nn->below = NULL;
/*store the result of creation in the second parameter */
@@ -155,7 +155,7 @@ error_t node_create_proxy (lnode_t * lnode, node_t ** node)
/*initialize the data fields dealing with positioning this node
in the dynamic translator stack */
- node_new->nn->trans_cntl = MACH_PORT_NULL;
+ node_new->nn->dyntrans = NULL;
node_new->nn->below = NULL;
/*store the result of creation in the second parameter */
@@ -214,7 +214,7 @@ error_t node_create_from_port (mach_port_t port, node_t ** node)
/*initialize the data fields dealing with positioning this node
in the dynamic translator stack */
- node_new->nn->trans_cntl = MACH_PORT_NULL;
+ node_new->nn->dyntrans = NULL;
node_new->nn->below = NULL;
/*store the result of creation in the second parameter */
@@ -913,8 +913,8 @@ error_t
if (err)
return err;
- /*Store the current control port in the new supplied shadow node */
- np->nn->trans_cntl = active_control;
+ /*Register the new translator*/
+ err = trans_register (active_control, &np->nn->dyntrans);
/*Obtain the port to the top of the newly-set translator */
err = fsys_getroot