diff options
author | Sergiu Ivanov <unlimitedscolobb@gmail.com> | 2008-12-12 21:28:52 +0200 |
---|---|---|
committer | Sergiu Ivanov <unlimitedscolobb@gmail.com> | 2008-12-12 21:28:52 +0200 |
commit | fd0bc23b08aa9ff76d61f753149b5e4fbf2c5a30 (patch) | |
tree | 34f6dea23e5727d2240cf4c2b69d5992c0dd543e /node.c | |
parent | a54273639f6afd659c15326cb997922fcecfe89a (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.c | 19 |
1 files changed, 17 insertions, 2 deletions
@@ -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) |