MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ztest_write

Function ztest_write

freebsd/contrib/openzfs/cmd/ztest/ztest.c:2512–2534  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2510}
2511
2512static int
2513ztest_write(ztest_ds_t *zd, uint64_t object, uint64_t offset, uint64_t size,
2514 void *data)
2515{
2516 lr_write_t *lr;
2517 int error;
2518
2519 lr = ztest_lr_alloc(sizeof (*lr) + size, NULL);
2520
2521 lr->lr_foid = object;
2522 lr->lr_offset = offset;
2523 lr->lr_length = size;
2524 lr->lr_blkoff = 0;
2525 BP_ZERO(&lr->lr_blkptr);
2526
2527 bcopy(data, lr + 1, size);
2528
2529 error = ztest_replay_write(zd, lr, B_FALSE);
2530
2531 ztest_lr_free(lr, sizeof (*lr) + size, NULL);
2532
2533 return (error);
2534}
2535
2536static int
2537ztest_truncate(ztest_ds_t *zd, uint64_t object, uint64_t offset, uint64_t size)

Callers 2

ztest_ioFunction · 0.85
ztest_dmu_preallocFunction · 0.85

Calls 3

ztest_lr_allocFunction · 0.85
ztest_replay_writeFunction · 0.85
ztest_lr_freeFunction · 0.85

Tested by

no test coverage detected