Lines Matching refs:dp

108 static	void kdebug_lookup(struct vnode *dp, struct componentname *cnp);
115 int lookup_traverse_mountpoints(struct nameidata *ndp, struct componentname *cnp, vnode_t dp, int vbusyflags, vfs_context_t ctx);
117 int lookup_authorize_search(vnode_t dp, struct componentname *cnp, int dp_authorized_in_cache, vfs_context_t ctx);
119 int lookup_handle_rsrc_fork(vnode_t dp, struct nameidata *ndp, struct componentname *cnp, int wantparent, vfs_context_t ctx);
164 struct vnode *dp; /* the directory we are searching */
335 dp = ndp->ni_rootdir;
337 dp = ndp->ni_dvp;
338 ndp->ni_usedvp = dp;
340 dp = vfs_context_cwd(ctx);
342 if (dp == NULLVP || (dp->v_lflag & VL_DEAD)) {
350 ndp->ni_startdir = dp;
364 error = lookup_handle_symlink(ndp, &dp, ctx);
401 namei_compound_available(vnode_t dp, struct nameidata *ndp)
404 return vnode_compound_open_available(dp);
410 lookup_authorize_search(vnode_t dp, struct componentname *cnp, int dp_authorized_in_cache, vfs_context_t ctx)
415 error = vnode_authorize(dp, NULL, KAUTH_VNODE_SEARCH, ctx);
420 error = mac_vnode_check_lookup(ctx, dp, cnp);
474 lookup_handle_rsrc_fork(vnode_t dp, struct nameidata *ndp, struct componentname *cnp, int wantparent, vfs_context_t ctx)
480 if (dp->v_type != VREG) {
515 error = vnode_getnamedstream(dp, &svp, XATTR_RESOURCEFORK_NAME, nsop, 0, ctx);
535 ndp->ni_dvp = dp;
537 vnode_put(dp);
572 vnode_t dp;
576 dp = ndp->ni_vp;
588 if (dp->v_resolve) {
589 error = vnode_trigger_resolve(dp, ndp, ctx);
606 lookup_consider_update_cache(ndp->ni_dvp, dp, cnp, nc_generation);
614 error = lookup_traverse_mountpoints(ndp, cnp, dp, vbusyflags, ctx);
615 dp = ndp->ni_vp;
621 if (vfs_flags(vnode_mount(dp)) & MNT_MULTILABEL) {
622 error = vnode_label(vnode_mount(dp), NULL, dp, NULL, 0, ctx);
631 if ((dp->v_type == VLNK) &&
642 if (dp->v_type != VDIR) {
655 if (vnode_isshadow (dp)) {
701 * on both dp and ni_dvp, but for some reason
703 * need to do vnode_put on dp in 'bad2'
717 AUDIT_ARG(vnpath, dp, ARG_VNODE1);
719 AUDIT_ARG(vnpath, dp, ARG_VNODE2);
725 if ((cnp->cn_flags & CN_WANTSRSRCFORK) && (dp != NULLVP)) {
726 error = lookup_handle_rsrc_fork(dp, ndp, cnp, wantparent, ctx);
730 dp = ndp->ni_vp;
734 kdebug_lookup(dp, cnp);
755 vnode_t dp;
758 dp = ndp->ni_vp;
764 if (dp->v_type != VDIR) {
775 * on dp, but for some reason can't
777 * need to do vnode_put on dp in 'bad'
779 if ( (vnode_get(dp)) ) {
783 ndp->ni_dvp = dp;
788 ndp->ni_vp = dp;
791 AUDIT_ARG(vnpath, dp, ARG_VNODE1);
793 AUDIT_ARG(vnpath, dp, ARG_VNODE2);
861 vnode_t tdp; /* saved dp */
862 vnode_t dp; /* the directory we are searching */
888 dp = ndp->ni_startdir;
896 if ( (vnode_getwithref(dp)) ) {
897 dp = NULLVP;
901 ndp->ni_vp = dp;
913 if ( (error = cache_lookup_path(ndp, cnp, dp, ctx, &dp_authorized, last_dp)) ) {
914 dp = NULLVP;
923 dp = ndp->ni_dvp;
928 * we're guaranteed that the dp is a VDIR, it's
936 if (dp != NULLVP)
937 nc_generation = dp->v_nc_generation - 1;
954 if (dp == ndp->ni_rootdir || dp == rootvnode) {
955 ndp->ni_dvp = dp;
956 ndp->ni_vp = dp;
959 * we've already got one reference on 'dp'
965 if ( (vnode_get(dp)) ) {
972 if ((dp->v_flag & VROOT) == 0 ||
975 if (dp->v_mount == NULL) { /* forced umount */
979 tdp = dp;
980 dp = tdp->v_mount->mnt_vnodecovered;
984 if ( (vnode_getwithref(dp)) ) {
985 dp = NULLVP;
989 ndp->ni_dvp = dp;
1000 if (dp->v_type != VDIR) {
1005 error = lookup_authorize_search(dp, cnp, dp_authorized, ctx);
1016 if ((cnp->cn_flags & ISLASTCN) && namei_compound_available(dp, ndp) && !(cnp->cn_flags & CN_WANTSRSRCFORK)) {
1018 if ((cnp->cn_flags & ISLASTCN) && namei_compound_available(dp, ndp)) {
1021 ndp->ni_ncgeneration = dp->v_nc_generation;
1025 nc_generation = dp->v_nc_generation;
1027 error = VNOP_LOOKUP(dp, &ndp->ni_vp, cnp, ctx);
1033 (dp->v_flag & VROOT) && (dp->v_mount != NULL) &&
1034 (dp->v_mount->mnt_flag & MNT_UNION)) {
1038 unlock_fsnode(dp, NULL);
1041 tdp = dp;
1042 dp = tdp->v_mount->mnt_vnodecovered;
1046 if ( (vnode_getwithref(dp)) ) {
1047 dp = NULLVP;
1051 ndp->ni_dvp = dp;
1092 dp = ndp->ni_vp;
1095 if ((dp->v_type == VLNK) &&
1102 * cache_lookup_path is now responsible for dropping io ref on dp
1104 * a ref on dp until we complete the next round of lookup.
1106 last_dp = dp;
1126 kdebug_lookup(dp, cnp);
1136 if (dp)
1137 vnode_put(dp);
1141 kdebug_lookup(dp, cnp);
1168 lookup_traverse_mountpoints(struct nameidata *ndp, struct componentname *cnp, vnode_t dp,
1180 mounted_on_dp = dp;
1183 while ((dp->v_type == VDIR) && dp->v_mountedhere &&
1189 if (dp->v_resolve) {
1190 (void) vnode_trigger_resolve(dp, ndp, ctx);
1193 vnode_lock(dp);
1195 if ((dp->v_type == VDIR) && (mp = dp->v_mountedhere)) {
1198 vnode_unlock(dp);
1202 mount_dropcrossref(mp, dp, 0);
1231 mount_dropcrossref(mp, dp, 0);
1238 vnode_put(dp);
1239 ndp->ni_vp = dp = tdp;
1246 if (dp->v_resolve) {
1247 error = vnode_trigger_resolve(dp, ndp, ctx);
1255 vnode_unlock(dp);
1265 mp->mnt_realrootvp_vid = dp->v_id;
1266 mp->mnt_realrootvp = dp;
1292 vnode_t dp;
1367 dp = ndp->ni_dvp;
1386 if ((dp = ndp->ni_rootdir) == NULLVP) {
1391 *new_dp = dp;
1403 struct vnode *dp = NULL; /* the directory we are searching */
1425 dp = dvp;
1437 if (dp->v_type != VDIR) {
1441 if ( (vnode_get(dp)) ) {
1445 *vpp = dp;
1454 if ( (error = VNOP_LOOKUP(dp, vpp, cnp, ctx)) ) {
1476 dp = *vpp;
1482 if (dp->v_type == VLNK && (cnp->cn_flags & FOLLOW))
1499 vnode_put(dp);
1570 kdebug_lookup(struct vnode *dp, struct componentname *cnp)
1605 KERNEL_DEBUG_CONSTANT_IST(KDEBUG_TRACE, code, dp, dbg_parms[0], dbg_parms[1], dbg_parms[2], 0);
1618 kdebug_lookup(struct vnode *dp __unused, struct componentname *cnp __unused)