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

Function ztest_range_lock

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

Source from the content-addressed store, hash-verified

1546}
1547
1548static rl_t *
1549ztest_range_lock(ztest_ds_t *zd, uint64_t object, uint64_t offset,
1550 uint64_t size, rl_type_t type)
1551{
1552 uint64_t hash = object ^ (offset % (ZTEST_RANGE_LOCKS + 1));
1553 rll_t *rll = &zd->zd_range_lock[hash & (ZTEST_RANGE_LOCKS - 1)];
1554 rl_t *rl;
1555
1556 rl = umem_alloc(sizeof (*rl), UMEM_NOFAIL);
1557 rl->rl_object = object;
1558 rl->rl_offset = offset;
1559 rl->rl_size = size;
1560 rl->rl_lock = rll;
1561
1562 ztest_rll_lock(rll, type);
1563
1564 return (rl);
1565}
1566
1567static void
1568ztest_range_unlock(rl_t *rl)

Callers 4

ztest_replay_writeFunction · 0.85
ztest_replay_truncateFunction · 0.85
ztest_get_dataFunction · 0.85
ztest_preallocFunction · 0.85

Calls 2

umem_allocFunction · 0.85
ztest_rll_lockFunction · 0.85

Tested by

no test coverage detected