Motr  M0
DLD_bulk_server_fspec_ios_operations

Data Structures

struct  mds_op
 

Macros

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_IOSERVICE
 

Enumerations

enum  { RPC_TIMEOUT = 8, MAX_NR_RPC_IN_FLIGHT = 100 }
 

Functions

 M0_TL_DESCR_DEFINE (bufferpools, "rpc machines associated with reqh", M0_INTERNAL, struct m0_rios_buffer_pool, rios_bp_linkage, rios_bp_magic, M0_IOS_BUFFER_POOL_MAGIC, M0_IOS_BUFFER_POOL_HEAD_MAGIC)
 
 M0_TL_DEFINE (bufferpools, M0_INTERNAL, struct m0_rios_buffer_pool)
 
static int ios_allocate (struct m0_reqh_service **service, const struct m0_reqh_service_type *stype)
 
static void ios_fini (struct m0_reqh_service *service)
 
static int ios_start (struct m0_reqh_service *service)
 
static int ios_start_async (struct m0_reqh_service_start_async_ctx *asc)
 
static bool ios_start_async_cb (struct m0_clink *clink)
 
static void ios_prepare_to_stop (struct m0_reqh_service *service)
 
static void ios_stop (struct m0_reqh_service *service)
 
static void buffer_pool_not_empty (struct m0_net_buffer_pool *bp)
 
static void buffer_pool_low (struct m0_net_buffer_pool *bp)
 
M0_INTERNAL int m0_ios_register (void)
 
M0_INTERNAL void m0_ios_unregister (void)
 
M0_INTERNAL bool m0_reqh_io_service_invariant (const struct m0_reqh_io_service *rios)
 
M0_INTERNAL int m0_ios_create_buffer_pool (struct m0_reqh_service *service)
 
M0_INTERNAL void m0_ios_delete_buffer_pool (struct m0_reqh_service *service)
 
M0_INTERNAL void m0_ios_cdom_get (struct m0_reqh *reqh, struct m0_cob_domain **out)
 
M0_INTERNAL void m0_ios_cdom_fini (struct m0_reqh *reqh)
 
 M0_TL_DESCR_DECLARE (cs_eps, extern)
 
 M0_TL_DECLARE (cs_eps, M0_INTERNAL, struct cs_endpoint_and_xprt)
 
static int m0_ios_mds_conn_init (struct m0_reqh *reqh, struct m0_ios_mds_conn_map *conn_map)
 
static int ios_mds_conn_get_locked (struct m0_reqh *reqh, struct m0_ios_mds_conn_map **out, bool *new)
 
static int m0_ios_mds_conn_get (struct m0_reqh *reqh, struct m0_ios_mds_conn_map **out)
 
static struct m0_ios_mds_connm0_ios_mds_conn_map_hash (const struct m0_ios_mds_conn_map *imc_map, const struct m0_fid *gfid)
 
M0_INTERNAL void m0_ios_mds_conn_fini (struct m0_reqh *reqh)
 
M0_INTERNAL int m0_ios_mds_getattr (struct m0_reqh *reqh, const struct m0_fid *gfid, struct m0_cob_attr *attr)
 
static int _rpc_post (struct m0_fop *fop, struct m0_rpc_session *session)
 
static void mds_op_release (struct m0_ref *ref)
 
static void getattr_rpc_item_reply_cb (struct m0_rpc_item *item)
 
static void ios_cob_fop_populate (struct m0_fop *fop, const struct m0_fid *cob_fid, const struct m0_fid *gob_fid, uint32_t cob_idx, uint32_t cob_type)
 
M0_INTERNAL int m0_ios_getattr (struct m0_reqh *reqh, const struct m0_fid *gfid, uint64_t index, struct m0_cob_attr *attr)
 
static int _ios_cob_getattr_async (struct m0_rpc_session *rpc_session, struct m0_fid *cob_fid, const struct m0_fid *gfid, struct m0_cob_attr *attr, uint32_t index, uint32_t cob_type, void(*cb)(void *arg, int rc), void *arg)
 
M0_INTERNAL int m0_ios_cob_getattr_async (const struct m0_fid *gfid, struct m0_cob_attr *attr, uint64_t cob_idx, struct m0_pool_version *pv, void(*cb)(void *arg, int rc), void *arg)
 
M0_INTERNAL int m0_ios_getattr_async (struct m0_reqh *reqh, const struct m0_fid *gfid, struct m0_cob_attr *attr, uint64_t index, void(*cb)(void *arg, int rc), void *arg)
 
M0_INTERNAL int m0_ios_mds_getattr_async (struct m0_reqh *reqh, const struct m0_fid *gfid, struct m0_cob_attr *attr, void(*cb)(void *arg, int rc), void *arg)
 
