| 1782 | } |
| 1783 | |
| 1784 | itx_t * |
| 1785 | zil_itx_create(uint64_t txtype, size_t lrsize) |
| 1786 | { |
| 1787 | size_t itxsize; |
| 1788 | itx_t *itx; |
| 1789 | |
| 1790 | lrsize = P2ROUNDUP_TYPED(lrsize, sizeof (uint64_t), size_t); |
| 1791 | itxsize = offsetof(itx_t, itx_lr) + lrsize; |
| 1792 | |
| 1793 | itx = zio_data_buf_alloc(itxsize); |
| 1794 | itx->itx_lr.lrc_txtype = txtype; |
| 1795 | itx->itx_lr.lrc_reclen = lrsize; |
| 1796 | itx->itx_lr.lrc_seq = 0; /* defensive */ |
| 1797 | itx->itx_sync = B_TRUE; /* default is synchronous */ |
| 1798 | itx->itx_callback = NULL; |
| 1799 | itx->itx_callback_data = NULL; |
| 1800 | itx->itx_size = itxsize; |
| 1801 | |
| 1802 | return (itx); |
| 1803 | } |
| 1804 | |
| 1805 | void |
| 1806 | zil_itx_destroy(itx_t *itx) |