summaryrefslogtreecommitdiff
path: root/node.c
diff options
context:
space:
mode:
authorSergiu Ivanov <unlimitedscolobb@gmail.com>2008-12-12 21:28:52 +0200
committerSergiu Ivanov <unlimitedscolobb@gmail.com>2008-12-12 21:28:52 +0200
commitfd0bc23b08aa9ff76d61f753149b5e4fbf2c5a30 (patch)
tree34f6dea23e5727d2240cf4c2b69d5992c0dd543e /node.c
parenta54273639f6afd659c15326cb997922fcecfe89a (diff)
Ports in shadow nodes are opened by the translator starting routine now.
Before, netfs_S_dir_lookup used to open the ports in shadow, nodes. This could cause conflicts with the flags required by the translator starting up on the node. Now the port is opened only based on the flags requested by the translator being launched.
Diffstat (limited to 'node.c')
-rw-r--r--node.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/node.c b/node.c
index 866bd1977..f98966a45 100644
--- a/node.c
+++ b/node.c
@@ -658,10 +658,12 @@ error_t node_unlink_file (node_t * dir, char *name)
} /*node_unlink_file */
/*---------------------------------------------------------------------------*/
-/*Sets the given translators on the specified node*/
+/*Sets the given translators on the specified node. Looks up the node
+ as required by the translators being started.*/
error_t node_set_translators (struct protid * diruser, node_t * np,
char *trans, /*set these on `node` */
- size_t ntrans, int flags, mach_port_t * port)
+ size_t ntrans, int flags, char * filename,
+ mach_port_t * port)
{
error_t err;
mach_port_t p;
@@ -750,6 +752,19 @@ error_t node_set_translators (struct protid * diruser, node_t * np,
if (err)
return err;
+ /*open the ports to underlying real file as required by the
+ translator and a service port (TODO: deal with this
+ ``service'' port) */
+ np->nn->port = file_name_lookup_under
+ (diruser->po->np->nn->port, filename, flags, 0);
+ if(!np->nn->port)
+ return ENOENT;
+
+ np->nn->port_notrans = file_name_lookup_under
+ (diruser->po->np->nn->port, filename, flags | O_NOTRANS, 0);
+ if(!np->nn->port)
+ return ENOENT;
+
/*duplicate the supplied user */
err = iohelp_dup_iouser (&user, diruser->user);
if (err)