Lines Matching defs:vsd

106  * forward declarations for internal vnode specific data (vsd)
126 * Callers are responsible for protecting the vsd by holding v_vsd_lock
132 * vsd_nkeys - creation and deletion of vsd keys
4333 struct vsd_node *vsd;
4352 for (vsd = list_head(vsd_list); vsd != NULL;
4353 vsd = list_next(vsd_list, vsd)) {
4357 if (key > vsd->vs_nkeys)
4362 if (vsd->vs_value[k] && vsd_destructor[k])
4363 (*vsd_destructor[k])(vsd->vs_value[k]);
4367 vsd->vs_value[k] = NULL;
4381 * Assumes the caller is holding v_vsd_lock to protect the vsd.
4386 struct vsd_node *vsd;
4391 vsd = vp->v_vsd;
4393 if (key && vsd != NULL && key <= vsd->vs_nkeys)
4394 return (vsd->vs_value[key - 1]);
4400 * Assumes the caller is holding v_vsd_lock to protect the vsd.
4405 struct vsd_node *vsd;
4413 vsd = vp->v_vsd;
4414 if (vsd == NULL)
4415 vsd = vp->v_vsd = kmem_zalloc(sizeof (*vsd), KM_SLEEP);
4418 * If the vsd was just allocated, vs_nkeys will be 0, so the following
4424 if (key <= vsd->vs_nkeys) {
4425 vsd->vs_value[key - 1] = value;
4431 if (vsd->vs_nkeys == 0) {
4436 list_insert_head(vsd_list, vsd);
4443 vsd->vs_value = vsd_realloc(vsd->vs_value,
4444 vsd->vs_nkeys * sizeof (void *),
4446 vsd->vs_nkeys = key;
4447 vsd->vs_value[key - 1] = value;
4453 * Called from vn_free() to run the destructor function for each vsd
4455 * Assumes that the destructor *DOES NOT* use vsd
4461 struct vsd_node *vsd = vp->v_vsd;
4463 if (vsd == NULL)
4466 if (vsd->vs_nkeys == 0) {
4467 kmem_free(vsd, sizeof (*vsd));
4478 for (i = 0; i < vsd->vs_nkeys; i++) {
4479 if (vsd->vs_value[i] && vsd_destructor[i])
4480 (*vsd_destructor[i])(vsd->vs_value[i]);
4481 vsd->vs_value[i] = NULL;
4487 list_remove(vsd_list, vsd);
4494 kmem_free(vsd->vs_value, vsd->vs_nkeys * sizeof (void *));
4495 kmem_free(vsd, sizeof (struct vsd_node));