- ndp->ni_rdir = (struct vnode *)0;
-
- /*
- * Handle "..":
- * If this vnode is the root of the mounted
- * file system, then ignore it so can't get out
- */
- if (ndp->ni_isdotdot && (dp->v_flag & VROOT)) {
- ndp->ni_dvp = dp;
- ndp->ni_vp = dp;
- VREF(dp);
- goto nextname;
- }
-
- /*
- * We now have a segment name to search for, and a directory to search.
- */
- if (error = VOP_LOOKUP(dp, ndp)) {
- if (ndp->ni_vp != NULL)
- panic("leaf should be empty");
- /*
- * If creating and at end of pathname, then can consider
- * allowing file to be created.
- */
- if (ndp->ni_dvp->v_mount->m_flag & (M_RDONLY | M_EXRDONLY))
- error = EROFS;
- if (flag == LOOKUP || flag == DELETE || error != ENOENT)
- goto bad;
- /*
- * We return with ni_vp NULL to indicate that the entry
- * doesn't currently exist, leaving a pointer to the
- * (possibly locked) directory inode in ndp->ni_dvp.
- */
- return (0); /* should this be ENOENT? */
- }