summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergiu Ivanov <unlimitedscolobb@gmail.com>2009-03-20 21:59:05 +0200
committerSergiu Ivanov <unlimitedscolobb@gmail.com>2009-03-20 21:59:05 +0200
commit1e8766f3649e8a97595fad2a8ca550028e5e3f4a (patch)
treecd6e1d5f2ad6e5c1819336e80c2fe2ab69904486
parent48efa86dfe3e546190f997e70c307a231026d207 (diff)
Shadow and proxy nodes are connected in a chain
nsmux will eventually need to be able to traverse dynamic translator stacks, so it will have to know which node lies under a certain node (shadow or proxy). To be able to do this, nsmux now maintains the service nodes in a dynamic translator stack in a one-directional linked list.
-rw-r--r--nsmux.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/nsmux.c b/nsmux.c
index 3f222d2ee..240ccd227 100644
--- a/nsmux.c
+++ b/nsmux.c
@@ -765,6 +765,9 @@ error_t
struct protid *newpi;
struct iouser *user;
+ /*The old node (required in setting up translator stacks) */
+ struct node * old_np;
+
/*The port to the file */
file_t file = MACH_PORT_NULL;
@@ -912,11 +915,15 @@ error_t
error = node_get_send_port (diruser, np, flags, &file);
if (error)
goto out;
-
+
+ old_np = np;
error = node_create_from_port(file, &np);
if (error)
goto out;
+ /*connect the nodes into a chain. */
+ np->nn->below = old_np;
+
/*`np` is supposed to be unlocked by the following
code. */
mutex_unlock (&np->lock);
@@ -963,7 +970,14 @@ error_t
/*create a proxy node for the port to the root
of translator */
netfs_nput (np);
+ old_np = np;
error = node_create_from_port (file, &np);
+
+ if(error)
+ goto out;
+
+ /*connect the nodes in a chain. */
+ np->nn->below = old_np;
/*create a port to the proxy node */
@@ -993,7 +1007,13 @@ error_t
/*create a proxy node for the port to the current
translator */
netfs_nput (np);
+ old_np = np;
error = node_create_from_port (file, &np);
+ if(error)
+ goto out;
+
+ /*connect the nodes in a chain. */
+ np->nn->below = old_np;
/*create a port to the proxy node */
error = node_get_port (diruser, np, flags, retry_port);