28 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_CLIENT 59 memset(&
obj, 0,
sizeof(
obj));
113 rc = memcmp(d1, d2, step);
138 for (
i = 0;
i < nr_ops;
i++) {
161 &ext_r, &data_r,
NULL, 0, 0, &ops_r[0]);
162 if (ops_r[0] ==
NULL)
204 int stride,
int unit_size,
int nr_ops,
bool verify)
210 struct m0_op **ops_w;
235 for (
i = 0;
i < nr_ops;
i++) {
251 for (
i = 0;
i < nr_ops;
i++) {
254 &ext_w[
i], &data_w[
i],
NULL, 0, 0, &ops_w[
i]);
255 if (ops_w[
i] ==
NULL)
258 if (
i == 0)
goto CLEANUP;
263 for (
i = 0;
i < nr_ops;
i++) {
281 for (
i = 0;
i < nr_ops;
i++) {
282 if (ext_w !=
NULL && ext_w[
i].iv_vec.v_nr != 0)
303 #define write_objs(nr_objs, size, unit_size, verify) \ 311 struct m0_uint128 oid; \ 313 nr_units = size / unit_size; \ 314 nr_pargrps = nr_units / DEFAULT_PARGRP_DATA_UNIT_NUM; \ 316 for (i = 0; i < nr_objs; i++) { \ 317 rc = create_obj(&oid, unit_size); \ 318 ST_ASSERT_FATAL(rc == 0);\ 320 for (j = 0; j < nr_pargrps; j++) { \ 321 start = j * DEFAULT_PARGRP_DATA_UNIT_NUM; \ 322 rc = write_obj(oid, start, \ 323 DEFAULT_PARGRP_DATA_UNIT_NUM, \ 324 unit_size, 1, verify);\ 325 ST_ASSERT_FATAL(rc == 0); \ 329 start += DEFAULT_PARGRP_DATA_UNIT_NUM; \ 330 if (start >= nr_units) \ 333 rc = write_obj(oid, start, \ 334 nr_units - start, unit_size, 1, verify); \ 335 ST_ASSERT_FATAL(rc == 0); \ 374 nr_ops = 2^nr_rounds;
375 for (
i = 0;
i < nr_rounds;
i++) {
391 int strides[10] = {1, 3, 5, 7, 11, 13, 17, 19, 23, 29};
402 for (
i = 0;
i < 10;
i++) {
414 int nr_ops,
int nr_ent)
430 for (
i = 0;
i < nr_ops;
i++) {
445 for (j = 0; j < nr_ent; j++) {
454 if (ops_r[0] ==
NULL) {
493 #define INDEX(ivec, i) ((ivec)->iv_index[(i)]) 494 #define COUNT(ivec, i) ((ivec)->iv_vec.v_count[(i)]) 509 struct m0_op **ops_w;
534 for (j = 0; j < nr_ops; j++) {
543 for (
i = 0;
i < nr_ent;
i++) {
544 memset(data_w[j].
ov_buf[
i],
'A' +
i,
552 for (
i = 0;
i < nr_ent;
i+=2) {
555 memset(data_w[j].
ov_buf[
i],
'A' +
i + 1,
557 memset(data_w[j].
ov_buf[
i + 1],
'A' +
i,
563 for (
i = 0;
i < nr_ops;
i++) {
567 if (ops_w[
i] ==
NULL) {
578 for (
i = 0;
i < nr_ops;
i++) {
588 for (j = 0; j < nr_ops; j++)
589 for (
i = 0;
i < nr_ent;
i+=2) {
590 memset(data_w[j].
ov_buf[
i],
'A' +
i,
592 memset(data_w[j].
ov_buf[
i + 1],
'A' +
i + 1,
605 for (
i = 0;
i < nr_ops;
i++) {
606 if (ext_w !=
NULL && ext_w[
i].iv_vec.v_nr != 0)
648 nr_ops, nr_segs,
true);
675 for (
i = 0;
i < nr_rounds;
i++) {
733 #undef M0_TRACE_SUBSYSTEM
int st_entity_create(struct m0_fid *pool, struct m0_entity *entity, struct m0_op **op)
static int bufvec_cmp(struct m0_bufvec b1, struct m0_bufvec b2)
void st_op_free(struct m0_op *op)
M0_INTERNAL int m0_indexvec_alloc(struct m0_indexvec *ivec, uint32_t len)
static int st_write_fini(void)
static int write_unordered_obj(struct m0_uint128 oid, int start, int stride, int unit_size, int nr_ops, int nr_ent, bool verify)
const m0_time_t M0_TIME_NEVER
static void write_small_objs(void)
uint64_t m0_obj_unit_size_to_layout_id(int unit_size)
static void write_unorder_pargrp(void)
uint64_t m0_client_layout_id(const struct m0_client *instance)
M0_INTERNAL void m0_indexvec_free(struct m0_indexvec *ivec)
struct m0_addb_ctx m0_addb_ctx
M0_INTERNAL void * m0_bufvec_cursor_addr(struct m0_bufvec_cursor *cur)
const struct m0_uint128 M0_UBER_REALM
static void write_pargrps_rmw(void)
#define ST_ASSERT_FATAL(a)
M0_INTERNAL int m0_bufvec_alloc(struct m0_bufvec *bufvec, uint32_t num_segs, m0_bcount_t seg_size)
static uint32_t unit_size
M0_INTERNAL void m0_bufvec_free(struct m0_bufvec *bufvec)
M0_INTERNAL bool m0_bufvec_cursor_move(struct m0_bufvec_cursor *cur, m0_bcount_t count)
struct m0_container st_write_container
static void write_large_objs(void)
static int st_write_init(void)
void st_container_init(struct m0_container *con, struct m0_realm *parent, const struct m0_uint128 *id, struct m0_client *instance)
M0_INTERNAL m0_bcount_t m0_bufvec_cursor_step(const struct m0_bufvec_cursor *cur)
struct m0_entity re_entity
int oid_get(struct m0_uint128 *oid)
M0_INTERNAL void m0_bufvec_cursor_init(struct m0_bufvec_cursor *cur, const struct m0_bufvec *bvec)
#define write_objs(nr_objs, size, unit_size, verify)
static int write_obj(struct m0_uint128 oid, int start, int stride, int unit_size, int nr_ops, bool verify)
void console_printf(const char *fmt,...)
static void write_pargrps(void)
static void mem_free(const struct m0_be_btree *btree, struct m0_be_tx *tx, void *ptr)
static void write_medium_objs(void)
static int write_verify_unorder(struct m0_bufvec *data_w, struct m0_uint128 oid, int start, int stride, int unit_size, int nr_ops, int nr_ent)
void st_obj_init(struct m0_obj *obj, struct m0_realm *parent, const struct m0_uint128 *id, uint64_t layout_id)
void st_obj_op(struct m0_obj *obj, enum m0_obj_opcode opcode, struct m0_indexvec *ext, struct m0_bufvec *data, struct m0_bufvec *attr, uint64_t mask, uint32_t flags, struct m0_op **op)
#define MEM_ALLOC_ARR(arr, nr)
static int create_obj(struct m0_uint128 *oid, int unit_size)
m0_time_t m0_time_from_now(uint64_t secs, long ns)
struct m0_client * st_get_instance()
#define M0_CLIENT_THREAD_ENTER
static int start(struct m0_fom *fom)
void st_op_launch(struct m0_op **op, uint32_t nr)
void st_entity_fini(struct m0_entity *entity)
static void write_pargrps_in_parallel_ops(void)
static int write_verify(struct m0_bufvec *data_w, struct m0_uint128 oid, int start, int stride, int unit_size, int nr_ops)
void st_entity_open(struct m0_entity *entity)
int32_t st_op_wait(struct m0_op *op, uint64_t bits, m0_time_t to)
struct st_suite st_suite_m0_write
void st_op_fini(struct m0_op *op)
static void write_with_layout_id(void)