Motr  M0
main.c File Reference
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include "fol/fol.h"
#include "stob/ad.h"
#include "stob/ad_private.h"
#include "rpc/rpc_opcodes.h"
#include "dix/layout.h"
#include "dix/client.h"
#include "dix/meta.h"
#include "fid/fid.h"
#include "lib/types.h"
#include "lib/getopts.h"
#include "lib/thread.h"
#include "lib/hash_fnc.h"
#include "lib/uuid.h"
#include "lib/string.h"
#include "lib/ext.h"
#include "lib/vec.h"
#include "module/instance.h"
#include "pool/pool.h"
#include "conf/confc.h"
#include "net/lnet/lnet.h"
#include "mero/ha.h"
#include "rpc/rpc_machine.h"
#include "rpc/rpc.h"
#include "reqh/reqh.h"
#include "rm/rm_service.h"
#include "net/buffer_pool.h"
#include "fdmi/fdmi.h"
#include "fdmi/service.h"
#include "fdmi/plugin_dock.h"
#include "fdmi/plugin_dock_internal.h"
#include <clovis/clovis.h>
#include <clovis/clovis_cont.h>
#include <clovis/clovis_internal.h>
Include dependency graph for main.c:

Go to the source code of this file.

Data Structures

struct  classify_msg
 
struct  fdmi_ctx
 

Macros

#define MALLOC_ARR(arr, nr)   ((arr) = malloc((nr) * sizeof ((arr)[0])))
 
#define THRESHOLD   (1024*1024)
 
#define READ_END   pipe_fds[0]
 
#define WRITE_END   pipe_fds[1]
 

Typedefs

typedef struct classify_msg classify_msg_t
 

Functions

void bufvec_free (struct m0_bufvec *bv)
 
struct m0_bufvecbufvec_alloc (int nr)
 
static void inspect_fol_record (struct m0_fol_rec *fol_rec)
 
static int inst_ha_init (struct fdmi_ctx *ctx, const char *ha_addr)
 
static void inst_ha_stop (struct fdmi_ctx *ctx)
 
static void inst_ha_fini (struct fdmi_ctx *ctx)
 
static int inst_net_init (struct fdmi_ctx *ctx, const char *local_addr)
 
static int inst_rpc_init (struct fdmi_ctx *ctx)
 
static void inst_rpc_fini (struct fdmi_ctx *ctx)
 
static void inst_net_fini (struct fdmi_ctx *ctx)
 
M0_INTERNAL struct m0_rconfcget_rconfc (struct fdmi_ctx *ctx)
 
static int inst_layouts_init (struct fdmi_ctx *ctx)
 
static void inst_layouts_fini (struct fdmi_ctx *ctx)
 
static int inst_service_start (struct m0_reqh_service_type *stype, struct m0_reqh *reqh)
 
static int inst_reqh_services_start (struct fdmi_ctx *ctx)
 
static int classify_handle_fdmi_rec_not (struct m0_uint128 *rec_id, struct m0_buf fdmi_rec, struct m0_fid filter_id)
 
int init_fdmi_plugin ()
 
static int inst_init (struct fdmi_ctx *ctx, const char *local_addr, const char *ha_addr, const char *profile)
 
int init_containers ()
 
void list_containers (struct m0_clovis_container *cont)
 
int fdmi_instance (const char *local_addr, const char *ha_addr, const char *prof)
 
int main (int argc, char **argv)
 

Variables

static int pipe_fds [2]
 
static struct m0_fid CLASSIFY_PLUGIN_FID
 
static uint32_t tm_recv_queue_min_len = 10
 
static uint32_t max_rpc_msg_size = M0_RPC_DEF_MAX_RPC_MSG_SIZE
 
static struct m0 instance
 
static struct fdmi_ctx ctx
 
static struct m0_clovis * m0c
 
struct m0_clovis_realm my_realm
 
static uint64_t default_layout
 
static struct m0_pool pool
 
static struct m0_clovis_container small_cont
 
static struct m0_clovis_container large_cont
 

Macro Definition Documentation

◆ MALLOC_ARR

#define MALLOC_ARR (   arr,
  nr 
)    ((arr) = malloc((nr) * sizeof ((arr)[0])))

Definition at line 41 of file main.c.

◆ READ_END

#define READ_END   pipe_fds[0]

Definition at line 48 of file main.c.

◆ THRESHOLD

#define THRESHOLD   (1024*1024)

Definition at line 44 of file main.c.

◆ WRITE_END

#define WRITE_END   pipe_fds[1]

Definition at line 49 of file main.c.

Typedef Documentation

◆ classify_msg_t

typedef struct classify_msg classify_msg_t

Function Documentation

◆ bufvec_alloc()

struct m0_bufvec* bufvec_alloc ( int  nr)

Definition at line 98 of file main.c.

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

◆ bufvec_free()

