Motr  M0
example1.c File Reference
#include "motr/client.h"
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
Include dependency graph for example1.c:

Go to the source code of this file.

Functions

static int object_create (struct m0_container *container)
 
static int object_open (struct m0_obj *obj)
 
static int alloc_vecs (struct m0_indexvec *ext, struct m0_bufvec *data, struct m0_bufvec *attr, uint32_t block_count, uint32_t block_size)
 
static void prepare_ext_vecs (struct m0_indexvec *ext, struct m0_bufvec *data, struct m0_bufvec *attr, uint32_t block_count, uint32_t block_size, uint64_t *last_index, char c)
 
static void cleanup_vecs (struct m0_indexvec *ext, struct m0_bufvec *data, struct m0_bufvec *attr)
 
static int write_data_to_object (struct m0_obj *obj, struct m0_indexvec *ext, struct m0_bufvec *data, struct m0_bufvec *attr)
 
static int object_write (struct m0_container *container)
 
static int read_data_from_object (struct m0_obj *obj, struct m0_indexvec *ext, struct m0_bufvec *data, struct m0_bufvec *attr)
 
static void verify_show_data (struct m0_bufvec *data, char c)
 
static int object_read (struct m0_container *container)
 
static int object_delete (struct m0_container *container)
 
int main (int argc, char *argv[])
 

Variables

static struct m0_clientm0_instance = NULL
 
static struct m0_container motr_container
 
static struct m0_config motr_conf
 
static struct m0_idx_dix_config motr_dix_conf
 
struct m0_uint128 obj_id = { 0, 0 }
 

Function Documentation

◆ alloc_vecs()

static int alloc_vecs ( struct m0_indexvec ext,
struct m0_bufvec data,
struct m0_bufvec attr,
uint32_t  block_count,
uint32_t  block_size 
)
static

Definition at line 119 of file example1.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cleanup_vecs()

static void cleanup_vecs ( struct m0_indexvec ext,
struct m0_bufvec data,
struct m0_bufvec attr 
)
static

Definition at line 172 of file example1.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 394 of file example1.c.

Here is the call graph for this function:

◆ object_create()

static int object_create ( struct m0_container container)
static

Definition at line 55 of file example1.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ object_delete()

static int object_delete ( struct m0_container container)
static

Definition at line 358 of file example1.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ object_open()

static int object_open ( struct m0_obj obj)
static

Definition at line 91 of file example1.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ object_read()

static int object_read ( struct m0_container container)
static

Definition at line 310 of file example1.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ object_write()

static int object_write ( struct m0_container container)
static

Definition at line 214 of file example1.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ prepare_ext_vecs()

static void prepare_ext_vecs ( struct m0_indexvec ext,
struct m0_bufvec data,
struct m0_bufvec attr,
uint32_t  block_count,
uint32_t  block_size,
uint64_t *  last_index,
char  c 
)
static

Definition at line 150 of file example1.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_data_from_object()

static int read_data_from_object ( struct m0_obj obj,
struct m0_indexvec ext,
struct m0_bufvec data,
struct m0_bufvec attr 
)
static

Definition at line 259 of file example1.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ verify_show_data()

static void verify_show_data ( struct m0_bufvec data,
char  c 
)
static

Definition at line 291 of file example1.c.

Here is the caller graph for this function:

◆ write_data_to_object()

static int write_data_to_object ( struct m0_obj obj,
struct m0_indexvec ext,
struct m0_bufvec data,
struct m0_bufvec attr 
)
static

Definition at line 182 of file example1.c.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ m0_instance

struct m0_client* m0_instance = NULL
static

Definition at line 48 of file example1.c.

◆ motr_conf

struct m0_config motr_conf
static

Definition at line 50 of file example1.c.

◆ motr_container

struct m0_container motr_container
static

Definition at line 49 of file example1.c.

◆ motr_dix_conf

struct m0_idx_dix_config motr_dix_conf
static

Definition at line 51 of file example1.c.

◆ obj_id

struct m0_uint128 obj_id = { 0, 0 }

Definition at line 53 of file example1.c.