M0_INTERNAL void m0_ios_net_buffer_pool_size_set (uint32_t buffer_pool_size)
 

Variables

static uint32_t ios_net_buffer_pool_size = 32
 
static unsigned ios_mds_conn_key = 0
 
static const struct m0_reqh_service_type_ops ios_type_ops
 
static const struct m0_reqh_service_ops ios_ops
 
struct m0_net_buffer_pool_ops buffer_pool_ops
 
struct m0_reqh_service_type m0_ios_type
 
enum { ... }  M0_XCA_DOMAIN
 
static const struct m0_rpc_item_ops getattr_fop_rpc_item_ops
 

Detailed Description

Macro Definition Documentation

◆ M0_TRACE_SUBSYSTEM

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_IOSERVICE

Definition at line 27 of file io_service.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
RPC_TIMEOUT 
MAX_NR_RPC_IN_FLIGHT 

Definition at line 486 of file io_service.c.

Function Documentation

◆ _ios_cob_getattr_async()

static int _ios_cob_getattr_async ( struct m0_rpc_session rpc_session,
struct m0_fid cob_fid,
const struct m0_fid gfid,
struct m0_cob_attr attr,
uint32_t  index,
uint32_t  cob_type,
void(*)(void *arg, int rc cb,
void *  arg 
)
static

Definition at line 852 of file io_service.c.

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

◆ _rpc_post()

static int _rpc_post ( struct m0_fop fop,
struct m0_rpc_session session 
)
static

Definition at line 710 of file io_service.c.

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

◆ buffer_pool_low()

static void buffer_pool_low ( struct m0_net_buffer_pool bp)
static

Buffer pool operation function. This function gets called when network buffer availability hits lower threshold.

Parameters
bpbuffer pool pointer.
Precondition
bp != NULL

Definition at line 145 of file io_service.c.

◆ buffer_pool_not_empty()

static void buffer_pool_not_empty ( struct m0_net_buffer_pool bp)
static

Buffer pool operation function. This function gets called when buffer pool becomes non empty. It sends signal to FOM waiting for network buffer.

Parameters
bpbuffer pool pointer.
Precondition
bp != NULL

Definition at line 127 of file io_service.c.

Here is the call graph for this function:

◆ getattr_rpc_item_reply_cb()

static void getattr_rpc_item_reply_cb ( struct m0_rpc_item item)
static

Definition at line 750 of file io_service.c.

Here is the call graph for this function:

◆ ios_allocate()

static int ios_allocate ( struct m0_reqh_service **  service,
const struct m0_reqh_service_type stype 
)
static

Allocates and initiates I/O Service instance. This operation allocates & initiates service instance with its operation vector.

Parameters
stypeservice type
servicepointer to service instance.
Precondition
stype != NULL && service != NULL

Definition at line 326 of file io_service.c.

Here is the call graph for this function:

◆ ios_cob_fop_populate()

static void ios_cob_fop_populate ( struct m0_fop fop,
const struct m0_fid cob_fid,
const struct m0_fid gob_fid,
uint32_t  cob_idx,
uint32_t  cob_type 
)
static

Definition at line 789 of file io_service.c.

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

◆ ios_fini()

static void ios_fini ( struct m0_reqh_service service)
static

Finalise I/O Service instance. This operation finalises service instance and de-allocate it.

Parameters
servicepointer to service instance.
Precondition
service != NULL

Definition at line 354 of file io_service.c.

Here is the call graph for this function:

◆ ios_mds_conn_get_locked()

static int ios_mds_conn_get_locked ( struct m0_reqh reqh,
struct m0_ios_mds_conn_map **  out,
bool *  new 
)
static

Definition at line 548 of file io_service.c.

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

◆ ios_prepare_to_stop()

static void ios_prepare_to_stop ( struct m0_reqh_service service)
static

Definition at line 441 of file io_service.c.

Here is the call graph for this function:

◆ ios_start()

static int ios_start ( struct m0_reqh_service service)
static

Definition at line 366 of file io_service.c.

Here is the call graph for this function:

◆ ios_start_async()

static int ios_start_async ( struct m0_reqh_service_start_async_ctx asc)
static

Definition at line 395 of file io_service.c.

Here is the call graph for this function:

◆ ios_start_async_cb()

static bool ios_start_async_cb ( struct m0_clink clink)
static

Definition at line 421 of file io_service.c.

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

◆ ios_stop()

static void ios_stop ( struct m0_reqh_service service)
static

Definition at line 448 of file io_service.c.

Here is the call graph for this function:

◆ m0_ios_cdom_fini()

M0_INTERNAL void m0_ios_cdom_fini ( struct m0_reqh reqh)

Definition at line 474 of file io_service.c.

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

◆ m0_ios_cdom_get()

M0_INTERNAL void m0_ios_cdom_get ( struct m0_reqh reqh,
struct m0_cob_domain **  out 
)
Todo:
: This function is used by copy machine module, but not used by IO service. Corresponding ticket: MOTR-1190.

Definition at line 463 of file io_service.c.

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

◆ m0_ios_cob_getattr_async()

M0_INTERNAL int m0_ios_cob_getattr_async ( const struct m0_fid gfid,
struct m0_cob_attr attr,
uint64_t  cob_idx,
struct m0_pool_version pv,
void(*)(void *arg, int rc cb,
void *  arg 
)

Definition at line 891 of file io_service.c.

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

◆ m0_ios_create_buffer_pool()

M0_INTERNAL int m0_ios_create_buffer_pool ( struct m0_reqh_service service)

Create & initialise instance of buffer pool per domain.

  1. This function scans rpc_machines from request handler and creates buffer pool instance for each network domain. It also creates color map for transfer machines for respective domain.
  2. Initialises all buffer pools and make provision for configured number of buffers for each buffer pool.
Parameters
servicepointer to service instance.
Precondition
service != NULL

Definition at line 202 of file io_service.c.

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

◆ m0_ios_delete_buffer_pool()

M0_INTERNAL void m0_ios_delete_buffer_pool ( struct m0_reqh_service service)

Delete instances of buffer pool. It go through buffer pool list and delete the instance.

Parameters
servicepointer to service instance.
Precondition
service != NULL

Definition at line 292 of file io_service.c.

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

◆ m0_ios_getattr()

M0_INTERNAL int m0_ios_getattr ( struct m0_reqh reqh,
const struct m0_fid gfid,
uint64_t  index,
struct m0_cob_attr attr 
)

Getattr of file from ioservice synchronously.

Definition at line 814 of file io_service.c.

Here is the call graph for this function:

◆ m0_ios_getattr_async()

M0_INTERNAL int m0_ios_getattr_async ( struct m0_reqh reqh,
const struct m0_fid gfid,
struct m0_cob_attr attr,
uint64_t  index,
void(*)(void *arg, int rc cb,
void *  arg 
)

getattr from ioservice asynchronously.

Definition at line 916 of file io_service.c.

Here is the call graph for this function:

◆ m0_ios_mds_conn_fini()

M0_INTERNAL void m0_ios_mds_conn_fini ( struct m0_reqh reqh)

Terminates and clears the ioservice to mdservice connection.

Definition at line 617 of file io_service.c.

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

◆ m0_ios_mds_conn_get()

static int m0_ios_mds_conn_get ( struct m0_reqh reqh,
struct m0_ios_mds_conn_map **  out 
)
static

Gets ioservice to mdservice connection. If it is newly allocated, establish the connection.

Parameters
outthe connection is returned here.
Note
This is a block operation in service. m0_fom_block_enter()/m0_fom_block_leave() must be used to notify fom.

Definition at line 579 of file io_service.c.

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

◆ m0_ios_mds_conn_init()

static int m0_ios_mds_conn_init ( struct m0_reqh reqh,
struct m0_ios_mds_conn_map conn_map 
)
static

Definition at line 494 of file io_service.c.

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

◆ m0_ios_mds_conn_map_hash()

static struct m0_ios_mds_conn* m0_ios_mds_conn_map_hash ( const struct m0_ios_mds_conn_map imc_map,
const struct m0_fid gfid 
)
static

Definition at line 600 of file io_service.c.

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

◆ m0_ios_mds_getattr()

M0_INTERNAL int m0_ios_mds_getattr ( struct m0_reqh reqh,
const struct m0_fid gfid,
struct m0_cob_attr attr 
)

Gets file attributes from mdservice.

Parameters
reqhthe request handler.
gfidthe global fid of the file.
attrthe returned attributes will be stored here.
Note
This is a block operation in service. m0_fom_block_enter()/m0_fom_block_leave() must be used to notify fom.

Definition at line 663 of file io_service.c.

Here is the call graph for this function:

◆ m0_ios_mds_getattr_async()

M0_INTERNAL int m0_ios_mds_getattr_async ( struct m0_reqh reqh,
const struct m0_fid gfid,
struct m0_cob_attr attr,
void(*)(void *arg, int rc cb,
void *  arg 
)

getattr from mdservice asynchronously.

Definition at line 940 of file io_service.c.

Here is the call graph for this function:

◆ m0_ios_net_buffer_pool_size_set()

M0_INTERNAL void m0_ios_net_buffer_pool_size_set ( uint32_t  buffer_pool_size)

Sets default values for buf_nr for m0_net_buffer_pool_provision() in ioservice.

Note
It sets a static variable, so this change is persistent across m0_init()/m0_fini().
See also
ios_net_buffer_pool_size

Definition at line 994 of file io_service.c.

Here is the caller graph for this function:

◆ m0_ios_register()

M0_INTERNAL int m0_ios_register ( void  )

Registers I/O service with motr node. Motr setup calls this function.

Definition at line 158 of file io_service.c.

Here is the call graph for this function:

◆ m0_ios_unregister()

M0_INTERNAL void m0_ios_unregister ( void  )

Unregisters I/O service from motr node.

Definition at line 174 of file io_service.c.

Here is the call graph for this function:

◆ m0_reqh_io_service_invariant()

M0_INTERNAL bool m0_reqh_io_service_invariant ( const struct m0_reqh_io_service rios)

Definition at line 183 of file io_service.c.

Here is the caller graph for this function:

◆ M0_TL_DECLARE()

M0_TL_DECLARE ( cs_eps  ,
M0_INTERNAL  ,
struct cs_endpoint_and_xprt   
)

◆ M0_TL_DEFINE()

M0_TL_DEFINE ( bufferpools  ,
M0_INTERNAL  ,
struct m0_rios_buffer_pool   
)

◆ M0_TL_DESCR_DECLARE()

M0_TL_DESCR_DECLARE ( cs_eps  ,
extern   
)

◆ M0_TL_DESCR_DEFINE()

M0_TL_DESCR_DEFINE ( bufferpools  ,
"rpc machines associated with reqh ,
M0_INTERNAL  ,
struct m0_rios_buffer_pool  ,
rios_bp_linkage  ,
rios_bp_magic  ,
M0_IOS_BUFFER_POOL_MAGIC  ,
M0_IOS_BUFFER_POOL_HEAD_MAGIC   
)

◆ mds_op_release()

static void mds_op_release ( struct m0_ref ref)
static

Definition at line 739 of file io_service.c.

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

Variable Documentation

◆ buffer_pool_ops

struct m0_net_buffer_pool_ops buffer_pool_ops
Initial value:
= {
.nbpo_not_empty = buffer_pool_not_empty,
.nbpo_below_threshold = buffer_pool_low,
}
static void buffer_pool_not_empty(struct m0_net_buffer_pool *bp)
Definition: io_service.c:127
static void buffer_pool_low(struct m0_net_buffer_pool *bp)
Definition: io_service.c:145

Buffer pool operations.

Definition at line 107 of file io_service.c.

◆ getattr_fop_rpc_item_ops

const struct m0_rpc_item_ops getattr_fop_rpc_item_ops
static
Initial value:
= {
.rio_replied = getattr_rpc_item_reply_cb,
}
static void getattr_rpc_item_reply_cb(struct m0_rpc_item *item)
Definition: io_service.c:750

Definition at line 785 of file io_service.c.

◆ ios_mds_conn_key

unsigned ios_mds_conn_key = 0
static

Key for ios mds connection.

Definition at line 71 of file io_service.c.

◆ ios_net_buffer_pool_size

uint32_t ios_net_buffer_pool_size = 32
static

These values are supposed to be fetched from configuration cache. Since configuration cache module is not available, these values are defined as a static variable.

See also
m0_ios_net_buffer_pool_size_set()

Definition at line 66 of file io_service.c.

◆ ios_ops

const struct m0_reqh_service_ops ios_ops
static
Initial value:
= {
.rso_start = ios_start,
.rso_start_async = ios_start_async,
.rso_prepare_to_stop = ios_prepare_to_stop,
.rso_stop = ios_stop,
.rso_fini = ios_fini
}
static void ios_fini(struct m0_reqh_service *service)
Definition: io_service.c:354
static void ios_stop(struct m0_reqh_service *service)
Definition: io_service.c:448
static int ios_start(struct m0_reqh_service *service)
Definition: io_service.c:366
static int ios_start_async(struct m0_reqh_service_start_async_ctx *asc)
Definition: io_service.c:395
static void ios_prepare_to_stop(struct m0_reqh_service *service)
Definition: io_service.c:441

I/O Service operations.

Definition at line 96 of file io_service.c.

◆ ios_type_ops

const struct m0_reqh_service_type_ops ios_type_ops
static
Initial value:
= {
.rsto_service_allocate = ios_allocate
}
static int ios_allocate(struct m0_reqh_service **service, const struct m0_reqh_service_type *stype)
Definition: io_service.c:326

I/O Service type operations.

Definition at line 89 of file io_service.c.

◆ m0_ios_type

struct m0_reqh_service_type m0_ios_type
Initial value:
= {
.rst_name = "M0_CST_IOS",
.rst_ops = &ios_type_ops,
.rst_level = M0_RS_LEVEL_NORMAL,
.rst_typecode = M0_CST_IOS,
}
static const struct m0_reqh_service_type_ops ios_type_ops
Definition: io_service.c:89

Definition at line 112 of file io_service.c.

◆ M0_XCA_DOMAIN

enum { ... } M0_XCA_DOMAIN