Lines Matching refs:fnp

4016 	nfs4_fname_t *fnp;  in fn_get()  local
4032 fnp = avl_find(&parent->fn_children, &key, &where); in fn_get()
4033 if (fnp != NULL) { in fn_get()
4038 fn_hold(fnp); in fn_get()
4040 if (fnp->fn_sfh == sfh) { in fn_get()
4046 return (fnp); in fn_get()
4056 mutex_enter(&fnp->fn_lock); in fn_get()
4057 if (fnp->fn_parent == parent) { in fn_get()
4063 avl_remove(&parent->fn_children, fnp); in fn_get()
4065 fn_rele(&fnp->fn_parent); in fn_get()
4067 mutex_exit(&fnp->fn_lock); in fn_get()
4068 fn_rele(&fnp); in fn_get()
4073 fnp = kmem_alloc(sizeof (nfs4_fname_t), KM_SLEEP); in fn_get()
4074 mutex_init(&fnp->fn_lock, NULL, MUTEX_DEFAULT, NULL); in fn_get()
4075 fnp->fn_parent = parent; in fn_get()
4078 fnp->fn_len = strlen(name); in fn_get()
4079 ASSERT(fnp->fn_len < MAXNAMELEN); in fn_get()
4080 fnp->fn_name = kmem_alloc(fnp->fn_len + 1, KM_SLEEP); in fn_get()
4081 (void) strcpy(fnp->fn_name, name); in fn_get()
4082 fnp->fn_refcnt = 1; in fn_get()
4089 fnp->fn_sfh = sfh; in fn_get()
4091 avl_create(&fnp->fn_children, fncmp, sizeof (nfs4_fname_t), in fn_get()
4095 (void *)fnp, fnp->fn_name)); in fn_get()
4097 avl_insert(&parent->fn_children, fnp, where); in fn_get()
4101 return (fnp); in fn_get()
4105 fn_hold(nfs4_fname_t *fnp) in fn_hold() argument
4107 atomic_inc_32(&fnp->fn_refcnt); in fn_hold()
4110 (void *)fnp, fnp->fn_name, fnp->fn_refcnt)); in fn_hold()
4123 nfs4_fname_t *fnp; in fn_rele() local
4126 fnp = *fnpp; in fn_rele()
4129 mutex_enter(&fnp->fn_lock); in fn_rele()
4130 parent = fnp->fn_parent; in fn_rele()
4133 newref = atomic_dec_32_nv(&fnp->fn_refcnt); in fn_rele()
4137 (void *)fnp, fnp->fn_name, fnp->fn_refcnt)); in fn_rele()
4140 mutex_exit(&fnp->fn_lock); in fn_rele()
4146 (void *)fnp, fnp->fn_name)); in fn_rele()
4148 avl_remove(&parent->fn_children, fnp); in fn_rele()
4151 kmem_free(fnp->fn_name, fnp->fn_len + 1); in fn_rele()
4152 sfh4_rele(&fnp->fn_sfh); in fn_rele()
4153 mutex_destroy(&fnp->fn_lock); in fn_rele()
4154 avl_destroy(&fnp->fn_children); in fn_rele()
4155 kmem_free(fnp, sizeof (nfs4_fname_t)); in fn_rele()
4173 fn_name(nfs4_fname_t *fnp) in fn_name() argument
4177 ASSERT(fnp->fn_len < MAXNAMELEN); in fn_name()
4179 mutex_enter(&fnp->fn_lock); in fn_name()
4180 (void) strcpy(name, fnp->fn_name); in fn_name()
4181 mutex_exit(&fnp->fn_lock); in fn_name()
4232 fn_path(nfs4_fname_t *fnp) in fn_path() argument
4237 if (fnp == NULL) in fn_path()
4244 fn_hold(fnp); /* adjust for later rele */ in fn_path()
4246 mutex_enter(&fnp->fn_lock); in fn_path()
4250 fn_path_realloc(&path, fnp->fn_name); in fn_path()
4251 nextfnp = fnp->fn_parent; in fn_path()
4254 mutex_exit(&fnp->fn_lock); in fn_path()
4255 fn_rele(&fnp); in fn_path()
4256 fnp = nextfnp; in fn_path()
4257 } while (fnp != NULL); in fn_path()
4268 fn_parent(nfs4_fname_t *fnp) in fn_parent() argument
4272 mutex_enter(&fnp->fn_lock); in fn_parent()
4273 parent = fnp->fn_parent; in fn_parent()
4276 mutex_exit(&fnp->fn_lock); in fn_parent()
4286 fn_move(nfs4_fname_t *fnp, nfs4_fname_t *newparent, char *newname) in fn_move() argument
4304 ASSERT(fnp != newparent); in fn_move()
4313 mutex_enter(&fnp->fn_lock); in fn_move()
4314 parent = fnp->fn_parent; in fn_move()
4317 avl_remove(&parent->fn_children, fnp); in fn_move()
4319 fn_rele(&fnp->fn_parent); in fn_move()
4323 if (newlen != fnp->fn_len) { in fn_move()
4325 kmem_free(fnp->fn_name, fnp->fn_len + 1); in fn_move()
4326 fnp->fn_name = kmem_alloc(newlen + 1, KM_SLEEP); in fn_move()
4327 fnp->fn_len = newlen; in fn_move()
4329 (void) strcpy(fnp->fn_name, newname); in fn_move()
4333 key.fn_name = fnp->fn_name; in fn_move()
4356 fnp->fn_parent = newparent; in fn_move()
4358 avl_insert(&newparent->fn_children, fnp, where); in fn_move()
4360 mutex_exit(&fnp->fn_lock); in fn_move()