Lines Matching defs:assoc
55 * Assoc entry.
56 * Includes the assoc name for identification and private clear callback.
70 specificdata_reference faf_data; /* Assoc data. */
140 file_getdata(struct fileassoc_file *faf, const struct fileassoc *assoc)
144 assoc->assoc_key);
148 file_setdata(struct fileassoc_file *faf, const struct fileassoc *assoc,
153 assoc->assoc_key, data);
157 file_cleanup(struct fileassoc_file *faf, const struct fileassoc *assoc)
162 cb = assoc->assoc_cleanup_cb;
166 data = file_getdata(faf, assoc);
173 struct fileassoc *assoc;
177 LIST_FOREACH(assoc, &fileassoc_list, assoc_list) {
178 file_cleanup(faf, assoc);
228 * Register a new assoc.
236 struct fileassoc *assoc;
246 assoc = kmem_alloc(sizeof(*assoc), KM_SLEEP);
247 assoc->assoc_name = name;
248 assoc->assoc_cleanup_cb = cleanup_cb;
249 assoc->assoc_key = key;
251 LIST_INSERT_HEAD(&fileassoc_list, assoc, assoc_list);
253 *result = assoc;
259 * Deregister an assoc.
262 fileassoc_deregister(fileassoc_t assoc)
265 LIST_REMOVE(assoc, assoc_list);
266 specificdata_key_delete(fileassoc_domain, assoc->assoc_key);
267 kmem_free(assoc, sizeof(*assoc));
337 * Return assoc data associated with a vnode.
340 fileassoc_lookup(struct vnode *vp, fileassoc_t assoc)
348 return file_getdata(faf, assoc);
447 * Run a callback for each assoc in a table.
450 fileassoc_table_run(struct mount *mp, fileassoc_t assoc, fileassoc_cb_t cb,
466 data = file_getdata(faf, assoc);
476 * Clear a table for a given assoc.
479 fileassoc_table_clear(struct mount *mp, fileassoc_t assoc)
492 file_cleanup(faf, assoc);
493 file_setdata(faf, assoc, NULL);
592 * Add an assoc to a vnode.
595 fileassoc_add(struct vnode *vp, fileassoc_t assoc, void *data)
607 olddata = file_getdata(faf, assoc);
613 file_setdata(faf, assoc, data);
621 * Clear an assoc from a vnode.
624 fileassoc_clear(struct vnode *vp, fileassoc_t assoc)
632 file_cleanup(faf, assoc);
633 file_setdata(faf, assoc, NULL);