diff options
author | Justus Winter <justus@gnupg.org> | 2017-08-22 13:07:54 +0200 |
---|---|---|
committer | Justus Winter <justus@gnupg.org> | 2017-09-12 10:41:35 +0200 |
commit | e08859424e01697fe556e277283e8e1905327ce7 (patch) | |
tree | 93bf0ad8e0af70cffa177c4271a31a5b15d533c8 /libfshelp/fshelp.h | |
parent | 04aaffbd6353e7cec04073783cc8cbd22ac2f675 (diff) | |
download | hurd-e08859424e01697fe556e277283e8e1905327ce7.tar.gz hurd-e08859424e01697fe556e277283e8e1905327ce7.tar.bz2 hurd-e08859424e01697fe556e277283e8e1905327ce7.zip |
libfshelp: Use node instead of name as key.
Previously, libfshelp used the name of an translator as key in the
hash table. This however is flawed, because a translator is bound to
a node, and a node can have zero or more links in the file system.
Use the nodes address (or rather, the address of the transbox embedded
in the node) as key instead.
* libfshelp/fshelp.h (fshelp_set_active_translator): Instead of the
control port, hand the whole transbox to the function.
* libfshelp/translator-list.c (struct translator): New field 'locp'.
(hash): Hash pointer.
(compare): Compare pointer.
(translator_ihash): Use an location pointer.
(fshelp_set_active_translator): Use the address of the transbox as key.
(fshelp_remove_active_translator): Remove using the location pointer.
* libdiskfs/dir-lookup.c (diskfs_S_dir_lookup): Fix callsite.
* libdiskfs/file-set-trans.c (diskfs_S_file_set_translator): Likewise.
* libnetfs/dir-lookup.c (netfs_S_dir_lookup): Likewise.
* libnetfs/file-set-translator.c (netfs_S_file_set_translator):
Likewise.
Diffstat (limited to 'libfshelp/fshelp.h')
-rw-r--r-- | libfshelp/fshelp.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libfshelp/fshelp.h b/libfshelp/fshelp.h index d1dd49c4..7663ba1d 100644 --- a/libfshelp/fshelp.h +++ b/libfshelp/fshelp.h @@ -38,16 +38,16 @@ require multi threading but depend on the ports library. */ struct port_info; +struct transbox; /* Record an active translator being bound to the given file name - NAME. ACTIVE is the control port of the translator. PI references - a receive port that is used to request dead name notifications, - typically the port for the underlying node passed to the - translator. */ + NAME. TRANSBOX is the nodes transbox. PI references a receive + port that is used to request dead name notifications, typically the + port for the underlying node passed to the translator. */ error_t fshelp_set_active_translator (struct port_info *pi, const char *name, - mach_port_t active); + const struct transbox *transbox); /* Remove the active translator specified by its control port ACTIVE. If there is no active translator with the given control port, this |