summaryrefslogtreecommitdiff
path: root/libdiskfs
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1997-02-14 01:24:42 +0000
committerMiles Bader <miles@gnu.org>1997-02-14 01:24:42 +0000
commitb8793e8744443545be73e51f4a416a74dcc99b6d (patch)
tree4896b8a6c83b2c28a2ec44f84440e2de5e2fa956 /libdiskfs
parent2f80f04d0b7f6476762ec49964adfe930847182e (diff)
(diskfs_make_peropen):
Add & use CONTEXT param. Remove DOTDOT & DEPTH params.
Diffstat (limited to 'libdiskfs')
-rw-r--r--libdiskfs/peropen-make.c28
1 files changed, 21 insertions, 7 deletions
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;
}