diff options
author | Michael I. Bushnell <mib@gnu.org> | 1995-06-14 20:35:02 +0000 |
---|---|---|
committer | Michael I. Bushnell <mib@gnu.org> | 1995-06-14 20:35:02 +0000 |
commit | b5e479d7c367f8e10cef0887e196ba5669d22a55 (patch) | |
tree | 70014db55842e95140d16dbf18ddce567bc1bd90 /libdiskfs/fsys-getroot.c | |
parent | 9064fd8d1ff4300d986057ba75dc4a87cd7b7ab0 (diff) |
(diskfs_S_fsys_getroot): Use new translator startup interface.
Diffstat (limited to 'libdiskfs/fsys-getroot.c')
-rw-r--r-- | libdiskfs/fsys-getroot.c | 56 |
1 files changed, 14 insertions, 42 deletions
diff --git a/libdiskfs/fsys-getroot.c b/libdiskfs/fsys-getroot.c index ab630a8e..89e213f8 100644 --- a/libdiskfs/fsys-getroot.c +++ b/libdiskfs/fsys-getroot.c @@ -57,56 +57,28 @@ diskfs_S_fsys_getroot (fsys_t controlport, type = diskfs_root_node->dn_stat.st_mode & S_IFMT; - repeat_transcheck: if ((diskfs_root_node->istranslated - || diskfs_root_node->translator.control != MACH_PORT_NULL) + || fshelp_translated (&diskfs_root_node->transbox)) && !(flags & O_NOTRANS)) { - /* If this is translated, start the translator (if necessary) - and use it. */ - mach_port_t childcontrol = diskfs_root_node->translator.control; - - if (childcontrol == MACH_PORT_NULL) + error = fshelp_fetch_root (&diskfs_root_node->transbox, + &dotdot, dotdot, uids, nuids, + gids, ngids, flags, + _diskfs_translator_callback, + retry, retryname, returned_port); + if (error && error != ENOENT) { - mach_port_mod_refs (mach_task_self (), dotdot, - MACH_PORT_RIGHT_SEND, 1); - if (error = diskfs_start_translator (diskfs_root_node, dotdot, 0)) - { - mutex_unlock (&diskfs_root_node->lock); - return error; - } - childcontrol = diskfs_root_node->translator.control; + mutex_unlocx (&diskfs_root_node->lock); + return error; } - - mach_port_mod_refs (mach_task_self (), childcontrol, - MACH_PORT_RIGHT_SEND, 1); - - mutex_unlock (&diskfs_root_node->lock); - - error = fsys_getroot (childcontrol, dotdot, MACH_MSG_TYPE_COPY_SEND, - uids, nuids, gids, ngids, - flags, retry, retryname, returned_port); - if (error == MACH_SEND_INVALID_DEST || error == MIG_SERVER_DIED) + if (!error) { - /* The server has died; unrecord the translator port - and repeat the check. */ - mutex_lock (&diskfs_root_node->lock); - if (diskfs_root_node->translator.control == childcontrol) - fshelp_translator_drop (&diskfs_root_node->translator); - mach_port_deallocate (mach_task_self (), childcontrol); - error = 0; - goto repeat_transcheck; + *returned_port_poly = MACH_MSG_TYPE_MOVE_SEND; + return 0; } - - if (!error && *returned_port != MACH_PORT_NULL) - *returned_port_poly = MACH_MSG_TYPE_MOVE_SEND; - else - *returned_port_poly = MACH_MSG_TYPE_COPY_SEND; - - if (!error) - mach_port_deallocate (mach_task_self (), dotdot); - return error; + /* ENOENT means the translator was removed in the interim. */ + error = 0; } if (type == S_IFLNK && !(flags & (O_NOLINK | O_NOTRANS))) |