From a1712f9f6ba240fed9bce7d8d032f0e599b848ce Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Tue, 20 Jun 1995 01:04:30 +0000 Subject: (diskfs_shutdown): Use diskfs_node_iterate instead of diskfs_translator_iterate. --- libdiskfs/shutdown.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'libdiskfs') diff --git a/libdiskfs/shutdown.c b/libdiskfs/shutdown.c index a385460b..1dfeeb99 100644 --- a/libdiskfs/shutdown.c +++ b/libdiskfs/shutdown.c @@ -31,17 +31,29 @@ diskfs_shutdown (int flags) int nports = -1; int err; - void sync_trans (struct trans_link *trans, void *arg) - { - fsys_goaway (trans->control, (int) arg); - } + error_t + helper (struct node *np) + { + error_t error; + mach_port_t control; + + error = fshelp_fetch_control (np, &control); + if (!error && (control != MACH_PORT_NULL)) + { + error = fsys_goaway (control, flags); + mach_port_deallocate (mach_task_self (), control); + } + else + error = 0; + return error; + } if ((flags & FSYS_GOAWAY_UNLINK) && S_ISDIR (diskfs_root_node->dn_stat.st_mode)) return EBUSY; if (flags & FSYS_GOAWAY_RECURSE) - fshelp_translator_iterate (sync_trans, (void *)flags); + diskfs_node_iterate (helper); mutex_lock (&diskfs_shutdown_lock); -- cgit v1.2.3