summaryrefslogtreecommitdiff
path: root/libdiskfs/file-set-trans.c
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2013-07-30 11:59:14 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2013-09-15 23:16:22 +0200
commitf18f06ea2fbde9d5ab2d6bbd30e4cdeebb186c87 (patch)
tree185130a52d38b17542b0aa63c0a43279cb37cec1 /libdiskfs/file-set-trans.c
parent9df906ee4f34cf54c9ba253d44abb74b0ef63fe1 (diff)
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.
Diffstat (limited to 'libdiskfs/file-set-trans.c')
-rw-r--r--libdiskfs/file-set-trans.c19
1 files changed, 18 insertions, 1 deletions
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;
}