23 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_CLIENT 41 # include <linux/delay.h> 115 for (
i = 0;
i < blk_cnt;
i++) {
126 if(
rc != 0)
return rc;
129 if (
rc != 0)
return rc;
132 for (
i = 0;
i < blk_cnt;
i++) {
135 last_index += blk_size;
138 attr.ov_vec.v_count[
i] = 0;
142 memset(&
obj, 0,
sizeof obj);
291 orig_layout, &
ops[0]);
362 orig_layout, &
ops[0]);
447 for (
i = 0;
i < nr_layers;
i++) {
465 for (j = 0; j <
i; j++)
543 layout_to_check, &
ops[0]);
599 for (
i = 0;
i < nr_io_segs;
i++) {
620 for (
i = 0;
i < nr_io_segs;
i++) {
625 attr.ov_vec.v_count[
i] = 0;
629 memset(&
obj, 0,
sizeof obj);
663 for (
i = 0;
i < nr_kvp;
i++) {
688 memset(&idx, 0,
sizeof idx);
749 int nr_comp_exts = 0;
778 for (
i = 0;
i < nr_layers;
i++) {
780 for (j = 0; j < nr_comp_exts; j++) {
781 len = (j + 1) *1024 * 1024;
784 comp_exts[j].
ce_id = layer_ids[
i];
785 comp_exts[j].
ce_off = off;
786 comp_exts[j].
ce_len = len;
788 off += len + 1024 * 1024;
798 for (
i = 0;
i < nr_io_segs;
i++) {
841 for (
i = 0;
i < nr_layers;
i++) {
845 comp_ext.
ce_id = layer_ids[
i];
856 for (
i = 0;
i < nr_io_segs;
i++) {
897 for (
i = 0;
i < nr_layers;
i++) {
900 comp_ext.
ce_id = layer_ids[
i];
912 for (
i = 0;
i < nr_io_segs;
i++) {
914 if (
i == nr_io_segs - 1)
931 int nr_comp_exts = 0;
972 orig_layout, &
ops[0]);
1018 for (
i = 0;
i < nr_comp_exts;
i++) {
1019 len = (
i + 1) *1024 * 1024;
1022 comp_exts[
i].
ce_id = cap_id;
1026 off += len + 1024 * 1024;
1035 for (
i = 0;
i < nr_io_segs;
i++) {
1058 int nr_comp_exts = 0;
1082 for (
i = 0;
i < nr_layers;
i++) {
1087 for (j = 0; j < nr_comp_exts; j++) {
1088 len = (j + 1) *1024 * 1024;
1091 comp_exts[j].
ce_id = layer_ids[
i];
1092 comp_exts[j].
ce_off = off;
1093 comp_exts[j].
ce_len = len;
1095 off += len + 1024 * 1024;
1145 {
"layout_op_get_obj",
1149 {
"layout_capture_io",
1151 {
"layout_composite_create",
1153 {
"layout_composite_create_then_get",
1155 {
"layout_composite_extent_idx",
1157 {
"layout_composite_io_one_layer",
1159 {
"layout_composite_io_multi_layers",
1161 {
"layout_composite_io_overlapping_layers",
1163 {
"layout_composite_io_on_capture_layer",
1169 #undef M0_TRACE_SUBSYSTEM
int st_entity_create(struct m0_fid *pool, struct m0_entity *entity, struct m0_op **op)
#define M0_ALLOC_ARR(arr, nr)
static int st_layout_suite_fini(void)
enum m0_client_layout_type m0_obj_layout_type(struct m0_obj *obj)
void st_op_free(struct m0_op *op)
M0_INTERNAL int m0_indexvec_alloc(struct m0_indexvec *ivec, uint32_t len)
static int fill_ext_kv_pairs(struct composite_extent *exts, int nr_exts, struct m0_bufvec *keys, struct m0_bufvec *vals)
const m0_time_t M0_TIME_NEVER
static void layout_composite_io_overlapping_layers(void)
static int layout_composite_create_obj(struct m0_client_layout *layout, struct m0_uint128 *ret_id)
#define MEM_ALLOC_PTR(arr)
int const char const void * value
uint64_t m0_client_layout_id(const struct m0_client *instance)
M0_INTERNAL void m0_indexvec_free(struct m0_indexvec *ivec)
static int do_add_extents(struct m0_uint128 id, struct m0_bufvec *keys, struct m0_bufvec *vals, int *rcs)
static int write_obj(struct m0_uint128 id)
int st_idx_op(struct m0_idx *idx, enum m0_idx_opcode opcode, struct m0_bufvec *keys, struct m0_bufvec *vals, int *rcs, int flag, struct m0_op **op)
const struct m0_uint128 M0_UBER_REALM
static int layout_create_capture_obj(struct m0_client_layout *layout, struct m0_uint128 *ret_id)
#define ST_ASSERT_FATAL(a)
static void layout_composite_create_then_get(void)
const struct m0_uint128 M0_ID_APP
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)
struct m0_entity in_entity
static void layout_op_get_obj(void)
struct m0_client_layout * m0_client_layout_alloc(enum m0_client_layout_type type)
#define M0_AMB(obj, ptr, field)
static uint64_t layout_id
static int st_layout_suite_init(void)
static void attr(struct m0_addb2__context *ctx, const uint64_t *v, char *buf)
struct m0_entity re_entity
int oid_get(struct m0_uint128 *oid)
void m0_client_layout_free(struct m0_client_layout *layout)
int m0_composite_layer_idx(struct m0_uint128 layer_id, bool write, struct m0_idx *idx)
int m0_composite_layer_idx_key_to_buf(struct m0_composite_layer_idx_key *key, void **out_kbuf, m0_bcount_t *out_klen)
static void layout_capture(void)
struct m0_client_layout ccl_layout
void * m0_alloc(size_t size)
void m0_composite_layer_del(struct m0_client_layout *layout, struct m0_uint128 subobj_id)
struct m0_container st_layout_container
static int layout_composite_add_layers(struct m0_client_layout *layout, int nr_layers, struct m0_uint128 *layer_ids)
void console_printf(const char *fmt,...)
static void mem_free(const struct m0_be_btree *btree, struct m0_be_tx *tx, void *ptr)
static void layout_composite_extent_idx(void)
struct st_suite st_suite_layout
void st_obj_init(struct m0_obj *obj, struct m0_realm *parent, const struct m0_uint128 *id, uint64_t layout_id)
static void layout_composite_io_one_layer(void)
static char pattern[CHAR_NUM]
static struct m0_uint128 test_id
static int create_obj(struct m0_uint128 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)
static int add_extents(struct m0_uint128 id, int nr_exts, struct composite_extent *exts)
#define M0_ALLOC_PTR(ptr)
static void layout_composite_io_on_capture_layer(void)
int m0_composite_layer_add(struct m0_client_layout *layout, struct m0_obj *sub_obj, int priority)
struct m0_client * st_get_instance()
#define M0_CLIENT_THREAD_ENTER
struct m0_entity ob_entity
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)
static void layout_composite_create(void)
int m0_client_layout_capture(struct m0_client_layout *layout, struct m0_obj *obj, struct m0_client_layout **out)
void m0_container_init(struct m0_container *con, struct m0_realm *parent, const struct m0_uint128 *id, struct m0_client *instance)
void st_entity_open(struct m0_entity *entity)
static void layout_capture_io(void)
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 void layout_composite_io_multi_layers(void)
static int write_io_segs(struct m0_uint128 id, int nr_io_segs, struct io_seg *io_segs)
int m0_composite_layer_idx_val_to_buf(struct m0_composite_layer_idx_val *val, void **out_vbuf, m0_bcount_t *out_vlen)
M0_INTERNAL int m0_bufvec_empty_alloc(struct m0_bufvec *bufvec, uint32_t num_segs)
int st_layout_op(struct m0_obj *obj, enum m0_entity_opcode opcode, struct m0_client_layout *layout, struct m0_op **op)