diff options
author | Justus Winter <4winter@informatik.uni-hamburg.de> | 2013-11-06 11:22:50 +0100 |
---|---|---|
committer | Justus Winter <4winter@informatik.uni-hamburg.de> | 2014-01-12 19:17:00 +0100 |
commit | 4de65c4af42894f57b8b8c3a050260725a96b109 (patch) | |
tree | 9cc603cea3f25cf83888dd17e1c02893d5ab66ec /libfshelp/fshelp.h | |
parent | 0033d20449b3bb558f2ea470983018db39b572aa (diff) | |
download | hurd-4de65c4af42894f57b8b8c3a050260725a96b109.tar.gz hurd-4de65c4af42894f57b8b8c3a050260725a96b109.tar.bz2 hurd-4de65c4af42894f57b8b8c3a050260725a96b109.zip |
libfshelp: fix the api of fshelp_set_active_translator
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.
Diffstat (limited to 'libfshelp/fshelp.h')
-rw-r--r-- | libfshelp/fshelp.h | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/libfshelp/fshelp.h b/libfshelp/fshelp.h index a7702ca2..5d3a0ceb 100644 --- a/libfshelp/fshelp.h +++ b/libfshelp/fshelp.h @@ -1,5 +1,5 @@ /* FS helper library definitions - Copyright (C) 1994,95,96,97,98,99,2000,01,02,13 + Copyright (C) 1994,95,96,97,98,99,2000,01,02,13,14 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or @@ -34,14 +34,20 @@ /* Keeping track of active translators */ -/* These routines keep a list of active translators. They are - self-contained and do not require multi threading or the ports - library. */ +/* These routines keep a list of active translators. They do not + require multi threading but depend on the ports library. */ + +struct port_info; /* Record an active translator being bound to the given file name - NAME. ACTIVE is the control port of the translator. */ + 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. */ error_t -fshelp_set_active_translator (const char *name, mach_port_t active); +fshelp_set_active_translator (struct port_info *pi, + const char *name, + mach_port_t active); /* Remove the active translator specified by its control port ACTIVE. If there is no active translator with the given control port, this |