ARGSUSED */
| 5310 | |
| 5311 | /* ARGSUSED */ |
| 5312 | void |
| 5313 | ztest_zap_parallel(ztest_ds_t *zd, uint64_t id) |
| 5314 | { |
| 5315 | objset_t *os = zd->zd_os; |
| 5316 | ztest_od_t *od; |
| 5317 | uint64_t txg, object, count, wsize, wc, zl_wsize, zl_wc; |
| 5318 | dmu_tx_t *tx; |
| 5319 | int i, namelen, error; |
| 5320 | int micro = ztest_random(2); |
| 5321 | char name[20], string_value[20]; |
| 5322 | void *data; |
| 5323 | |
| 5324 | od = umem_alloc(sizeof (ztest_od_t), UMEM_NOFAIL); |
| 5325 | ztest_od_init(od, ID_PARALLEL, FTAG, micro, DMU_OT_ZAP_OTHER, 0, 0, 0); |
| 5326 | |
| 5327 | if (ztest_object_init(zd, od, sizeof (ztest_od_t), B_FALSE) != 0) { |
| 5328 | umem_free(od, sizeof (ztest_od_t)); |
| 5329 | return; |
| 5330 | } |
| 5331 | |
| 5332 | object = od->od_object; |
| 5333 | |
| 5334 | /* |
| 5335 | * Generate a random name of the form 'xxx.....' where each |
| 5336 | * x is a random printable character and the dots are dots. |
| 5337 | * There are 94 such characters, and the name length goes from |
| 5338 | * 6 to 20, so there are 94^3 * 15 = 12,458,760 possible names. |
| 5339 | */ |
| 5340 | namelen = ztest_random(sizeof (name) - 5) + 5 + 1; |
| 5341 | |
| 5342 | for (i = 0; i < 3; i++) |
| 5343 | name[i] = '!' + ztest_random('~' - '!' + 1); |
| 5344 | for (; i < namelen - 1; i++) |
| 5345 | name[i] = '.'; |
| 5346 | name[i] = '\0'; |
| 5347 | |
| 5348 | if ((namelen & 1) || micro) { |
| 5349 | wsize = sizeof (txg); |
| 5350 | wc = 1; |
| 5351 | data = &txg; |
| 5352 | } else { |
| 5353 | wsize = 1; |
| 5354 | wc = namelen; |
| 5355 | data = string_value; |
| 5356 | } |
| 5357 | |
| 5358 | count = -1ULL; |
| 5359 | VERIFY0(zap_count(os, object, &count)); |
| 5360 | ASSERT(count != -1ULL); |
| 5361 | |
| 5362 | /* |
| 5363 | * Select an operation: length, lookup, add, update, remove. |
| 5364 | */ |
| 5365 | i = ztest_random(5); |
| 5366 | |
| 5367 | if (i >= 2) { |
| 5368 | tx = dmu_tx_create(os); |
| 5369 | dmu_tx_hold_zap(tx, object, B_TRUE, NULL); |
nothing calls this directly
no test coverage detected