summaryrefslogtreecommitdiff
path: root/libfshelp/translator-list.c
AgeCommit message (Collapse)Author
2016-09-04libfshelp: acquire references to control portsJustus Winter
* libfshelp/translator-list.c (translator_ihash_cleanup): Release reference. (fshelp_set_active_translator): Acquire reference
2014-11-02Fix unlocking translator listSamuel Thibault
* libfshelp/translator-list.c (fshelp_set_active_translator): Use common out path to unlock translator_ihash_lock before exitting on error.
2014-08-31hurd: fix semantic of file_get_childrenJustus Winter
When first introduced as fsys_get_children, it made sense to return the list of children using paths relative to the root of the filesystem that was queried. Making the get_children method part of the fsys protocol was a mistake that has since been corrected in 9366d6b2. Instead of returning paths relative to the root of the translator, return paths relative to the path of the receiving node. This fixes a problem with the mtab translator. Previously, the mtab translator invoked on a target that was not the root directory of a translator would compute invalid paths, e.g.: /hurd/mtab: /any/path/servers/socket/26 No such file or directory * hurd/fs.defs (file_get_children): Update comment. * libfshelp/translator-list.c (fshelp_get_active_translators): Add argument PREFIX. Filter entries not beginning with PREFIX if non-NULL, and omit PREFIX from the returned paths. * libfshelp/fshelp.h (fshelp_get_active_translators): Update comment accordingly. Also clarify that both FILTER and PREFIX can be NULL. * libdiskfs/file-get-children.c (diskfs_S_file_get_children): Update comment, pass prefix to fshelp_get_active_translators. * libnetfs/file-get-children.c (netfs_S_file_get_children): Likewise.
2014-01-12libfshelp: fix the api of fshelp_set_active_translatorJustus Winter
To detect if an active translator goes away, we need to register for dead name notifications. Those notifications have to be sent to a port known to the ports library, as the ports library handles the dead name notifications. The most straight forward way is to use the port to the underlying node for that. To that end, a reference to the port_info struct is handed in and kept in the list of active translators. This commit also moves the registration of dead name notifications to libfshelp. * libfshelp/fshelp.h (fshelp_set_active_translator): Add port_info argument. * libfshelp/translator-list.c (struct translator): Add port_info pointer. (translator_ihash_cleanup): Dereference port_info object. (fshelp_set_active_translator): Register dead name notifications. * libdiskfs/file-set-trans.c (diskfs_S_file_set_translator): Update accordingly. * libnetfs/file-set-translator.c (netfs_S_file_set_translator): Likewise.
2013-10-08libfshelp: properly free active translator entriesJustus Winter
Previously the dynamically allocated field name leaks. Fix this by properly freeing the objects of type struct translator. * libfshelp/translator-list.c (translator_ihash_cleanup): Fix memory leak.
2013-09-16Add missing includeSamuel Thibault
* libfshelp/translator-list.c: Include <libgen.h> to get `dirname' prototype.
2013-09-15libfshelp: add translator-list.cJustus Winter
Add functions that maintain a list of active translators. * libfshelp/translator-list.c: New file. * libfshelp/fshelp.h: Add function declarations. * libfshelp/Makefile: Add translator-list.c, link against libihash.