Lines Matching defs:assoc
59 * Includes the assoc name for identification and private clear callback.
143 file_getdata(struct fileassoc_file *faf, const struct fileassoc *assoc)
147 assoc->assoc_key);
151 file_setdata(struct fileassoc_file *faf, const struct fileassoc *assoc,
156 assoc->assoc_key, data);
160 file_cleanup(struct fileassoc_file *faf, const struct fileassoc *assoc)
165 cb = assoc->assoc_cleanup_cb;
169 data = file_getdata(faf, assoc);
176 struct fileassoc *assoc;
180 LIST_FOREACH(assoc, &fileassoc_list, assoc_list) {
181 file_cleanup(faf, assoc);
231 * Register a new assoc.
239 struct fileassoc *assoc;
249 assoc = kmem_alloc(sizeof(*assoc), KM_SLEEP);
250 assoc->assoc_name = name;
251 assoc->assoc_cleanup_cb = cleanup_cb;
252 assoc->assoc_key = key;
254 LIST_INSERT_HEAD(&fileassoc_list, assoc, assoc_list);
256 *result = assoc;
262 * Deregister an assoc.
265 fileassoc_deregister(fileassoc_t assoc)
268 LIST_REMOVE(assoc, assoc_list);
269 specificdata_key_delete(fileassoc_domain, assoc->assoc_key);
270 kmem_free(assoc, sizeof(*assoc));
340 * Return assoc data associated with a vnode.
343 fileassoc_lookup(struct vnode *vp, fileassoc_t assoc)
351 return file_getdata(faf, assoc);
450 * Run a callback for each assoc in a table.
453 fileassoc_table_run(struct mount *mp, fileassoc_t assoc, fileassoc_cb_t cb,
469 data = file_getdata(faf, assoc);
479 * Clear a table for a given assoc.
482 fileassoc_table_clear(struct mount *mp, fileassoc_t assoc)
495 file_cleanup(faf, assoc);
496 file_setdata(faf, assoc, NULL);
595 * Add an assoc to a vnode.
598 fileassoc_add(struct vnode *vp, fileassoc_t assoc, void *data)
610 olddata = file_getdata(faf, assoc);
616 file_setdata(faf, assoc, data);
624 * Clear an assoc from a vnode.
627 fileassoc_clear(struct vnode *vp, fileassoc_t assoc)
635 file_cleanup(faf, assoc);
636 file_setdata(faf, assoc, NULL);