Lines Matching defs:anp
75 struct autofs_node *anp;
81 anp = vp->v_data;
93 if (autofs_mount_on_stat && autofs_cached(anp, NULL, 0) == false &&
114 vap->va_fileid = anp->an_fileno;
117 vap->va_mtime = anp->an_ctime;
118 vap->va_atime = anp->an_ctime;
119 vap->va_ctime = anp->an_ctime;
120 vap->va_birthtime = anp->an_ctime;
140 struct autofs_node *anp;
144 anp = vp->v_data;
167 error = autofs_trigger(anp, path, pathlen);
190 anp->an_cached = false;
217 struct autofs_node *anp, *child;
225 anp = dvp->v_data;
229 KASSERT(anp->an_parent != NULL, ("NULL parent"));
238 anp->an_parent, cnp->cn_lkflags, vpp);
254 if (autofs_cached(anp, cnp->cn_nameptr, cnp->cn_namelen) == false &&
273 error = autofs_node_find(anp, cnp->cn_nameptr, cnp->cn_namelen, &child);
304 struct autofs_node *anp;
310 anp = vp->v_data;
321 error = autofs_node_new(anp, amp, ap->a_cnp->cn_nameptr,
385 struct autofs_node *anp, *child;
393 anp = vp->v_data;
399 if (autofs_cached(anp, NULL, 0) == false &&
425 error = autofs_readdir_one(uio, ".", anp->an_fileno, &reclen);
437 if (anp->an_parent == NULL) {
439 anp->an_fileno, &reclen);
442 anp->an_parent->an_fileno, &reclen);
454 RB_FOREACH(child, autofs_node_tree, &anp->an_children) {
507 struct autofs_node *anp;
510 anp = vp->v_data;
516 sx_xlock(&anp->an_vnode_lock);
517 anp->an_vnode = NULL;
519 sx_xunlock(&anp->an_vnode_lock);
549 struct autofs_node *anp;
558 anp = uma_zalloc(autofs_node_zone, M_WAITOK | M_ZERO);
560 anp->an_name = strndup(name, namelen, M_AUTOFS);
562 anp->an_name = strdup(name, M_AUTOFS);
563 anp->an_fileno = atomic_fetchadd_int(&->am_last_fileno, 1);
564 callout_init(&anp->an_callout, 1);
574 sx_init_flags(&anp->an_vnode_lock, "autofsvlk", SX_NOWITNESS);
575 getnanotime(&anp->an_ctime);
576 anp->an_parent = parent;
577 anp->an_mount = amp;
579 RB_INSERT(autofs_node_tree, &parent->an_children, anp);
580 RB_INIT(&anp->an_children);
582 *anpp = anp;
590 struct autofs_node *anp, find;
600 anp = RB_FIND(autofs_node_tree, &parent->an_children, &find);
601 if (anp != NULL) {
604 *anpp = anp;
615 autofs_node_delete(struct autofs_node *anp)
619 AUTOFS_ASSERT_XLOCKED(anp->an_mount);
620 KASSERT(RB_EMPTY(&anp->an_children), ("have children"));
622 callout_drain(&anp->an_callout);
624 parent = anp->an_parent;
626 RB_REMOVE(autofs_node_tree, &parent->an_children, anp);
627 sx_destroy(&anp->an_vnode_lock);
628 free(anp->an_name, M_AUTOFS);
629 uma_zfree(autofs_node_zone, anp);
633 autofs_node_vn(struct autofs_node *anp, struct mount *mp, int flags,
639 AUTOFS_ASSERT_UNLOCKED(anp->an_mount);
641 sx_xlock(&anp->an_vnode_lock);
643 vp = anp->an_vnode;
648 sx_xunlock(&anp->an_vnode_lock);
656 sx_xunlock(&anp->an_vnode_lock);
663 sx_xunlock(&anp->an_vnode_lock);
669 sx_xunlock(&anp->an_vnode_lock);
675 sx_xunlock(&anp->an_vnode_lock);
681 if (anp->an_parent == NULL)
683 vp->v_data = anp;
690 sx_xunlock(&anp->an_vnode_lock);
694 KASSERT(anp->an_vnode == NULL, ("lost race"));
695 anp->an_vnode = vp;
697 sx_xunlock(&anp->an_vnode_lock);