* Lookup or create the objects for a test using the od template. * If the objects do not all exist, or if 'remove' is specified, * remove any existing objects and create new ones. Otherwise, * use the existing objects. */
| 2718 | * use the existing objects. |
| 2719 | */ |
| 2720 | static int |
| 2721 | ztest_object_init(ztest_ds_t *zd, ztest_od_t *od, size_t size, boolean_t remove) |
| 2722 | { |
| 2723 | int count = size / sizeof (*od); |
| 2724 | int rv = 0; |
| 2725 | |
| 2726 | mutex_enter(&zd->zd_dirobj_lock); |
| 2727 | if ((ztest_lookup(zd, od, count) != 0 || remove) && |
| 2728 | (ztest_remove(zd, od, count) != 0 || |
| 2729 | ztest_create(zd, od, count) != 0)) |
| 2730 | rv = -1; |
| 2731 | zd->zd_od = od; |
| 2732 | mutex_exit(&zd->zd_dirobj_lock); |
| 2733 | |
| 2734 | return (rv); |
| 2735 | } |
| 2736 | |
| 2737 | /* ARGSUSED */ |
| 2738 | void |
no test coverage detected