Lines Matching refs:vp
57 struct vnode *vp; in vn_cache_constructor() local
59 vp = buf; in vn_cache_constructor()
60 bzero(vp, sizeof (*vp)); in vn_cache_constructor()
62 mutex_init(&vp->v_lock, NULL, MUTEX_DEFAULT, NULL); in vn_cache_constructor()
63 vp->v_fd = -1; in vn_cache_constructor()
72 struct vnode *vp; in vn_cache_destructor() local
74 vp = buf; in vn_cache_destructor()
76 mutex_destroy(&vp->v_lock); in vn_cache_destructor()
84 vn_recycle(vnode_t *vp) in vn_recycle() argument
87 ASSERT(vp->v_fd == -1); in vn_recycle()
89 vp->v_rdcnt = 0; in vn_recycle()
90 vp->v_wrcnt = 0; in vn_recycle()
92 if (vp->v_path) { in vn_recycle()
93 strfree(vp->v_path); in vn_recycle()
94 vp->v_path = NULL; in vn_recycle()
110 vn_reinit(vnode_t *vp) in vn_reinit() argument
112 vp->v_count = 1; in vn_reinit()
113 vp->v_vfsp = NULL; in vn_reinit()
114 vp->v_stream = NULL; in vn_reinit()
115 vp->v_flag = 0; in vn_reinit()
116 vp->v_type = VNON; in vn_reinit()
117 vp->v_rdev = NODEV; in vn_reinit()
119 vn_recycle(vp); in vn_reinit()
125 vnode_t *vp; in vn_alloc() local
127 vp = kmem_cache_alloc(vn_cache, kmflag); in vn_alloc()
129 if (vp != NULL) { in vn_alloc()
130 vn_reinit(vp); in vn_alloc()
133 return (vp); in vn_alloc()
137 vn_free(vnode_t *vp) in vn_free() argument
145 ASSERT((vp->v_count == 0) || (vp->v_count == 1)); in vn_free()
146 if (vp->v_path != NULL) { in vn_free()
147 strfree(vp->v_path); in vn_free()
148 vp->v_path = NULL; in vn_free()
150 ASSERT(vp->v_fd != -1); in vn_free()
151 (void) close(vp->v_fd); in vn_free()
152 vp->v_fd = -1; in vn_free()
154 kmem_cache_free(vn_cache, vp); in vn_free()
181 vnode_t *vp; in vncache_lookup() local
187 vp = avl_find(&vncache_avl, &tmp_vn, NULL); in vncache_lookup()
188 if (vp != NULL) in vncache_lookup()
189 vn_hold(vp); in vncache_lookup()
192 return (vp); in vncache_lookup()
251 vncache_renamed(vnode_t *vp, vnode_t *to_dvp, char *to_name) in vncache_renamed() argument
264 ovpath = vp->v_path; in vncache_renamed()
265 vp->v_path = vpath; in vncache_renamed()
280 vncache_inactive(vnode_t *vp) in vncache_inactive() argument
285 mutex_enter(&vp->v_lock); in vncache_inactive()
287 if ((count = vp->v_count) <= 1) { in vncache_inactive()
289 avl_remove(&vncache_avl, vp); in vncache_inactive()
292 mutex_exit(&vp->v_lock); in vncache_inactive()
296 vn_free(vp); in vncache_inactive()