Lines Matching defs:searchdir
727 * Updates searchdir. inhibitmagic causes magic symlinks to not be
734 struct vnode *searchdir, struct vnode *foundobj,
812 vrele(searchdir);
814 searchdir = ndp->ni_erootdir;
815 if (searchdir == NULL ||
820 searchdir = ndp->ni_rootdir;
822 vref(searchdir);
829 *newsearchdir_ret = searchdir;
839 lookup_parsepath(struct namei_state *state, struct vnode *searchdir)
859 error = VOP_PARSEPATH(searchdir, cnp->cn_nameptr, &cnp->cn_namelen);
917 * vrele'd, but searchdir is left alone.
927 struct vnode *searchdir;
931 searchdir = *searchdir_ret;
937 /* First, unlock searchdir (oof). */
939 KASSERT(searchdir != NULL);
940 lktype = VOP_ISLOCKED(searchdir);
941 VOP_UNLOCK(searchdir);
1009 * In this case set searchdir to null to avoid using
1010 * it again. It is not correct to set searchdir ==
1014 if (searchdir == NULL) {
1017 vrele(searchdir);
1018 *searchdir_ret = searchdir = NULL;
1023 /* If searchdir is still around, re-lock it. */
1025 vn_lock(searchdir, lktype | LK_RETRY);
1036 lookup_lktype(struct vnode *searchdir, struct componentname *cnp)
1046 if ((searchdir->v_mount->mnt_iflag & IMNT_SHRLOOKUP) != 0 &&
1060 * searchdir was unlocked and released. This happens in the common case
1068 struct vnode *searchdir,
1083 *newsearchdir_ret = searchdir;
1103 if (searchdir == ndp->ni_rootdir ||
1104 searchdir == rootvnode) {
1105 foundobj = searchdir;
1109 lktype = lookup_lktype(searchdir, cnp);
1110 vn_lock(searchdir, lktype | LK_RETRY);
1119 retval = vn_isunder(searchdir, ndp->ni_rootdir,
1130 vrele(searchdir);
1131 searchdir = NULL;
1141 if ((searchdir->v_vflag & VV_ROOT) == 0 ||
1144 tmpvn = searchdir;
1145 searchdir = searchdir->v_mount->mnt_vnodecovered;
1146 vref(searchdir);
1148 *newsearchdir_ret = searchdir;
1152 lktype = lookup_lktype(searchdir, cnp);
1156 * Our vnode state here is that "searchdir" is held.
1161 vn_lock(searchdir, lktype | LK_RETRY);
1164 error = VOP_LOOKUP(searchdir, &foundobj, cnp);
1180 KASSERT(VOP_ISLOCKED(searchdir) == LK_SHARED);
1182 if (vn_lock(searchdir, LK_UPGRADE | LK_NOWAIT)) {
1183 VOP_UNLOCK(searchdir);
1191 (searchdir->v_vflag & VV_ROOT) &&
1192 (searchdir->v_mount->mnt_flag & MNT_UNION)) {
1193 tmpvn = searchdir;
1194 searchdir = searchdir->v_mount->mnt_vnodecovered;
1195 vref(searchdir);
1198 *newsearchdir_ret = searchdir;
1228 * as searchdir.
1239 if (searchdir != NULL) {
1243 VOP_UNLOCK(searchdir);
1274 struct vnode *foundobj, *searchdir;
1286 searchdir = *searchdir_ret;
1300 if ((error = lookup_parsepath(state, searchdir)) != 0) {
1309 if ((searchdir->v_vflag & VV_ROOT) != 0 &&
1322 * searchdir locked and VOP_LOOKUP() called (which can and
1340 if (!cache_lookup_linked(searchdir, cnp->cn_nameptr,
1354 if ((searchdir->v_vflag & VV_ROOT) != 0 &&
1355 (searchdir->v_mount->mnt_flag & MNT_UNION) != 0) {
1402 searchdir = NULL;
1427 searchdir = foundobj;
1442 } else if (searchdir != *searchdir_ret) {
1446 * namecache's lock. The lock prevents both searchdir and
1448 * searchdir, we have a bit of a problem. Roll back the
1452 if (searchdir == NULL) {
1454 * It's possible for searchdir to be NULL in the
1460 error2 = vcache_tryvget(searchdir);
1465 /* Returning new searchdir, and maybe new foundobj. */
1467 *searchdir_ret = searchdir;
1503 struct vnode *searchdir, *foundobj;
1507 error = namei_start(state, isnfsd, &searchdir);
1513 KASSERT(searchdir->v_type == VDIR);
1535 foundobj = searchdir;
1536 searchdir = NULL;
1544 KASSERT(searchdir != NULL);
1553 error = lookup_fastforward(state, &searchdir, &foundobj);
1560 error = lookup_once(state, searchdir, &searchdir,
1567 * an error, it will dispose of foundobj, but searchdir is
1574 error = lookup_crossmount(state, &searchdir,
1579 if (searchdir != NULL) {
1582 vput(searchdir);
1584 vrele(searchdir);
1610 /* lookup_once can't have dropped the searchdir */
1611 KASSERT(searchdir != NULL ||
1623 /* Don't need searchdir locked any more. */
1626 VOP_UNLOCK(searchdir);
1632 } else if (searchdir == NULL) {
1635 * drops searchdir if it crossed a
1641 * using the pre-crossing searchdir
1663 searchdir, foundobj,
1664 &searchdir);
1667 KASSERT(searchdir != foundobj);
1668 if (searchdir != NULL) {
1669 vrele(searchdir);
1683 * is the searchdir.
1686 KASSERT(searchdir != NULL);
1687 foundobj = searchdir;
1688 searchdir = NULL;
1704 KASSERT(foundobj != searchdir);
1705 if (searchdir) {
1708 vput(searchdir);
1710 vrele(searchdir);
1733 if (searchdir != NULL) {
1736 vput(searchdir);
1738 vrele(searchdir);
1741 searchdir = foundobj;
1745 KASSERT((cnp->cn_flags & LOCKPARENT) == 0 || searchdir == NULL ||
1746 VOP_ISLOCKED(searchdir) == LK_EXCLUSIVE);
1758 if (searchdir != NULL) {
1760 vput(searchdir);
1763 vrele(searchdir);
1765 searchdir = NULL;
1781 * it doesn't actually need or use the searchdir, so
1787 * searchdir, except not crash if it's null.) This is
1801 (searchdir == NULL ||
1802 searchdir->v_mount != foundobj->v_mount) &&
1804 if (searchdir) {
1806 vput(searchdir);
1809 vrele(searchdir);
1811 searchdir = NULL;
1837 if (searchdir) {
1839 vput(searchdir);
1842 vrele(searchdir);
1844 searchdir = NULL;
1856 searchdir == foundobj) {
1859 * set, and searchdir == foundobj, this code
1869 VOP_UNLOCK(searchdir);
1872 (searchdir != foundobj ||
1887 if ((cnp->cn_flags & LOCKPARENT) == 0 && searchdir != NULL) {
1888 vrele(searchdir);
1889 searchdir = NULL;
1892 ndp->ni_dvp = searchdir;
2077 * dispose of foundobj, but searchdir is untouched.