Lines Matching defs:a_vp
725 * a_dvp -> a_vp -> b_dvp -> b_vp,
727 * except if a_vp is a nondirectory in which case the lock order is:
729 * a_dvp -> b_dvp -> b_vp -> a_vp,
731 * which can't violate ancestor->descendant because a_vp has no
733 * file systems can only lookup/lock/unlock, and we can't hold a_vp
757 * . the only pair of vnodes that may be identical is a_vp and b_vp.
760 * *a_vp, *b_dirent_ret, and *b_vp are left alone.
771 struct vnode *a_vp, *b_vp;
804 * 2. Lookup a_vp. May lock/unlock a_vp.
806 error = ops->gro_lookup(mp, a_dvp, a_cnp, a_de_ret, &a_vp);
809 a_vp = NULL;
813 KASSERT(a_vp != NULL);
816 if (a_vp == a_dvp) {
822 if (a_vp == b_dvp) {
828 KASSERT(a_vp != a_dvp);
829 KASSERT(a_vp != b_dvp);
832 * 3. Lock a_vp, if it is a directory.
834 * We already ruled out a_vp == a_dvp (i.e., a_cnp is `.'), so
836 * a_vp == b_dvp, so this won't cause subsequent locking of
839 * If a_vp is a nondirectory, we can't hold it when we lookup
841 * and (b) b_vp turns out to be the same file as a_vp due to
843 * we've looked up b_vp. Fortunately, if a_vp is a
847 if (a_vp != NULL && a_vp->v_type == VDIR) {
848 vn_lock(a_vp, LK_EXCLUSIVE | LK_RETRY);
849 KASSERT(a_vp->v_mount == mp);
851 if (a_vp->v_mountedhere != NULL) {
890 * find b_dvp/b_vp=a_dvp/a_vp something is wrong.
906 * 6. Lock a_vp, if it is a nondirectory.
908 * In this case a_vp is a leaf, so it is either equal to or
912 if (a_vp != NULL && a_vp->v_type != VDIR) {
913 vn_lock(a_vp, LK_EXCLUSIVE | LK_RETRY);
914 KASSERT(a_vp->v_mount == mp);
919 * 7. Lock b_vp, if it is not a_vp.
921 * b_vp and a_vp may the same inode if they are hard links to
924 if ((b_vp != NULL) && (b_vp != a_vp)) {
936 KASSERT(a_missing_ok || (a_vp != NULL));
938 KASSERT((a_vp == NULL) || (VOP_ISLOCKED(a_vp) == LK_EXCLUSIVE));
941 *a_vp_ret = a_vp;
945 fail6: if ((b_vp != NULL) && (b_vp != a_vp))
947 if (a_vp != NULL && a_vp->v_type != VDIR)
948 VOP_UNLOCK(a_vp);
952 fail3: if (a_vp != NULL && a_vp->v_type == VDIR)
953 VOP_UNLOCK(a_vp);
954 fail2: if (a_vp != NULL)
955 vrele(a_vp);