Motr  M0
helper.h File Reference
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/time.h>
#include "conf/obj.h"
#include "fid/fid.h"
#include "motr/client.h"
#include "motr/idx.h"
Include dependency graph for helper.h:

Go to the source code of this file.

Data Structures

struct  m0_cc_io_args
 
struct  m0_utility_param
 
struct  m0_copy_mt_args
 
struct  m0_obj_lock_ops
 

Macros

#define __MOTR_ST_UTILS_HELPER_H__
 

Enumerations

enum  { M0_MAX_BLOCK_COUNT = 100 }
 
enum  { BLK_SIZE_4k = 4096, BLK_SIZE_32m = 32 * 1024 * 1024 }
 
enum  { WIDTH = 32 }
 

Functions

int client_init (struct m0_config *config, struct m0_container *container, struct m0_client **m0_instance)
 
void client_fini (struct m0_client *m0_instance)
 
int touch (struct m0_container *container, struct m0_uint128 id, bool take_locks)
 
int m0_write (struct m0_container *container, char *src, struct m0_uint128 id, uint32_t block_size, uint32_t block_count, uint64_t update_offset, int blks_per_io, bool take_locks, bool update_mode)
 
int m0_read (struct m0_container *container, struct m0_uint128 id, char *dest, uint32_t block_size, uint32_t block_count, uint64_t offset, int blks_per_io, bool take_locks, uint32_t flags, struct m0_fid *read_pver)
 
int m0_truncate (struct m0_container *container, struct m0_uint128 id, uint32_t block_size, uint32_t trunc_count, uint32_t trunc_len, int blks_per_io, bool take_locks)
 
int m0_unlink (struct m0_container *container, struct m0_uint128 id, bool take_locks)
 
int m0_write_cc (struct m0_container *container, char **src, struct m0_uint128 id, int *index, uint32_t block_size, uint32_t block_count)
 
int m0_read_cc (struct m0_container *container, struct m0_uint128 id, char **dest, int *index, uint32_t block_size, uint32_t block_count)
 
int m0_obj_id_sscanf (char *idstr, struct m0_uint128 *obj_id)
 
int m0_utility_args_init (int argc, char **argv, struct m0_utility_param *params, struct m0_idx_dix_config *dix_conf, struct m0_config *conf, void(*utility_usage)(FILE *, char *))
 

Macro Definition Documentation

◆ __MOTR_ST_UTILS_HELPER_H__

#define __MOTR_ST_UTILS_HELPER_H__

Definition at line 25 of file helper.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Max number of blocks in concurrent IO per thread. Currently Client can write at max 100 blocks in a single request. This will change in future.

Enumerator
M0_MAX_BLOCK_COUNT 

Definition at line 43 of file helper.h.

◆ anonymous enum

anonymous enum
Enumerator
BLK_SIZE_4k 

Min block size

BLK_SIZE_32m 

Max block size

Definition at line 45 of file helper.h.

◆ anonymous enum

anonymous enum
Enumerator
WIDTH 

Definition at line 53 of file helper.h.

Function Documentation

◆ client_fini()

void client_fini ( struct m0_client m0_instance)

Definition at line 194 of file helper.c.

Here is the call graph for this function:

◆ client_init()

int client_init ( struct m0_config config,
struct m0_container container,
struct m0_client **  m0_instance 
)

Definition at line 170 of file helper.c.

Here is the call graph for this function:

◆ m0_obj_id_sscanf()

int m0_obj_id_sscanf ( char *  idstr,
struct m0_uint128 obj_id 
)

Definition at line 199 of file helper.c.

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

◆ m0_read()

int m0_read ( struct m0_container container,
struct m0_uint128  id,
char *  dest,
uint32_t  block_size,
uint32_t  block_count,
uint64_t  offset,
int  blks_per_io,
bool  take_locks,
uint32_t  flags,
struct m0_fid read_pver 
)

Definition at line 466 of file helper.c.

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

◆ m0_read_cc()

int m0_read_cc ( struct m0_container container,
struct m0_uint128  id,
char **  dest,
int *  index,
uint32_t  block_size,
uint32_t  block_count 
)

Definition at line 814 of file helper.c.

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

◆ m0_truncate()

int m0_truncate ( struct m0_container container,
struct m0_uint128  id,
uint32_t  block_size,
uint32_t  trunc_count,
uint32_t  trunc_len,
int  blks_per_io,
bool  take_locks 
)

Definition at line 607 of file helper.c.

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

◆ m0_unlink()

int m0_unlink ( struct m0_container container,
struct m0_uint128  id,
bool  take_locks 
)

Definition at line 683 of file helper.c.

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

◆ m0_utility_args_init()

int m0_utility_args_init ( int  argc,
char **  argv,
struct m0_utility_param params,
struct m0_idx_dix_config dix_conf,
struct m0_config conf,
void(*)(FILE *, char *)  utility_usage 
)

Definition at line 915 of file helper.c.

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

◆ m0_write()

int m0_write ( struct m0_container container,
char *  src,
struct m0_uint128  id,
uint32_t  block_size,
uint32_t  block_count,
uint64_t  update_offset,
int  blks_per_io,
bool  take_locks,
bool  update_mode 
)

Definition at line 352 of file helper.c.

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

◆ m0_write_cc()

int m0_write_cc ( struct m0_container container,
char **  src,
struct m0_uint128  id,
int *  index,
uint32_t  block_size,
uint32_t  block_count 
)

Definition at line 741 of file helper.c.

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

◆ touch()

int touch ( struct m0_container container,
struct m0_uint128  id,
bool  take_locks 
)

Definition at line 310 of file helper.c.

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