Lines Matching refs:txh
99 dmu_tx_hold_t *txh; in dmu_tx_hold_dnode_impl() local
117 txh = kmem_zalloc(sizeof (dmu_tx_hold_t), KM_SLEEP); in dmu_tx_hold_dnode_impl()
118 txh->txh_tx = tx; in dmu_tx_hold_dnode_impl()
119 txh->txh_dnode = dn; in dmu_tx_hold_dnode_impl()
120 zfs_refcount_create(&txh->txh_space_towrite); in dmu_tx_hold_dnode_impl()
121 zfs_refcount_create(&txh->txh_memory_tohold); in dmu_tx_hold_dnode_impl()
122 txh->txh_type = type; in dmu_tx_hold_dnode_impl()
123 txh->txh_arg1 = arg1; in dmu_tx_hold_dnode_impl()
124 txh->txh_arg2 = arg2; in dmu_tx_hold_dnode_impl()
125 list_insert_tail(&tx->tx_holds, txh); in dmu_tx_hold_dnode_impl()
127 return (txh); in dmu_tx_hold_dnode_impl()
135 dmu_tx_hold_t *txh; in dmu_tx_hold_object_impl() local
145 txh = dmu_tx_hold_dnode_impl(tx, dn, type, arg1, arg2); in dmu_tx_hold_object_impl()
148 return (txh); in dmu_tx_hold_object_impl()
208 dmu_tx_count_write(dmu_tx_hold_t *txh, uint64_t off, uint64_t len) in dmu_tx_count_write() argument
210 dnode_t *dn = txh->txh_dnode; in dmu_tx_count_write()
216 (void) zfs_refcount_add_many(&txh->txh_space_towrite, len, FTAG); in dmu_tx_count_write()
218 if (zfs_refcount_count(&txh->txh_space_towrite) > 2 * DMU_MAX_ACCESS) in dmu_tx_count_write()
235 txh->txh_tx->tx_err = err; in dmu_tx_count_write()
247 txh->txh_tx->tx_err = err; in dmu_tx_count_write()
257 txh->txh_tx->tx_err = err; in dmu_tx_count_write()
268 txh->txh_tx->tx_err = err; in dmu_tx_count_write()
275 txh->txh_tx->tx_err = err; in dmu_tx_count_write()
281 dmu_tx_count_dnode(dmu_tx_hold_t *txh) in dmu_tx_count_dnode() argument
283 (void) zfs_refcount_add_many(&txh->txh_space_towrite, DNODE_MIN_SIZE, in dmu_tx_count_dnode()
290 dmu_tx_hold_t *txh; in dmu_tx_hold_write() local
296 txh = dmu_tx_hold_object_impl(tx, tx->tx_objset, in dmu_tx_hold_write()
298 if (txh != NULL) { in dmu_tx_hold_write()
299 dmu_tx_count_write(txh, off, len); in dmu_tx_hold_write()
300 dmu_tx_count_dnode(txh); in dmu_tx_hold_write()
307 dmu_tx_hold_t *txh; in dmu_tx_hold_remap_l1indirect() local
310 txh = dmu_tx_hold_object_impl(tx, tx->tx_objset, in dmu_tx_hold_remap_l1indirect()
312 if (txh == NULL) in dmu_tx_hold_remap_l1indirect()
315 dnode_t *dn = txh->txh_dnode; in dmu_tx_hold_remap_l1indirect()
316 (void) zfs_refcount_add_many(&txh->txh_space_towrite, in dmu_tx_hold_remap_l1indirect()
318 dmu_tx_count_dnode(txh); in dmu_tx_hold_remap_l1indirect()
324 dmu_tx_hold_t *txh; in dmu_tx_hold_write_by_dnode() local
330 txh = dmu_tx_hold_dnode_impl(tx, dn, THT_WRITE, off, len); in dmu_tx_hold_write_by_dnode()
331 if (txh != NULL) { in dmu_tx_hold_write_by_dnode()
332 dmu_tx_count_write(txh, off, len); in dmu_tx_hold_write_by_dnode()
333 dmu_tx_count_dnode(txh); in dmu_tx_hold_write_by_dnode()
352 dmu_tx_hold_free_impl(dmu_tx_hold_t *txh, uint64_t off, uint64_t len) in dmu_tx_hold_free_impl() argument
358 tx = txh->txh_tx; in dmu_tx_hold_free_impl()
361 dn = txh->txh_dnode; in dmu_tx_hold_free_impl()
362 dmu_tx_count_dnode(txh); in dmu_tx_hold_free_impl()
380 dmu_tx_count_write(txh, 0, dn->dn_datablksz); in dmu_tx_hold_free_impl()
384 dmu_tx_count_write(txh, off, 1); in dmu_tx_hold_free_impl()
387 dmu_tx_count_write(txh, off + len, 1); in dmu_tx_hold_free_impl()
423 (void) zfs_refcount_add_many(&txh->txh_memory_tohold, in dmu_tx_hold_free_impl()
444 dmu_tx_hold_t *txh; in dmu_tx_hold_free() local
446 txh = dmu_tx_hold_object_impl(tx, tx->tx_objset, in dmu_tx_hold_free()
448 if (txh != NULL) in dmu_tx_hold_free()
449 (void) dmu_tx_hold_free_impl(txh, off, len); in dmu_tx_hold_free()
455 dmu_tx_hold_t *txh; in dmu_tx_hold_free_by_dnode() local
457 txh = dmu_tx_hold_dnode_impl(tx, dn, THT_FREE, off, len); in dmu_tx_hold_free_by_dnode()
458 if (txh != NULL) in dmu_tx_hold_free_by_dnode()
459 (void) dmu_tx_hold_free_impl(txh, off, len); in dmu_tx_hold_free_by_dnode()
463 dmu_tx_hold_zap_impl(dmu_tx_hold_t *txh, const char *name) in dmu_tx_hold_zap_impl() argument
465 dmu_tx_t *tx = txh->txh_tx; in dmu_tx_hold_zap_impl()
471 dn = txh->txh_dnode; in dmu_tx_hold_zap_impl()
473 dmu_tx_count_dnode(txh); in dmu_tx_hold_zap_impl()
484 (void) zfs_refcount_add_many(&txh->txh_space_towrite, in dmu_tx_hold_zap_impl()
517 dmu_tx_hold_t *txh; in dmu_tx_hold_zap() local
521 txh = dmu_tx_hold_object_impl(tx, tx->tx_objset, in dmu_tx_hold_zap()
523 if (txh != NULL) in dmu_tx_hold_zap()
524 dmu_tx_hold_zap_impl(txh, name); in dmu_tx_hold_zap()
530 dmu_tx_hold_t *txh; in dmu_tx_hold_zap_by_dnode() local
535 txh = dmu_tx_hold_dnode_impl(tx, dn, THT_ZAP, add, (uintptr_t)name); in dmu_tx_hold_zap_by_dnode()
536 if (txh != NULL) in dmu_tx_hold_zap_by_dnode()
537 dmu_tx_hold_zap_impl(txh, name); in dmu_tx_hold_zap_by_dnode()
543 dmu_tx_hold_t *txh; in dmu_tx_hold_bonus() local
547 txh = dmu_tx_hold_object_impl(tx, tx->tx_objset, in dmu_tx_hold_bonus()
549 if (txh) in dmu_tx_hold_bonus()
550 dmu_tx_count_dnode(txh); in dmu_tx_hold_bonus()
556 dmu_tx_hold_t *txh; in dmu_tx_hold_bonus_by_dnode() local
560 txh = dmu_tx_hold_dnode_impl(tx, dn, THT_BONUS, 0, 0); in dmu_tx_hold_bonus_by_dnode()
561 if (txh) in dmu_tx_hold_bonus_by_dnode()
562 dmu_tx_count_dnode(txh); in dmu_tx_hold_bonus_by_dnode()
568 dmu_tx_hold_t *txh; in dmu_tx_hold_space() local
571 txh = dmu_tx_hold_object_impl(tx, tx->tx_objset, in dmu_tx_hold_space()
574 (void) zfs_refcount_add_many(&txh->txh_space_towrite, space, FTAG); in dmu_tx_hold_space()
601 for (dmu_tx_hold_t *txh = list_head(&tx->tx_holds); txh != NULL; in dmu_tx_dirty_buf() local
602 txh = list_next(&tx->tx_holds, txh)) { in dmu_tx_dirty_buf()
604 if (txh->txh_dnode == dn && txh->txh_type != THT_NEWOBJECT) in dmu_tx_dirty_buf()
606 if (txh->txh_dnode == NULL || txh->txh_dnode == dn) { in dmu_tx_dirty_buf()
612 (txh->txh_arg1 >> shift); in dmu_tx_dirty_buf()
614 ((txh->txh_arg1 + txh->txh_arg2 - 1) >> shift); in dmu_tx_dirty_buf()
620 txh->txh_type, beginblk, endblk); in dmu_tx_dirty_buf()
622 switch (txh->txh_type) { in dmu_tx_dirty_buf()
650 txh->txh_arg2 == DMU_OBJECT_END)) in dmu_tx_dirty_buf()
916 for (dmu_tx_hold_t *txh = list_head(&tx->tx_holds); txh != NULL; in dmu_tx_try_assign() local
917 txh = list_next(&tx->tx_holds, txh)) { in dmu_tx_try_assign()
918 dnode_t *dn = txh->txh_dnode; in dmu_tx_try_assign()
923 tx->tx_needassign_txh = txh; in dmu_tx_try_assign()
932 towrite += zfs_refcount_count(&txh->txh_space_towrite); in dmu_tx_try_assign()
933 tohold += zfs_refcount_count(&txh->txh_memory_tohold); in dmu_tx_try_assign()
963 for (dmu_tx_hold_t *txh = list_head(&tx->tx_holds); in dmu_tx_unassign() local
964 txh != tx->tx_needassign_txh; in dmu_tx_unassign()
965 txh = list_next(&tx->tx_holds, txh)) { in dmu_tx_unassign()
966 dnode_t *dn = txh->txh_dnode; in dmu_tx_unassign()
1101 dmu_tx_hold_t *txh; in dmu_tx_destroy() local
1103 while ((txh = list_head(&tx->tx_holds)) != NULL) { in dmu_tx_destroy()
1104 dnode_t *dn = txh->txh_dnode; in dmu_tx_destroy()
1106 list_remove(&tx->tx_holds, txh); in dmu_tx_destroy()
1107 zfs_refcount_destroy_many(&txh->txh_space_towrite, in dmu_tx_destroy()
1108 zfs_refcount_count(&txh->txh_space_towrite)); in dmu_tx_destroy()
1109 zfs_refcount_destroy_many(&txh->txh_memory_tohold, in dmu_tx_destroy()
1110 zfs_refcount_count(&txh->txh_memory_tohold)); in dmu_tx_destroy()
1111 kmem_free(txh, sizeof (dmu_tx_hold_t)); in dmu_tx_destroy()
1130 for (dmu_tx_hold_t *txh = list_head(&tx->tx_holds); txh != NULL; in dmu_tx_commit() local
1131 txh = list_next(&tx->tx_holds, txh)) { in dmu_tx_commit()
1132 dnode_t *dn = txh->txh_dnode; in dmu_tx_commit()
1250 dmu_tx_hold_t *txh; in dmu_tx_hold_spill() local
1252 txh = dmu_tx_hold_object_impl(tx, tx->tx_objset, object, in dmu_tx_hold_spill()
1254 if (txh != NULL) in dmu_tx_hold_spill()
1255 (void) zfs_refcount_add_many(&txh->txh_space_towrite, in dmu_tx_hold_spill()