23 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_CLIENT 47 bool *obj_exists =
NULL;
48 bool *already_chosen =
NULL;
75 for (
i = 0;
i < max_ops;
i++)
84 for (
i = 0;
i < n_objs; ++
i)
88 for (
i = 0;
i < rounds; ++
i) {
91 memset(already_chosen, 0, n_objs*
sizeof(already_chosen[0]));
94 for (j = 0; j < n_ops; ++j) {
99 }
while(already_chosen[idx]);
100 already_chosen[idx] =
true;
106 if (obj_exists[idx]) {
109 &objs[idx].ob_entity, &
ops[j]);
110 obj_exists[idx] =
false;
114 NULL, &objs[idx].ob_entity, &
ops[j]);
115 obj_exists[idx] =
true;
126 for (j = 0; j < n_ops; ++j) {
140 for (
i = 0;
i < max_ops; ++
i)
143 for (
i = 0;
i < n_objs; ++
i)
154 if (obj_exists !=
NULL)
156 if (already_chosen !=
NULL)
165 enum { CREATE_MULTIPLE_N_OBJS = 20 };
176 for (
i = 0;
i < CREATE_MULTIPLE_N_OBJS; ++
i) {
179 memset(objs[
i], 0,
sizeof *objs[
i]);
185 for (
i = 0;
i < CREATE_MULTIPLE_N_OBJS; ++
i) {
190 &objs[
i]->ob_entity, &
ops[
i]);
199 for (
i = 0;
i < CREATE_MULTIPLE_N_OBJS; ++
i) {
207 for (
i = 0;
i < CREATE_MULTIPLE_N_OBJS; ++
i) {
251 {
"example_abitmorecomplicated",
257 #undef M0_TRACE_SUBSYSTEM int st_entity_create(struct m0_fid *pool, struct m0_entity *entity, struct m0_op **op)
static void example_simple(void)
void st_op_free(struct m0_op *op)
const m0_time_t M0_TIME_NEVER
static struct m0_uint128 test_id
#define MEM_ALLOC_PTR(arr)
static void example_abitmorecomplicated(void)
uint64_t m0_client_layout_id(const struct m0_client *instance)
uint64_t oid_get_many(struct m0_uint128 *oids, uint64_t nr_oids)
static int st_example_fini(void)
const struct m0_uint128 M0_UBER_REALM
#define ST_ASSERT_FATAL(a)
const struct m0_uint128 M0_ID_APP
static int st_example_init(void)
void st_container_init(struct m0_container *con, struct m0_realm *parent, const struct m0_uint128 *id, struct m0_client *instance)
struct m0_entity re_entity
int oid_get(struct m0_uint128 *oid)
struct st_suite st_suite_example
void console_printf(const char *fmt,...)
static void mem_free(const struct m0_be_btree *btree, struct m0_be_tx *tx, void *ptr)
struct m0_addb2__id_intrp ids[]
void st_obj_init(struct m0_obj *obj, struct m0_realm *parent, const struct m0_uint128 *id, uint64_t layout_id)
#define MEM_ALLOC_ARR(arr, nr)
struct m0_client * st_get_instance()
#define M0_CLIENT_THREAD_ENTER
void st_op_launch(struct m0_op **op, uint32_t nr)
void st_entity_fini(struct m0_entity *entity)
uint32_t generate_random(uint32_t max)
int st_entity_delete(struct m0_entity *entity, struct m0_op **op)
struct m0_container st_example_container
void st_entity_open(struct m0_entity *entity)
int32_t st_op_wait(struct m0_op *op, uint64_t bits, m0_time_t to)
void st_op_fini(struct m0_op *op)
static uint64_t layout_id
uint64_t time_from_now(uint64_t secs, uint64_t ns)