Motr  M0
libdemo.c File Reference
#include "lib/trace.h"
#include "lib/memory.h"
#include "lib/string.h"
#include "lib/misc.h"
#include "lib/buf.h"
#include "fid/fid.h"
#include "fop/fom.h"
#include "stob/io.h"
#include "iscservice/isc.h"
#include "util.h"
#include "common.h"
#include "libdemo.h"
#include "libdemo_xc.h"
Include dependency graph for libdemo.c:

Go to the source code of this file.

Enumerations

enum  op { MIN, MAX }
 

Functions

static bool is_valid_string (struct m0_buf *in)
 
int hello_world (struct m0_buf *in, struct m0_buf *out, struct m0_isc_comp_private *comp_data, int *rc)
 
int launch_io (struct m0_isc_comp_private *pdata, struct m0_buf *in, int *rc)
 
int compute_minmax (enum op op, struct m0_isc_comp_private *pdata, struct m0_buf *out, int *rc)
 
int do_minmax (enum op op, struct m0_buf *in, struct m0_buf *out, struct m0_isc_comp_private *data, int *rc)
 
int comp_min (struct m0_buf *in, struct m0_buf *out, struct m0_isc_comp_private *comp_data, int *rc)
 
int comp_max (struct m0_buf *in, struct m0_buf *out, struct m0_isc_comp_private *comp_data, int *rc)
 
static void comp_reg (const char *f_name, int(*ftn)(struct m0_buf *arg_in, struct m0_buf *args_out, struct m0_isc_comp_private *comp_data, int *rc))
 
void motr_lib_init (void)
 

Enumeration Type Documentation

◆ op

enum op
Enumerator
MIN 
MAX 

Definition at line 64 of file libdemo.c.

Function Documentation

◆ comp_max()

int comp_max ( struct m0_buf in,
struct m0_buf out,
struct m0_isc_comp_private comp_data,
int *  rc 
)

Definition at line 228 of file libdemo.c.

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

◆ comp_min()

int comp_min ( struct m0_buf in,
struct m0_buf out,
struct m0_isc_comp_private comp_data,
int *  rc 
)

Compute minimum value in the unit data.

The computation function interface is defined at isc.h: the arguments and result are xcoded at and buffers, contains private data for the computation which is preserved between the two calls of this function (before reading the data from the storage device and after the read is finished). contains the result of the computation.

Returns
M0_FSO_WAIT after read I/O is started (rc should be == -EAGAIN also)
M0_FSO_AGAIN after the computation is complete

Definition at line 222 of file libdemo.c.

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

◆ comp_reg()

static void comp_reg ( const char *  f_name,
int(*)(struct m0_buf *arg_in, struct m0_buf *args_out, struct m0_isc_comp_private *comp_data, int *rc ftn 
)
static

Definition at line 234 of file libdemo.c.

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

◆ compute_minmax()

int compute_minmax ( enum op  op,
struct m0_isc_comp_private pdata,
struct m0_buf out,
int *  rc 
)

Definition at line 94 of file libdemo.c.

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

◆ do_minmax()

int do_minmax ( enum op  op,
struct m0_buf in,
struct m0_buf out,
struct m0_isc_comp_private data,
int *  rc 
)

Do the computation of min/max.

This function is called two times by the ISC-implementation. The 1st time we start the I/O to read the data from the object unit, and return M0_FSO_WAIT and -EAGAIN in rc argument as an indication that the function should be called again when the data is ready. When I/O is complete and the data is ready, the function is called again so we can actually do the computation.

Definition at line 183 of file libdemo.c.

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

◆ hello_world()

int hello_world ( struct m0_buf in,
struct m0_buf out,
struct m0_isc_comp_private comp_data,
int *  rc 
)

Definition at line 41 of file libdemo.c.

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

◆ is_valid_string()

static bool is_valid_string ( struct m0_buf in)
static

Definition at line 35 of file libdemo.c.

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

◆ launch_io()

int launch_io ( struct m0_isc_comp_private pdata,
struct m0_buf in,
int *  rc 
)

Definition at line 66 of file libdemo.c.

Here is the caller graph for this function:

◆ motr_lib_init()

void motr_lib_init ( void  )

Definition at line 250 of file libdemo.c.

Here is the call graph for this function: