Lines Matching defs:ndp

155 vn_open(struct nameidata *ndp, int fmode, int cmode)
157 return(vn_open_modflags(ndp, &fmode, cmode));
161 vn_open_modflags(struct nameidata *ndp, int *fmodep, int cmode)
168 return(vn_open_auth(ndp, fmodep, &va));
201 vn_open_auth_do_create(struct nameidata *ndp, struct vnode_attr *vap, int fmode, boolean_t *did_create, boolean_t *did_open, vfs_context_t ctx)
204 vnode_t dvp = ndp->ni_dvp;
209 batched = vnode_compound_open_available(ndp->ni_dvp);
217 if (ndp->ni_cnd.cn_flags & CN_WANTSRSRCFORK) {
218 if ((error = vn_authorize_create(dvp, &ndp->ni_cnd, vap, ctx, NULL)) != 0)
220 if ((error = vnode_makenamedstream(dvp, &ndp->ni_vp, XATTR_RESOURCEFORK_NAME, 0, ctx)) != 0)
226 if ((error = vn_authorize_create(dvp, &ndp->ni_cnd, vap, ctx, NULL)) != 0)
230 error = vn_create(dvp, &ndp->ni_vp, ndp, vap, VN_CREATE_DOOPEN, fmode, &status, ctx);
245 if ((ndp->ni_flag & NAMEI_CONTLOOKUP) == 0) {
271 vp = ndp->ni_vp;
272 namei_unlock_fsnode(ndp);
284 vnode_update_identity(vp, dvp, ndp->ni_cnd.cn_nameptr, ndp->ni_cnd.cn_namelen, ndp->ni_cnd.cn_hash, update_flags);
287 ndp->ni_dvp = NULLVP;
298 if (ndp->ni_dvp != NULLVP) {
300 ndp->ni_dvp = NULLVP;
308 * pointed to by ndp, fmodep, and vap as necessary to perform the requested
312 * Parameters: ndp The nami data pointer describing the
328 * The contents of '*ndp' will be modified, based on the other
352 vn_open_auth(struct nameidata *ndp, int *fmodep, struct vnode_attr *vap)
356 vfs_context_t ctx = ndp->ni_cnd.cn_context;
374 origcnflags = ndp->ni_cnd.cn_flags;
384 ndp->ni_cnd.cn_nameiop = CREATE;
386 ndp->ni_op = OP_LINK;
389 ndp->ni_cnd.cn_flags &= (USEDVP | NOCROSSMOUNT | DOWHITEOUT);
390 ndp->ni_cnd.cn_flags |= LOCKPARENT | LOCKLEAF | AUDITVNPATH1;
391 ndp->ni_flag = NAMEI_COMPOUNDOPEN;
394 ndp->ni_cnd.cn_flags |= CN_ALLOWRSRCFORK;
397 ndp->ni_cnd.cn_flags |= FOLLOW;
400 if ( (error = namei(ndp)) )
403 dvp = ndp->ni_dvp;
404 vp = ndp->ni_vp;
420 error = vn_open_auth_do_create(ndp, vap, fmode, &did_create, &did_open, ctx);
422 dvp = ndp->ni_dvp;
423 vp = ndp->ni_vp;
436 nameidone(ndp);
467 error = VNOP_COMPOUND_OPEN(dvp, &ndp->ni_vp, ndp, 0, fmode, NULL, NULL, ctx);
470 vp = ndp->ni_vp;
473 if ((ndp->ni_flag & NAMEI_CONTLOOKUP) == 0) {
479 nameidone(ndp);
481 ndp->ni_dvp = NULLVP;
495 ndp->ni_cnd.cn_nameiop = LOOKUP;
497 ndp->ni_cnd.cn_flags &= (USEDVP | NOCROSSMOUNT | DOWHITEOUT);
498 ndp->ni_cnd.cn_flags |= FOLLOW | LOCKLEAF | AUDITVNPATH1 | WANTPARENT;
501 ndp->ni_cnd.cn_flags |= CN_ALLOWRSRCFORK;
503 ndp->ni_flag = NAMEI_COMPOUNDOPEN;
507 ndp->ni_cnd.cn_flags &= ~FOLLOW;
512 if ( (error = namei(ndp)) )
514 vp = ndp->ni_vp;
515 dvp = ndp->ni_dvp;
520 error = VNOP_COMPOUND_OPEN(dvp, &ndp->ni_vp, ndp, 0, fmode, NULL, NULL, ctx);
521 vp = ndp->ni_vp;
525 if ((ndp->ni_flag & NAMEI_CONTLOOKUP) == 0) {
532 nameidone(ndp);
534 ndp->ni_dvp = NULLVP;
545 if (ndp->ni_dvp != NULLVP) {
560 error = vn_authorize_open_existing(vp, &ndp->ni_cnd, fmode, ctx, NULL);
626 ndp->ni_vp = NULL;