+ ndp->ni_dvp = NULL;
+ flag = ndp->ni_nameiop & OPFLAG;
+ wantparent = ndp->ni_nameiop & (LOCKPARENT|WANTPARENT);
+ lockparent = ndp->ni_nameiop & LOCKPARENT;
+ docache = (ndp->ni_nameiop & NOCACHE) ^ NOCACHE;
+ getbuf = (ndp->ni_nameiop & HASBUF) ^ HASBUF;
+ if (flag == DELETE || wantparent)
+ docache = 0;
+ rdonly = MNT_RDONLY;
+ if (ndp->ni_nameiop & REMOTE)
+ rdonly |= MNT_EXRDONLY;
+ /*
+ * Get a buffer for the name to be translated, and copy the
+ * name into the buffer.
+ */
+ if (getbuf) {
+ MALLOC(ndp->ni_pnbuf, caddr_t, MAXPATHLEN, M_NAMEI, M_WAITOK);
+ if (ndp->ni_segflg == UIO_SYSSPACE)
+ error = copystr(ndp->ni_dirp, ndp->ni_pnbuf,
+ MAXPATHLEN, &ndp->ni_pathlen);
+ else
+ error = copyinstr(ndp->ni_dirp, ndp->ni_pnbuf,
+ MAXPATHLEN, &ndp->ni_pathlen);
+ if (error) {
+ free(ndp->ni_pnbuf, M_NAMEI);
+ ndp->ni_vp = NULL;
+ return (error);
+ }
+ ndp->ni_ptr = ndp->ni_pnbuf;
+ }
+ ndp->ni_loopcnt = 0;
+ dp = ndp->ni_cdir;
+ VREF(dp);
+#ifdef KTRACE
+ if (KTRPOINT(u.u_procp, KTR_NAMEI))
+ ktrnamei(u.u_procp->p_tracep, ndp->ni_pnbuf);
+#endif