Lines Matching defs:fnp

4032 	nfs4_fname_t *fnp;
4048 fnp = avl_find(&parent->fn_children, &key, &where);
4049 if (fnp != NULL) {
4051 * This hold on fnp is released below later,
4052 * in case this is not the fnp we want.
4054 fn_hold(fnp);
4056 if (fnp->fn_sfh == sfh) {
4062 return (fnp);
4072 mutex_enter(&fnp->fn_lock);
4073 if (fnp->fn_parent == parent) {
4079 avl_remove(&parent->fn_children, fnp);
4081 fn_rele(&fnp->fn_parent);
4083 mutex_exit(&fnp->fn_lock);
4084 fn_rele(&fnp);
4089 fnp = kmem_alloc(sizeof (nfs4_fname_t), KM_SLEEP);
4090 mutex_init(&fnp->fn_lock, NULL, MUTEX_DEFAULT, NULL);
4091 fnp->fn_parent = parent;
4094 fnp->fn_len = strlen(name);
4095 ASSERT(fnp->fn_len < MAXNAMELEN);
4096 fnp->fn_name = kmem_alloc(fnp->fn_len + 1, KM_SLEEP);
4097 (void) strcpy(fnp->fn_name, name);
4098 fnp->fn_refcnt = 1;
4105 fnp->fn_sfh = sfh;
4107 avl_create(&fnp->fn_children, fncmp, sizeof (nfs4_fname_t),
4111 (void *)fnp, fnp->fn_name));
4113 avl_insert(&parent->fn_children, fnp, where);
4117 return (fnp);
4121 fn_hold(nfs4_fname_t *fnp)
4123 atomic_inc_32(&fnp->fn_refcnt);
4126 (void *)fnp, fnp->fn_name, fnp->fn_refcnt));
4139 nfs4_fname_t *fnp;
4142 fnp = *fnpp;
4145 mutex_enter(&fnp->fn_lock);
4146 parent = fnp->fn_parent;
4149 newref = atomic_dec_32_nv(&fnp->fn_refcnt);
4153 (void *)fnp, fnp->fn_name, fnp->fn_refcnt));
4156 mutex_exit(&fnp->fn_lock);
4162 (void *)fnp, fnp->fn_name));
4164 avl_remove(&parent->fn_children, fnp);
4167 kmem_free(fnp->fn_name, fnp->fn_len + 1);
4168 sfh4_rele(&fnp->fn_sfh);
4169 mutex_destroy(&fnp->fn_lock);
4170 avl_destroy(&fnp->fn_children);
4171 kmem_free(fnp, sizeof (nfs4_fname_t));
4189 fn_name(nfs4_fname_t *fnp)
4193 ASSERT(fnp->fn_len < MAXNAMELEN);
4195 mutex_enter(&fnp->fn_lock);
4196 (void) strcpy(name, fnp->fn_name);
4197 mutex_exit(&fnp->fn_lock);
4248 fn_path(nfs4_fname_t *fnp)
4253 if (fnp == NULL)
4260 fn_hold(fnp); /* adjust for later rele */
4262 mutex_enter(&fnp->fn_lock);
4266 fn_path_realloc(&path, fnp->fn_name);
4267 nextfnp = fnp->fn_parent;
4270 mutex_exit(&fnp->fn_lock);
4271 fn_rele(&fnp);
4272 fnp = nextfnp;
4273 } while (fnp != NULL);
4284 fn_parent(nfs4_fname_t *fnp)
4288 mutex_enter(&fnp->fn_lock);
4289 parent = fnp->fn_parent;
4292 mutex_exit(&fnp->fn_lock);
4298 * Update fnp so that its parent is newparent and its name is newname.
4302 fn_move(nfs4_fname_t *fnp, nfs4_fname_t *newparent, char *newname)
4320 ASSERT(fnp != newparent);
4323 * Remove fnp from its current parent, change its name, then add it
4324 * to newparent. It might happen that fnp was replaced by another
4326 * In such case, fnp->fn_parent is NULL and we skip the removal
4327 * of fnp from its current parent.
4329 mutex_enter(&fnp->fn_lock);
4330 parent = fnp->fn_parent;
4333 avl_remove(&parent->fn_children, fnp);
4335 fn_rele(&fnp->fn_parent);
4339 if (newlen != fnp->fn_len) {
4341 kmem_free(fnp->fn_name, fnp->fn_len + 1);
4342 fnp->fn_name = kmem_alloc(newlen + 1, KM_SLEEP);
4343 fnp->fn_len = newlen;
4345 (void) strcpy(fnp->fn_name, newname);
4349 key.fn_name = fnp->fn_name;
4372 fnp->fn_parent = newparent;
4374 avl_insert(&newparent->fn_children, fnp, where);
4376 mutex_exit(&fnp->fn_lock);