summaryrefslogtreecommitdiff
path: root/nsmux.c
AgeCommit message (Collapse)Author
2020-08-03Fix buildSamuel Thibault
2013-02-11Fix build against libpthreadSamuel Thibault
* Makefile.am (nsmux_LDADD): Link against libpthread instead of libthreads. * nsmux.h: Include <pthread.h> instead of <cthreads.h> * lnode.h: Use pthread type instead of cthreads structure. * node.h: Likewise. * ncache.h: Likewise. * lnode.c: Use pthread functions instead of cthreads functions. * node.c: Likewise. * ncache.c: Likewise. * nsmux.c: Likewise.
2009-10-06Build system.Thomas Schwinge
* configure.ac: New file. * package.m4: Likewise. * Makefile.am: Likewise. * build: Remove file. * nsmux.c (netfs_server_name, netfs_server_version): Set from the Autoconf variables. * options.c (argp_program_version): Likewise. (argp_program_bug_address): New.
2009-04-14Made nsmux wait until dynamic translators finishSergiu Ivanov
Previously, a settrans -gR on a node on which nsmux resides would only kill the dynamic translators, without shutting down nsmux, because it didn't wait for the children to close their ports, which made a check in netfs_shutdown fail. Now nsmux waits for the dynamic translator to finish, so settrans -gR does its job as expected: shuts down everything.
2009-04-13nsmux can shutdown all dynamic translators on exitSergiu Ivanov
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
2009-04-09Updated copyright yearsSergiu Ivanov
The copyright years were listed only up to 2008, so I added 2009. Also, some of the files I created from scratch used to list copyright years starting with 2001, which was wrong. This has also been corrected.
2009-03-20Shadow and proxy nodes are connected in a chainSergiu Ivanov
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.
2009-03-06Added node typesSergiu Ivanov
Now inside each netnode (and, hence, inside each node) there is a field showing the type of the node. This is required because, at least in response to requests by the filter, proxy nodes and shadow nodes will have different jobs to do and the server-side implementation of filesystem RPCs in nsmux would need to know what actions they are expected to carry out.
2009-03-06Added proxy nodes in the dynamic translator stackSergiu Ivanov
When setting dynamic translators, nsmux used to offer the client a port to the dynamic translator directly. Now it gives off a proxy node, which contains a port to the translator. Also, proxy nodes are now included in dynamic translator stacks. Dynamic translator stacks now consist of the following interconnected conceptual blocks: -- shadow node -- translator -- proxy node --
2009-02-20Dynamic translator stacks are set in series of retriesSergiu Ivanov
When a client wants nsmux to set several translators on a node using a syntax like ``file,,x,,y'', nsmux sets the first translator on a shadow node mirroring ``file'' and punts a retry to the client. The client (commonly) does the retry and thus control comes back to nsmux, which creates another shadow node and sets the second translator on this node. At the moment translator stacks do not include proxy nodes, i.e. the structure of a dynamic translator stack is: ...---dynamic translator -- shadow node -- dynamic translator ---...
2009-01-29Made nsmux able to pass retries to the clientSergiu Ivanov
Now, when nsmux sets another dynamic translator, it sends a retry to the client, so that it could set the (possible) next dynamic translator in the next execution of netfs_S_dir_lookup, which will occur due to the retry. However, nsmux cannot handle the retry properly yet. The reason for splitting the functionality of *only* passing the retry to client in a separate commit is that it required some tricky code manipulation and hence I feel that keeping it in a separate commit is quite reasonable.
2009-01-23nsmux can now correctly start one translatorSergiu Ivanov
nsmux can now handle the syntax ``file,,x'' correctly again. Translator *stacks* cannot be created yet.
2009-01-22netfs_S_dir_lookup can perform usual lookupsSergiu Ivanov
Due to the transition to a different way of building translator stacks netfs_S_dir_lookup has been broken and nsmux could not respond normally to any lookup requests. Now netfs_S_dir_lookup is again capable of doing normal lookups. At the moment nsmux is doing nothing but mirror the real filesystem.
2009-01-22Added the routines for parsing magic syntaxSergiu Ivanov
Now nsmux has two special routines for parsing the special ``,,'' syntax: magic_find_sep and magic_unescape. The reason for their separate existence is that the magic ``,,'' is allowed to be escaped in the following way ``,,,'' and nsmux must be able to react correspondingly to such syntax.
2009-01-20Magic syntax handling removed from netfs_attempt_lookup_improvedSergiu Ivanov
Up to now it was netfs_attempt_lookup_improved who handled the magic syntax for ``,,''. Now the idea is to handle this syntax via retries and netfs_attempt_lookup_improved is in no position to manage this. In further commits the magic syntax will be handled by netfs_S_dir_lookup. Note nsmux does not actually work at the moment.
2009-01-18Prepared struct node for stacks of shadow nodesSergiu Ivanov
So far dynamic translator stacks were created in the following fashion: nsmux created a shadow node on which the whole dynamic translator stack was built. This commit starts the transition to a different strategy: the new approach consists in setting *each* dynamic translator on its personal shadow node. To achieve such functionality the set of fiels of struct node was modified and the bits of code that manipulated these fields were stripped out. The code is not functional now. The coming commits will bring it back to life.
2008-12-12Ports in shadow nodes are opened by the translator starting routine now.Sergiu Ivanov
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.
2008-11-21Moved the code to GCSSergiu Ivanov
Now the code is (hopefully) compliant with GNU Coding Standards.
2008-10-10Made netfs_S_file_get_translator_cntl use the untranslated version of the ↵Sergiu Ivanov
real node Now netfs_S_file_get_translator_cntl calls the file_get_translator_cntl routine on the untranslated version of the real node, which makes it possible for the filter to trace the real translator stack.
2008-10-10Added the code of always looking up the untranslated real nodeSergiu Ivanov
netfs_attempt_lookup_improved will now lookup the requested file both with the requested flags and in an untranslated fashion. This will allow netfs_S_file_get_translator_cntl to correctly redirect requests to the real filesystem node.
2008-10-10Added the code for recognizing non-root nodes to ↵Sergiu Ivanov
netfs_S_file_get_translator_cntl Now netfs_file_get_translator_cntl will recognize whether it is called for the root node or not. In case the node it is called on is not the root, it will call file_get_translator_cntl on the real node, so that filters could trace translator stacks on real nodes.
2008-10-03Copied the implementation of netfs_S_file_get_translator_cntl from libdiskfs.Sergiu Ivanov
By default, libnetfs does not implement this callback, which, BTW, makes impossible to trace the translator stack consisting of libnetfs translators. nsmux not only needs an implementation of this routine, but also requires customizations in order for filters to trace translator stacks on real nodes.
2008-10-03Revert "Cloned the native implementation of netfs_S_fsys_getroot."Sergiu Ivanov
This reverts commit 7200dac108c4a8981b7f7f5f90757409c3e6d5bf.
2008-10-03Revert "Copied the implementation of netfs_S_file_get_translator_cntl from ↵Sergiu Ivanov
libdiskfs." This reverts commit e7b2aaa4548c0fa5fb5d6c8586fee63748d16dab.
2008-10-01Copied the implementation of netfs_S_file_get_translator_cntl from libdiskfs.Sergiu Ivanov
By default, libnetfs does not implement this callback, which, BTW, makes impossible to trace the translator stack consisting of libnetfs translators. nsmux not only needs an implementation of this routine, but also requires customizations in order for filters to trace translator stacks on real nodes.
2008-10-01Cloned the native implementation of netfs_S_fsys_getroot.Sergiu Ivanov
I cloned the native implementation of netfs_S_fsys_getroot, since we filter translators run on nsmux nodes to see the translator stacks of the real filesystem nodes.
2008-09-19Added the mechanism of maintaining shadow nodes alive.Sergiu Ivanov
I refactored the node cache in such a way that it now only maintains references to nodes (the reason is that only directory nodes and shadow nodes are created, therefore the existing node cache is very well suited for this purpose). It must be remarked that the node cache, borrowed from unionfs, has never actually been a *cache*, therefore this small change does not alter things badly. I also removed the command line option --ncache-size.
2008-09-07Made nsmux RWSergiu Ivanov
Now nsmux will handle properly the requests to write into proxy nodes, instead of simply returning 0.
2008-09-07Added proxy nodes, optimized node management policySergiu Ivanov
Now, when 'file,,x' is requested, nsmux will create a proxy node and will set the translator 'x' on this node, not on the real filesystem node. Also, nsmux will not create nodes for simple file looks, instead it will simply return the port to the required file, thus avoiding the necessity to handle IO operations inside itself.
2008-07-22Added the possibility to propagate translators onto directories. Fixed bugs.Sergiu Ivanov
Now the user can enter directories using the following command: cd dir,,x All files in this directory will then be implicitly translated by translator 'x'; in other words, if there is a file 'file' in directory 'dir', after executing the command mentioned above, and after running cat file the user will obtain the content of 'file' translated by 'x'. Also fixed several rather serious bugs in lookup of file names of the type 'file,,x'.
2008-07-19Added the code for looking up files with names like 'file,,x'.Sergiu Ivanov
The user can now request files with special names like 'file,,x' and the proxy will start the translator 'x' on file 'file' and return the port to the user. If 'x' is not an absolute path, the default prefix '/hurd/' is added to it.
2008-07-13Copied the skeleton for mirroring a directory from filterfs.Sergiu Ivanov
At the moment nsmux is only capable of creating a read-only mirror of the given directory.