- struct vnode *parent_vp;
- struct vnode *target_vp;
- struct vnode *tparent_vp;
- struct hfsnode *parent_hp; /* parent */
- struct componentname *cnp;
- struct ucred *cred;
- struct proc *p;
- struct hfsCatalogInfo catInfo;
- u_int32_t parent_id;
- u_int32_t nodeID;
- u_int16_t targetLen;
- u_int16_t forkType;
- int flags;
- int lockparent; /* !0 => lockparent flag is set */
- int wantparent; /* !0 => wantparent or lockparent flag */
- int nameiop;
- int retval;
- u_char isDot, isDotDot, found;
- DBG_FUNC_NAME("lookup");
- DBG_VOP_LOCKS_DECL(2);
- DBG_VOP_LOCKS_INIT(0,ap->a_dvp, VOPDBG_LOCKED, VOPDBG_IGNORE, VOPDBG_IGNORE, VOPDBG_POS);
- DBG_VOP_LOCKS_INIT(1,*ap->a_vpp, VOPDBG_IGNORE, VOPDBG_LOCKED, VOPDBG_IGNORE, VOPDBG_POS);
- DBG_VOP_PRINT_FUNCNAME();DBG_VOP_CONT(("\n"));
- DBG_HFS_NODE_CHECK(ap->a_dvp);
-
-
- /*
- * Do initial setup
- */
- INIT_CATALOGDATA(&catInfo.nodeData, 0);
- parent_vp = ap->a_dvp;
- cnp = ap->a_cnp;
- parent_hp = VTOH(parent_vp); /* parent */
- target_vp = NULL;
- targetLen = cnp->cn_namelen;
- nameiop = cnp->cn_nameiop;
- cred = cnp->cn_cred;
- p = cnp->cn_proc;
- lockparent = cnp->cn_flags & LOCKPARENT;
- wantparent = cnp->cn_flags & (LOCKPARENT|WANTPARENT);
- flags = cnp->cn_flags;
- parent_id = H_FILEID(parent_hp);
- nodeID = kUnknownID;
- found = FALSE;
- isDot = FALSE;
- isDotDot = FALSE;
- retval = E_NONE;
- forkType = kUndefinedFork;
-
-
- /*
- * We now have a segment name to search for, and a directory to search.
- *
- */
+ struct vnode *dvp; /* vnode for directory being searched */
+ struct cnode *dcp; /* cnode for directory being searched */
+ struct vnode *tvp; /* target vnode */
+ struct hfsmount *hfsmp;
+ struct componentname *cnp;
+ struct ucred *cred;
+ struct proc *p;
+ int wantrsrc = 0;
+ int forknamelen = 0;
+ int flags;
+ int wantparent;
+ int nameiop;
+ int retval = 0;
+ int isDot;
+ struct cat_desc desc = {0};
+ struct cat_desc cndesc;
+ struct cat_attr attr;
+ struct cat_fork fork;
+ struct vnode **vpp;
+
+ vpp = ap->a_vpp;
+ cnp = ap->a_cnp;
+ dvp = ap->a_dvp;
+ dcp = VTOC(dvp);
+ hfsmp = VTOHFS(dvp);
+ *vpp = NULL;
+ isDot = FALSE;
+ tvp = NULL;
+ nameiop = cnp->cn_nameiop;
+ cred = cnp->cn_cred;
+ p = cnp->cn_proc;
+ flags = cnp->cn_flags;
+ wantparent = flags & (LOCKPARENT|WANTPARENT);