Lines Matching refs:vsd

107  * forward declarations for internal vnode specific data (vsd)
127 * Callers are responsible for protecting the vsd by holding v_vsd_lock
133 * vsd_nkeys - creation and deletion of vsd keys
4345 struct vsd_node *vsd;
4364 for (vsd = list_head(vsd_list); vsd != NULL;
4365 vsd = list_next(vsd_list, vsd)) {
4369 if (key > vsd->vs_nkeys)
4374 if (vsd->vs_value[k] && vsd_destructor[k])
4375 (*vsd_destructor[k])(vsd->vs_value[k]);
4379 vsd->vs_value[k] = NULL;
4393 * Assumes the caller is holding v_vsd_lock to protect the vsd.
4398 struct vsd_node *vsd;
4403 vsd = vp->v_vsd;
4405 if (key && vsd != NULL && key <= vsd->vs_nkeys)
4406 return (vsd->vs_value[key - 1]);
4412 * Assumes the caller is holding v_vsd_lock to protect the vsd.
4417 struct vsd_node *vsd;
4425 vsd = vp->v_vsd;
4426 if (vsd == NULL)
4427 vsd = vp->v_vsd = kmem_zalloc(sizeof (*vsd), KM_SLEEP);
4430 * If the vsd was just allocated, vs_nkeys will be 0, so the following
4436 if (key <= vsd->vs_nkeys) {
4437 vsd->vs_value[key - 1] = value;
4443 if (vsd->vs_nkeys == 0) {
4448 list_insert_head(vsd_list, vsd);
4455 vsd->vs_value = vsd_realloc(vsd->vs_value,
4456 vsd->vs_nkeys * sizeof (void *),
4458 vsd->vs_nkeys = key;
4459 vsd->vs_value[key - 1] = value;
4465 * Called from vn_free() to run the destructor function for each vsd
4467 * Assumes that the destructor *DOES NOT* use vsd
4473 struct vsd_node *vsd = vp->v_vsd;
4475 if (vsd == NULL)
4478 if (vsd->vs_nkeys == 0) {
4479 kmem_free(vsd, sizeof (*vsd));
4490 for (i = 0; i < vsd->vs_nkeys; i++) {
4491 if (vsd->vs_value[i] && vsd_destructor[i])
4492 (*vsd_destructor[i])(vsd->vs_value[i]);
4493 vsd->vs_value[i] = NULL;
4499 list_remove(vsd_list, vsd);
4506 kmem_free(vsd->vs_value, vsd->vs_nkeys * sizeof (void *));
4507 kmem_free(vsd, sizeof (struct vsd_node));