* 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*/
| 667 | */ |
| 668 | /*ARGSUSED*/ |
| 669 | static inline void |
| 670 | dmu_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 |
no test coverage detected