MCPcopy Create free account
hub / github.com/F-Stack/f-stack / dmu_buf_init_user

Function dmu_buf_init_user

freebsd/contrib/openzfs/include/sys/dmu.h:669–685  ·  view source on GitHub ↗

* Initialize the given dmu_buf_user_t instance with the eviction function * evict_func, to be called when the user is evicted. * * NOTE: This function should only be called once on a given dmu_buf_user_t. * To allow enforcement of this, dbu must already be zeroed on entry. */ ARGSUSED*/

Source from the content-addressed store, hash-verified

667 */
668/*ARGSUSED*/
669static inline void
670dmu_buf_init_user(dmu_buf_user_t *dbu, dmu_buf_evict_func_t *evict_func_sync,
671 dmu_buf_evict_func_t *evict_func_async,
672 dmu_buf_t **clear_on_evict_dbufp __maybe_unused)
673{
674 ASSERT(dbu->dbu_evict_func_sync == NULL);
675 ASSERT(dbu->dbu_evict_func_async == NULL);
676
677 /* must have at least one evict func */
678 IMPLY(evict_func_sync == NULL, evict_func_async != NULL);
679 dbu->dbu_evict_func_sync = evict_func_sync;
680 dbu->dbu_evict_func_async = evict_func_async;
681 taskq_init_ent(&dbu->dbu_tqent);
682#ifdef ZFS_DEBUG
683 dbu->dbu_clear_on_evict_dbufp = clear_on_evict_dbufp;
684#endif
685}
686
687/*
688 * Attach user data to a dbuf and mark it for normal (when the dbuf's

Callers 8

dsl_dataset_hold_objFunction · 0.85
dnode_hold_implFunction · 0.85
sa_handle_get_from_dbFunction · 0.85
zap_create_leafFunction · 0.85
zap_open_leafFunction · 0.85
dsl_dir_hold_objFunction · 0.85
mzap_openFunction · 0.85

Calls 1

taskq_init_entFunction · 0.50

Tested by

no test coverage detected