Lines Matching defs:searchdir

716  * Updates searchdir. inhibitmagic causes magic symlinks to not be
723 struct vnode *searchdir, struct vnode *foundobj,
801 vrele(searchdir);
803 searchdir = ndp->ni_erootdir;
804 if (searchdir == NULL ||
809 searchdir = ndp->ni_rootdir;
811 vref(searchdir);
818 *newsearchdir_ret = searchdir;
828 lookup_parsepath(struct namei_state *state, struct vnode *searchdir)
849 error = VOP_PARSEPATH(searchdir, cnp->cn_nameptr, &cnp->cn_namelen);
907 * vrele'd, but searchdir is left alone.
917 struct vnode *searchdir;
921 searchdir = *searchdir_ret;
927 /* First, unlock searchdir (oof). */
929 KASSERT(searchdir != NULL);
930 lktype = VOP_ISLOCKED(searchdir);
931 VOP_UNLOCK(searchdir);
997 * In this case set searchdir to null to avoid using
998 * it again. It is not correct to set searchdir ==
1002 if (searchdir == NULL) {
1005 vrele(searchdir);
1006 *searchdir_ret = searchdir = NULL;
1011 /* If searchdir is still around, re-lock it. */
1013 vn_lock(searchdir, lktype | LK_RETRY);
1024 lookup_lktype(struct vnode *searchdir, struct componentname *cnp)
1034 if ((searchdir->v_mount->mnt_iflag & IMNT_SHRLOOKUP) != 0 &&
1048 * searchdir was unlocked and released. This happens in the common case
1056 struct vnode *searchdir,
1071 *newsearchdir_ret = searchdir;
1091 if (searchdir == ndp->ni_rootdir ||
1092 searchdir == rootvnode) {
1093 foundobj = searchdir;
1097 lktype = lookup_lktype(searchdir, cnp);
1098 vn_lock(searchdir, lktype | LK_RETRY);
1107 retval = vn_isunder(searchdir, ndp->ni_rootdir, l);
1116 vrele(searchdir);
1117 searchdir = NULL;
1127 if ((searchdir->v_vflag & VV_ROOT) == 0 ||
1130 tmpvn = searchdir;
1131 searchdir = searchdir->v_mount->mnt_vnodecovered;
1132 vref(searchdir);
1134 *newsearchdir_ret = searchdir;
1138 lktype = lookup_lktype(searchdir, cnp);
1142 * Our vnode state here is that "searchdir" is held.
1147 vn_lock(searchdir, lktype | LK_RETRY);
1150 error = VOP_LOOKUP(searchdir, &foundobj, cnp);
1166 KASSERT(VOP_ISLOCKED(searchdir) == LK_SHARED);
1168 if (vn_lock(searchdir, LK_UPGRADE | LK_NOWAIT)) {
1169 VOP_UNLOCK(searchdir);
1177 (searchdir->v_vflag & VV_ROOT) &&
1178 (searchdir->v_mount->mnt_flag & MNT_UNION)) {
1179 tmpvn = searchdir;
1180 searchdir = searchdir->v_mount->mnt_vnodecovered;
1181 vref(searchdir);
1184 *newsearchdir_ret = searchdir;
1214 * as searchdir.
1225 if (searchdir != NULL) {
1229 VOP_UNLOCK(searchdir);
1260 struct vnode *foundobj, *searchdir;
1272 searchdir = *searchdir_ret;
1286 if ((error = lookup_parsepath(state, searchdir)) != 0) {
1295 if ((searchdir->v_vflag & VV_ROOT) != 0 &&
1308 * searchdir locked and VOP_LOOKUP() called (which can and
1326 if (!cache_lookup_linked(searchdir, cnp->cn_nameptr,
1340 if ((searchdir->v_vflag & VV_ROOT) != 0 &&
1341 (searchdir->v_mount->mnt_flag & MNT_UNION) != 0) {
1388 searchdir = NULL;
1413 searchdir = foundobj;
1428 } else if (searchdir != *searchdir_ret) {
1432 * namecache's lock. The lock prevents both searchdir and
1434 * searchdir, we have a bit of a problem. Roll back the
1438 if (searchdir == NULL) {
1440 * It's possible for searchdir to be NULL in the
1446 error2 = vcache_tryvget(searchdir);
1451 /* Returning new searchdir, and maybe new foundobj. */
1453 *searchdir_ret = searchdir;
1489 struct vnode *searchdir, *foundobj;
1493 error = namei_start(state, isnfsd, &searchdir);
1499 KASSERT(searchdir->v_type == VDIR);
1521 foundobj = searchdir;
1522 searchdir = NULL;
1530 KASSERT(searchdir != NULL);
1539 error = lookup_fastforward(state, &searchdir, &foundobj);
1546 error = lookup_once(state, searchdir, &searchdir,
1553 * an error, it will dispose of foundobj, but searchdir is
1560 error = lookup_crossmount(state, &searchdir,
1565 if (searchdir != NULL) {
1568 vput(searchdir);
1570 vrele(searchdir);
1596 /* lookup_once can't have dropped the searchdir */
1597 KASSERT(searchdir != NULL ||
1609 /* Don't need searchdir locked any more. */
1612 VOP_UNLOCK(searchdir);
1618 } else if (searchdir == NULL) {
1621 * drops searchdir if it crossed a
1627 * using the pre-crossing searchdir
1649 searchdir, foundobj,
1650 &searchdir);
1653 KASSERT(searchdir != foundobj);
1654 if (searchdir != NULL) {
1655 vrele(searchdir);
1669 * is the searchdir.
1672 KASSERT(searchdir != NULL);
1673 foundobj = searchdir;
1674 searchdir = NULL;
1690 KASSERT(foundobj != searchdir);
1691 if (searchdir) {
1694 vput(searchdir);
1696 vrele(searchdir);
1719 if (searchdir != NULL) {
1722 vput(searchdir);
1724 vrele(searchdir);
1727 searchdir = foundobj;
1731 KASSERT((cnp->cn_flags & LOCKPARENT) == 0 || searchdir == NULL ||
1732 VOP_ISLOCKED(searchdir) == LK_EXCLUSIVE);
1745 if (searchdir != NULL) {
1747 vput(searchdir);
1750 vrele(searchdir);
1752 searchdir = NULL;
1768 * it doesn't actually need or use the searchdir, so
1774 * searchdir, except not crash if it's null.) This is
1788 (searchdir == NULL ||
1789 searchdir->v_mount != foundobj->v_mount) &&
1791 if (searchdir) {
1793 vput(searchdir);
1796 vrele(searchdir);
1798 searchdir = NULL;
1824 if (searchdir) {
1826 vput(searchdir);
1829 vrele(searchdir);
1831 searchdir = NULL;
1843 searchdir == foundobj) {
1846 * set, and searchdir == foundobj, this code
1856 VOP_UNLOCK(searchdir);
1859 (searchdir != foundobj ||
1874 if ((cnp->cn_flags & LOCKPARENT) == 0 && searchdir != NULL) {
1875 vrele(searchdir);
1876 searchdir = NULL;
1879 ndp->ni_dvp = searchdir;
2065 * dispose of foundobj, but searchdir is untouched.