* Dispatch taskq tasks to dp_sync_taskq to update the user accounting, and * also release the holds on the dnodes from dmu_objset_sync_dnodes(). * The caller must taskq_wait(dp_sync_taskq). */
| 2089 | * The caller must taskq_wait(dp_sync_taskq). |
| 2090 | */ |
| 2091 | void |
| 2092 | dmu_objset_sync_done(objset_t *os, dmu_tx_t *tx) |
| 2093 | { |
| 2094 | boolean_t need_userquota = dmu_objset_do_userquota_updates_prep(os, tx); |
| 2095 | |
| 2096 | int num_sublists = multilist_get_num_sublists(os->os_synced_dnodes); |
| 2097 | for (int i = 0; i < num_sublists; i++) { |
| 2098 | userquota_updates_arg_t *uua = |
| 2099 | kmem_alloc(sizeof (*uua), KM_SLEEP); |
| 2100 | uua->uua_os = os; |
| 2101 | uua->uua_sublist_idx = i; |
| 2102 | uua->uua_tx = tx; |
| 2103 | |
| 2104 | /* |
| 2105 | * If we don't need to update userquotas, use |
| 2106 | * dnode_rele_task() to call dnode_rele() |
| 2107 | */ |
| 2108 | (void) taskq_dispatch(dmu_objset_pool(os)->dp_sync_taskq, |
| 2109 | need_userquota ? userquota_updates_task : dnode_rele_task, |
| 2110 | uua, 0); |
| 2111 | /* callback frees uua */ |
| 2112 | } |
| 2113 | } |
| 2114 | |
| 2115 | |
| 2116 | /* |
no test coverage detected