Lines Matching refs:lr

1315 ztest_log_create(ztest_ds_t *zd, dmu_tx_t *tx, lr_create_t *lr)  in ztest_log_create()  argument
1317 char *name = (void *)(lr + 1); /* name follows lr */ in ztest_log_create()
1324 itx = zil_itx_create(TX_CREATE, sizeof (*lr) + namesize); in ztest_log_create()
1325 bcopy(&lr->lr_common + 1, &itx->itx_lr + 1, in ztest_log_create()
1326 sizeof (*lr) + namesize - sizeof (lr_t)); in ztest_log_create()
1332 ztest_log_remove(ztest_ds_t *zd, dmu_tx_t *tx, lr_remove_t *lr, uint64_t object) in ztest_log_remove() argument
1334 char *name = (void *)(lr + 1); /* name follows lr */ in ztest_log_remove()
1341 itx = zil_itx_create(TX_REMOVE, sizeof (*lr) + namesize); in ztest_log_remove()
1342 bcopy(&lr->lr_common + 1, &itx->itx_lr + 1, in ztest_log_remove()
1343 sizeof (*lr) + namesize - sizeof (lr_t)); in ztest_log_remove()
1350 ztest_log_write(ztest_ds_t *zd, dmu_tx_t *tx, lr_write_t *lr) in ztest_log_write() argument
1358 if (lr->lr_length > ZIL_MAX_LOG_DATA) in ztest_log_write()
1362 sizeof (*lr) + (write_state == WR_COPIED ? lr->lr_length : 0)); in ztest_log_write()
1365 dmu_read(zd->zd_os, lr->lr_foid, lr->lr_offset, lr->lr_length, in ztest_log_write()
1368 itx = zil_itx_create(TX_WRITE, sizeof (*lr)); in ztest_log_write()
1374 itx->itx_sod += (write_state == WR_NEED_COPY ? lr->lr_length : 0); in ztest_log_write()
1376 bcopy(&lr->lr_common + 1, &itx->itx_lr + 1, in ztest_log_write()
1377 sizeof (*lr) - sizeof (lr_t)); in ztest_log_write()
1383 ztest_log_truncate(ztest_ds_t *zd, dmu_tx_t *tx, lr_truncate_t *lr) in ztest_log_truncate() argument
1390 itx = zil_itx_create(TX_TRUNCATE, sizeof (*lr)); in ztest_log_truncate()
1391 bcopy(&lr->lr_common + 1, &itx->itx_lr + 1, in ztest_log_truncate()
1392 sizeof (*lr) - sizeof (lr_t)); in ztest_log_truncate()
1399 ztest_log_setattr(ztest_ds_t *zd, dmu_tx_t *tx, lr_setattr_t *lr) in ztest_log_setattr() argument
1406 itx = zil_itx_create(TX_SETATTR, sizeof (*lr)); in ztest_log_setattr()
1407 bcopy(&lr->lr_common + 1, &itx->itx_lr + 1, in ztest_log_setattr()
1408 sizeof (*lr) - sizeof (lr_t)); in ztest_log_setattr()
1418 ztest_replay_create(ztest_ds_t *zd, lr_create_t *lr, boolean_t byteswap) in ztest_replay_create() argument
1420 char *name = (void *)(lr + 1); /* name follows lr */ in ztest_replay_create()
1429 byteswap_uint64_array(lr, sizeof (*lr)); in ztest_replay_create()
1431 ASSERT(lr->lr_doid == ZTEST_DIROBJ); in ztest_replay_create()
1436 dmu_tx_hold_zap(tx, lr->lr_doid, B_TRUE, name); in ztest_replay_create()
1438 if (lr->lrz_type == DMU_OT_ZAP_OTHER) { in ztest_replay_create()
1448 ASSERT(dmu_objset_zil(os)->zl_replay == !!lr->lr_foid); in ztest_replay_create()
1450 if (lr->lrz_type == DMU_OT_ZAP_OTHER) { in ztest_replay_create()
1451 if (lr->lr_foid == 0) { in ztest_replay_create()
1452 lr->lr_foid = zap_create(os, in ztest_replay_create()
1453 lr->lrz_type, lr->lrz_bonustype, in ztest_replay_create()
1454 lr->lrz_bonuslen, tx); in ztest_replay_create()
1456 error = zap_create_claim(os, lr->lr_foid, in ztest_replay_create()
1457 lr->lrz_type, lr->lrz_bonustype, in ztest_replay_create()
1458 lr->lrz_bonuslen, tx); in ztest_replay_create()
1461 if (lr->lr_foid == 0) { in ztest_replay_create()
1462 lr->lr_foid = dmu_object_alloc(os, in ztest_replay_create()
1463 lr->lrz_type, 0, lr->lrz_bonustype, in ztest_replay_create()
1464 lr->lrz_bonuslen, tx); in ztest_replay_create()
1466 error = dmu_object_claim(os, lr->lr_foid, in ztest_replay_create()
1467 lr->lrz_type, 0, lr->lrz_bonustype, in ztest_replay_create()
1468 lr->lrz_bonuslen, tx); in ztest_replay_create()
1479 ASSERT(lr->lr_foid != 0); in ztest_replay_create()
1481 if (lr->lrz_type != DMU_OT_ZAP_OTHER) in ztest_replay_create()
1482 VERIFY3U(0, ==, dmu_object_set_blocksize(os, lr->lr_foid, in ztest_replay_create()
1483 lr->lrz_blocksize, lr->lrz_ibshift, tx)); in ztest_replay_create()
1485 VERIFY3U(0, ==, dmu_bonus_hold(os, lr->lr_foid, FTAG, &db)); in ztest_replay_create()
1488 ztest_bt_generate(bbt, os, lr->lr_foid, -1ULL, lr->lr_gen, txg, txg); in ztest_replay_create()
1491 VERIFY3U(0, ==, zap_add(os, lr->lr_doid, name, sizeof (uint64_t), 1, in ztest_replay_create()
1492 &lr->lr_foid, tx)); in ztest_replay_create()
1494 (void) ztest_log_create(zd, tx, lr); in ztest_replay_create()
1502 ztest_replay_remove(ztest_ds_t *zd, lr_remove_t *lr, boolean_t byteswap) in ztest_replay_remove() argument
1504 char *name = (void *)(lr + 1); /* name follows lr */ in ztest_replay_remove()
1511 byteswap_uint64_array(lr, sizeof (*lr)); in ztest_replay_remove()
1513 ASSERT(lr->lr_doid == ZTEST_DIROBJ); in ztest_replay_remove()
1517 zap_lookup(os, lr->lr_doid, name, sizeof (object), 1, &object)); in ztest_replay_remove()
1526 dmu_tx_hold_zap(tx, lr->lr_doid, B_FALSE, name); in ztest_replay_remove()
1541 VERIFY3U(0, ==, zap_remove(os, lr->lr_doid, name, tx)); in ztest_replay_remove()
1543 (void) ztest_log_remove(zd, tx, lr, object); in ztest_replay_remove()
1553 ztest_replay_write(ztest_ds_t *zd, lr_write_t *lr, boolean_t byteswap) in ztest_replay_write() argument
1556 void *data = lr + 1; /* data follows lr */ in ztest_replay_write()
1568 byteswap_uint64_array(lr, sizeof (*lr)); in ztest_replay_write()
1570 offset = lr->lr_offset; in ztest_replay_write()
1571 length = lr->lr_length; in ztest_replay_write()
1574 if (lr->lr_common.lrc_reclen == sizeof (lr_write_t)) { in ztest_replay_write()
1575 uint64_t blocksize = BP_GET_LSIZE(&lr->lr_blkptr); in ztest_replay_write()
1588 ztest_object_lock(zd, lr->lr_foid, RL_READER); in ztest_replay_write()
1589 rl = ztest_range_lock(zd, lr->lr_foid, offset, length, RL_WRITER); in ztest_replay_write()
1591 VERIFY3U(0, ==, dmu_bonus_hold(os, lr->lr_foid, FTAG, &db)); in ztest_replay_write()
1599 lrtxg = lr->lr_common.lrc_txg; in ztest_replay_write()
1603 dmu_tx_hold_write(tx, lr->lr_foid, offset, length); in ztest_replay_write()
1615 ztest_object_unlock(zd, lr->lr_foid); in ztest_replay_write()
1631 VERIFY(dmu_read(os, lr->lr_foid, offset, in ztest_replay_write()
1634 ztest_bt_verify(&rbt, os, lr->lr_foid, in ztest_replay_write()
1646 ztest_bt_verify(bt, os, lr->lr_foid, offset, in ztest_replay_write()
1655 ztest_bt_generate(bt, os, lr->lr_foid, offset, gen, txg, crtxg); in ztest_replay_write()
1659 dmu_write(os, lr->lr_foid, offset, length, data, tx); in ztest_replay_write()
1665 (void) ztest_log_write(zd, tx, lr); in ztest_replay_write()
1672 ztest_object_unlock(zd, lr->lr_foid); in ztest_replay_write()
1678 ztest_replay_truncate(ztest_ds_t *zd, lr_truncate_t *lr, boolean_t byteswap) in ztest_replay_truncate() argument
1686 byteswap_uint64_array(lr, sizeof (*lr)); in ztest_replay_truncate()
1688 ztest_object_lock(zd, lr->lr_foid, RL_READER); in ztest_replay_truncate()
1689 rl = ztest_range_lock(zd, lr->lr_foid, lr->lr_offset, lr->lr_length, in ztest_replay_truncate()
1694 dmu_tx_hold_free(tx, lr->lr_foid, lr->lr_offset, lr->lr_length); in ztest_replay_truncate()
1699 ztest_object_unlock(zd, lr->lr_foid); in ztest_replay_truncate()
1703 VERIFY(dmu_free_range(os, lr->lr_foid, lr->lr_offset, in ztest_replay_truncate()
1704 lr->lr_length, tx) == 0); in ztest_replay_truncate()
1706 (void) ztest_log_truncate(zd, tx, lr); in ztest_replay_truncate()
1711 ztest_object_unlock(zd, lr->lr_foid); in ztest_replay_truncate()
1717 ztest_replay_setattr(ztest_ds_t *zd, lr_setattr_t *lr, boolean_t byteswap) in ztest_replay_setattr() argument
1726 byteswap_uint64_array(lr, sizeof (*lr)); in ztest_replay_setattr()
1728 ztest_object_lock(zd, lr->lr_foid, RL_WRITER); in ztest_replay_setattr()
1730 VERIFY3U(0, ==, dmu_bonus_hold(os, lr->lr_foid, FTAG, &db)); in ztest_replay_setattr()
1733 dmu_tx_hold_bonus(tx, lr->lr_foid); in ztest_replay_setattr()
1738 ztest_object_unlock(zd, lr->lr_foid); in ztest_replay_setattr()
1745 lrtxg = lr->lr_common.lrc_txg; in ztest_replay_setattr()
1748 ASSERT(lr->lr_size != 0); in ztest_replay_setattr()
1749 ASSERT(lr->lr_mode != 0); in ztest_replay_setattr()
1755 lr->lr_size = (ztest_random(db->db_size / sizeof (*bbt)) + 1) * in ztest_replay_setattr()
1757 lr->lr_mode = bbt->bt_gen + 1; in ztest_replay_setattr()
1764 ztest_bt_verify(bbt, os, lr->lr_foid, -1ULL, lr->lr_mode, in ztest_replay_setattr()
1769 ASSERT3U(lr->lr_size, >=, sizeof (*bbt)); in ztest_replay_setattr()
1770 ASSERT3U(lr->lr_size, <=, db->db_size); in ztest_replay_setattr()
1771 VERIFY0(dmu_set_bonus(db, lr->lr_size, tx)); in ztest_replay_setattr()
1774 ztest_bt_generate(bbt, os, lr->lr_foid, -1ULL, lr->lr_mode, txg, crtxg); in ztest_replay_setattr()
1778 (void) ztest_log_setattr(zd, tx, lr); in ztest_replay_setattr()
1782 ztest_object_unlock(zd, lr->lr_foid); in ztest_replay_setattr()
1833 ztest_get_data(void *arg, lr_write_t *lr, char *buf, zio_t *zio) in ztest_get_data() argument
1837 uint64_t object = lr->lr_foid; in ztest_get_data()
1838 uint64_t offset = lr->lr_offset; in ztest_get_data()
1839 uint64_t size = lr->lr_length; in ztest_get_data()
1840 blkptr_t *bp = &lr->lr_blkptr; in ztest_get_data()
1841 uint64_t txg = lr->lr_common.lrc_txg; in ztest_get_data()
1906 error = dmu_sync(zio, lr->lr_common.lrc_txg, in ztest_get_data()
1922 char *lr; in ztest_lr_alloc() local
1925 lr = umem_zalloc(lrsize + namesize, UMEM_NOFAIL); in ztest_lr_alloc()
1928 bcopy(name, lr + lrsize, namesize); in ztest_lr_alloc()
1930 return (lr); in ztest_lr_alloc()
1934 ztest_lr_free(void *lr, size_t lrsize, char *name) in ztest_lr_free() argument
1938 umem_free(lr, lrsize + namesize); in ztest_lr_free()
1999 lr_create_t *lr = ztest_lr_alloc(sizeof (*lr), od->od_name); in ztest_create() local
2001 lr->lr_doid = od->od_dir; in ztest_create()
2002 lr->lr_foid = 0; /* 0 to allocate, > 0 to claim */ in ztest_create()
2003 lr->lrz_type = od->od_crtype; in ztest_create()
2004 lr->lrz_blocksize = od->od_crblocksize; in ztest_create()
2005 lr->lrz_ibshift = ztest_random_ibshift(); in ztest_create()
2006 lr->lrz_bonustype = DMU_OT_UINT64_OTHER; in ztest_create()
2007 lr->lrz_bonuslen = dmu_bonus_max(); in ztest_create()
2008 lr->lr_gen = od->od_crgen; in ztest_create()
2009 lr->lr_crtime[0] = time(NULL); in ztest_create()
2011 if (ztest_replay_create(zd, lr, B_FALSE) != 0) { in ztest_create()
2016 od->od_object = lr->lr_foid; in ztest_create()
2023 ztest_lr_free(lr, sizeof (*lr), od->od_name); in ztest_create()
2051 lr_remove_t *lr = ztest_lr_alloc(sizeof (*lr), od->od_name); in ztest_remove() local
2053 lr->lr_doid = od->od_dir; in ztest_remove()
2055 if ((error = ztest_replay_remove(zd, lr, B_FALSE)) != 0) { in ztest_remove()
2061 ztest_lr_free(lr, sizeof (*lr), od->od_name); in ztest_remove()
2071 lr_write_t *lr; in ztest_write() local
2074 lr = ztest_lr_alloc(sizeof (*lr) + size, NULL); in ztest_write()
2076 lr->lr_foid = object; in ztest_write()
2077 lr->lr_offset = offset; in ztest_write()
2078 lr->lr_length = size; in ztest_write()
2079 lr->lr_blkoff = 0; in ztest_write()
2080 BP_ZERO(&lr->lr_blkptr); in ztest_write()
2082 bcopy(data, lr + 1, size); in ztest_write()
2084 error = ztest_replay_write(zd, lr, B_FALSE); in ztest_write()
2086 ztest_lr_free(lr, sizeof (*lr) + size, NULL); in ztest_write()
2094 lr_truncate_t *lr; in ztest_truncate() local
2097 lr = ztest_lr_alloc(sizeof (*lr), NULL); in ztest_truncate()
2099 lr->lr_foid = object; in ztest_truncate()
2100 lr->lr_offset = offset; in ztest_truncate()
2101 lr->lr_length = size; in ztest_truncate()
2103 error = ztest_replay_truncate(zd, lr, B_FALSE); in ztest_truncate()
2105 ztest_lr_free(lr, sizeof (*lr), NULL); in ztest_truncate()
2113 lr_setattr_t *lr; in ztest_setattr() local
2116 lr = ztest_lr_alloc(sizeof (*lr), NULL); in ztest_setattr()
2118 lr->lr_foid = object; in ztest_setattr()
2119 lr->lr_size = 0; in ztest_setattr()
2120 lr->lr_mode = 0; in ztest_setattr()
2122 error = ztest_replay_setattr(zd, lr, B_FALSE); in ztest_setattr()
2124 ztest_lr_free(lr, sizeof (*lr), NULL); in ztest_setattr()