Age | Commit message (Collapse) | Author |
|
* 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.
|
|
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.
|
|
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
|
|
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.
|
|
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.
|
|
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 --
|
|
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 ---...
|
|
Usually the file of which the supplied node is a mirror is
looked up by node_set_translator, so that it can open using
the flag combination required by the translator being started.
However, when dealing with a dynamic translator being set upon
another dynamic translator, node_set_translator must not do any
lookups, because a valid port is already stored in the supplied
node.
|
|
Since we want netfs_S_dir_lookup to ask the client to do a
retry when it sets a new dynamic translator, nsmux has to give
the client a *proxy* of the port to the root of the current
dynamic translator, so that the retry gets back in nsmux. For
this we need to create proxy nodes for ports, which is precisely
what node_create_from_port does.
|
|
Now this function is called node_set_translator and sets only
one translator on the supplied (shadow) node. This function has
not yet been debugged.
|
|
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.
|
|
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.
|
|
Now the code is (hopefully) compliant with GNU Coding Standards.
|
|
node_set_translators used to count the translators in the list
and set the first one so many times as there were translators.
This bug is killed now.
|
|
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.
|
|
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.
|
|
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'.
|
|
At the moment nsmux is only capable of creating a read-only
mirror of the given directory.
|