From b8793e8744443545be73e51f4a416a74dcc99b6d Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Fri, 14 Feb 1997 01:24:42 +0000 Subject: (diskfs_make_peropen): Add & use CONTEXT param. Remove DOTDOT & DEPTH params. --- libdiskfs/peropen-make.c | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) (limited to 'libdiskfs') diff --git a/libdiskfs/peropen-make.c b/libdiskfs/peropen-make.c index 0fd32563..62a5a13b 100644 --- a/libdiskfs/peropen-make.c +++ b/libdiskfs/peropen-make.c @@ -21,20 +21,34 @@ /* Create and return a new peropen structure on node NP with open flags FLAGS. */ struct peropen * -diskfs_make_peropen (struct node *np, int flags, - mach_port_t dotdotport, unsigned depth) +diskfs_make_peropen (struct node *np, int flags, struct peropen *context) { struct peropen *po = malloc (sizeof (struct peropen)); + po->filepointer = 0; po->lock_status = LOCK_UN; po->refcnt = 0; po->openstat = flags; po->np = np; - po->dotdotport = dotdotport; - po->depth = depth; - if (dotdotport != MACH_PORT_NULL) - mach_port_mod_refs (mach_task_self (), dotdotport, - MACH_PORT_RIGHT_SEND, 1); + + if (context) + { + po->root_parent = context->root_parent; + if (po->root_parent != MACH_PORT_NULL) + mach_port_mod_refs (mach_task_self (), po->root_parent, + MACH_PORT_RIGHT_SEND, 1); + + po->shadow_root = context->shadow_root; + if (po->shadow_root) + diskfs_nref (po->shadow_root); + + po->shadow_root_parent = context->shadow_root_parent; + if (po->shadow_root_parent != MACH_PORT_NULL) + mach_port_mod_refs (mach_task_self (), po->shadow_root_parent, + MACH_PORT_RIGHT_SEND, 1); + } + diskfs_nref (np); + return po; } -- cgit v1.2.3