From f18f06ea2fbde9d5ab2d6bbd30e4cdeebb186c87 Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Tue, 30 Jul 2013 11:59:14 +0200 Subject: libdiskfs: add fsys_get_children Keep track of active translators and handle fsys_get_children requests. * libdiskfs/Makefile (FSYSSRCS): Add fsys-get-children.c. * libdiskfs/dead-name.c (ports_dead_name): Remove dead translators. * libdiskfs/file-set-trans.c (diskfs_S_file_set_translator): Register active translators. * libdiskfs/fsys-get-children.c: New file. --- libdiskfs/file-set-trans.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'libdiskfs/file-set-trans.c') diff --git a/libdiskfs/file-set-trans.c b/libdiskfs/file-set-trans.c index 49303e7c..8de2e641 100644 --- a/libdiskfs/file-set-trans.c +++ b/libdiskfs/file-set-trans.c @@ -1,5 +1,6 @@ /* libdiskfs implementation of fs.defs: file_set_translator - Copyright (C) 1992,93,94,95,96,99,2001,02 Free Software Foundation, Inc. + Copyright (C) 1992,93,94,95,96,99,2001,02,13 + Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -206,5 +207,21 @@ diskfs_S_file_set_translator (struct protid *cred, } pthread_mutex_unlock (&np->lock); + + if (! error && cred->po->path) + error = fshelp_set_active_translator (cred->po->path, active); + + if (! error && active != MACH_PORT_NULL) + { + mach_port_t old; + error = mach_port_request_notification (mach_task_self (), active, + MACH_NOTIFY_DEAD_NAME, 0, + cred->pi.port_right, + MACH_MSG_TYPE_MAKE_SEND_ONCE, + &old); + if (old != MACH_PORT_NULL) + mach_port_deallocate (mach_task_self (), old); + } + return error; } -- cgit v1.2.3