void bufvec_free ( struct m0_bufvec bv)

Definition at line 82 of file main.c.

Here is the caller graph for this function:

◆ classify_handle_fdmi_rec_not()

static int classify_handle_fdmi_rec_not ( struct m0_uint128 rec_id,
struct m0_buf  fdmi_rec,
struct m0_fid  filter_id 
)
static

Definition at line 317 of file main.c.

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

◆ fdmi_instance()

int fdmi_instance ( const char *  local_addr,
const char *  ha_addr,
const char *  prof 
)

Definition at line 503 of file main.c.

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

◆ get_rconfc()

M0_INTERNAL struct m0_rconfc* get_rconfc ( struct fdmi_ctx ctx)

Definition at line 267 of file main.c.

Here is the caller graph for this function:

◆ init_containers()

int init_containers ( )

Definition at line 474 of file main.c.

Here is the caller graph for this function:

◆ init_fdmi_plugin()

int init_fdmi_plugin ( )

Definition at line 334 of file main.c.

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

◆ inspect_fol_record()

static void inspect_fol_record ( struct m0_fol_rec fol_rec)
static

Definition at line 122 of file main.c.

Here is the caller graph for this function:

◆ inst_ha_fini()

static void inst_ha_fini ( struct fdmi_ctx ctx)
static

Definition at line 195 of file main.c.

Here is the caller graph for this function:

◆ inst_ha_init()

static int inst_ha_init ( struct fdmi_ctx ctx,
const char *  ha_addr 
)
static

Definition at line 166 of file main.c.

Here is the caller graph for this function:

◆ inst_ha_stop()

static void inst_ha_stop ( struct fdmi_ctx ctx)
static

Definition at line 189 of file main.c.

Here is the caller graph for this function:

◆ inst_init()

static int inst_init ( struct fdmi_ctx ctx,
const char *  local_addr,
const char *  ha_addr,
const char *  profile 
)
static

Definition at line 358 of file main.c.

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

◆ inst_layouts_fini()

static void inst_layouts_fini ( struct fdmi_ctx ctx)
static

Definition at line 280 of file main.c.

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

◆ inst_layouts_init()

static int inst_layouts_init ( struct fdmi_ctx ctx)
static

Definition at line 272 of file main.c.

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

◆ inst_net_fini()

static void inst_net_fini ( struct fdmi_ctx ctx)
static

Definition at line 262 of file main.c.

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

◆ inst_net_init()

static int inst_net_init ( struct fdmi_ctx ctx,
const char *  local_addr 
)
static

Definition at line 200 of file main.c.

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

◆ inst_reqh_services_start()

static int inst_reqh_services_start ( struct fdmi_ctx ctx)
static

Definition at line 297 of file main.c.

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

◆ inst_rpc_fini()

static void inst_rpc_fini ( struct fdmi_ctx ctx)
static

Definition at line 252 of file main.c.

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

◆ inst_rpc_init()

static int inst_rpc_init ( struct fdmi_ctx ctx)
static

Definition at line 206 of file main.c.

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

◆ inst_service_start()

static int inst_service_start ( struct m0_reqh_service_type stype,
struct m0_reqh reqh 
)
static

Definition at line 285 of file main.c.

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

◆ list_containers()

void list_containers ( struct m0_clovis_container *  cont)

Definition at line 497 of file main.c.

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 528 of file main.c.

Here is the call graph for this function:

Variable Documentation

◆ CLASSIFY_PLUGIN_FID

struct m0_fid CLASSIFY_PLUGIN_FID
static
Initial value:
= {
.f_container = M0_FDMI_REC_TYPE_FOL,
.f_key = 0x1
}

Definition at line 58 of file main.c.

◆ ctx

struct fdmi_ctx ctx
static

Definition at line 80 of file main.c.

◆ default_layout

uint64_t default_layout
static

Definition at line 467 of file main.c.

◆ instance

struct m0 instance
static

Definition at line 78 of file main.c.

◆ large_cont

struct m0_clovis_container large_cont
static

Definition at line 472 of file main.c.

◆ m0c

struct m0_clovis* m0c
static

Definition at line 465 of file main.c.

◆ max_rpc_msg_size

uint32_t max_rpc_msg_size = M0_RPC_DEF_MAX_RPC_MSG_SIZE
static

Definition at line 75 of file main.c.

◆ my_realm

struct m0_clovis_realm my_realm

Definition at line 466 of file main.c.

◆ pipe_fds

int pipe_fds[2]
static

Definition at line 47 of file main.c.

◆ pool

struct m0_pool pool
static

Definition at line 469 of file main.c.

◆ small_cont

struct m0_clovis_container small_cont
static

Definition at line 471 of file main.c.

◆ tm_recv_queue_min_len

uint32_t tm_recv_queue_min_len = 10
static

Definition at line 74 of file main.c.