Motr  M0
io.c File Reference
#include "motr/client.h"
#include "motr/client_internal.h"
#include "motr/layout.h"
#include "motr/addb.h"
#include "motr/pg.h"
#include "motr/io.h"
#include "lib/errno.h"
#include "fid/fid.h"
#include "ioservice/fid_convert.h"
#include "rm/rm_service.h"
#include "lib/trace.h"
#include "lib/finject.h"
Include dependency graph for io.c:

Go to the source code of this file.

Macros

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_CLIENT
 
#define DGMODE_IO
 

Functions

M0_INTERNAL struct m0_rm_domainrm_domain_get (struct m0_client *cinst)
 
M0_INTERNAL struct m0_poolmachioo_to_poolmach (struct m0_op_io *ioo)
 
static bool indexvec_segments_overlap (struct m0_indexvec *ivec)
 
static M0_UNUSED void indexvec_dump (struct m0_indexvec *ivec)
 
static void segments_sort (struct m0_indexvec *ivec, struct m0_bufvec *data, struct m0_bufvec *attr)
 
M0_INTERNAL bool m0_op_io_invariant (const struct m0_op_io *ioo)
 
static void addb2_add_ioo_attrs (const struct m0_op_io *ioo, int rmw)
 
static void obj_io_cb_launch (struct m0_op_common *oc)
 
static void obj_io_cb_cancel (struct m0_op_common *oc)
 
static void obj_io_ast_fini (struct m0_sm_group *grp, struct m0_sm_ast *ast)
 
static void obj_io_cb_fini (struct m0_op_common *oc)
 
static void obj_io_cb_free (struct m0_op_common *oc)
 
static int obj_io_init (struct m0_obj *obj, enum m0_obj_opcode opcode, struct m0_indexvec *ext, struct m0_bufvec *data, struct m0_bufvec *attr, uint64_t mask, uint32_t flags, struct m0_op *op)
 
static int obj_op_init (struct m0_obj *obj, enum m0_obj_opcode opcode, struct m0_op *op)
 
static void obj_io_args_check (struct m0_obj *obj, enum m0_obj_opcode opcode, struct m0_indexvec *ext, struct m0_bufvec *data, struct m0_bufvec *attr, uint64_t mask)
 
M0_INTERNAL bool m0__obj_is_parity_verify_mode (struct m0_client *instance)
 
M0_INTERNAL bool m0__obj_is_di_enabled (struct m0_op_io *ioo)
 
M0_INTERNAL bool m0__obj_is_cksum_validation_allowed (struct m0_op_io *ioo)
 
M0_INTERNAL int m0__obj_io_build (struct m0_io_args *args, struct m0_op **op)
 
M0_INTERNAL void m0__obj_op_done (struct m0_op *op)
 
int m0_obj_op (struct m0_obj *obj, enum m0_obj_opcode opcode, struct m0_indexvec *ext, struct m0_bufvec *data, struct m0_bufvec *attr, uint64_t mask, uint32_t flags, struct m0_op **op)
 
M0_INTERNAL void m0_client_init_io_op (void)
 

Variables

const struct m0_uint128 m0_rm_group = M0_UINT128(0, 1)
 

Macro Definition Documentation

◆ DGMODE_IO

#define DGMODE_IO

Definition at line 39 of file io.c.

◆ M0_TRACE_SUBSYSTEM

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_CLIENT

Definition at line 35 of file io.c.

Function Documentation

◆ addb2_add_ioo_attrs()

static void addb2_add_ioo_attrs ( const struct m0_op_io ioo,
int  rmw 
)
static

Definition at line 212 of file io.c.

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

◆ indexvec_dump()

static M0_UNUSED void indexvec_dump ( struct m0_indexvec ivec)
inlinestatic

Definition at line 108 of file io.c.

◆ indexvec_segments_overlap()

static bool indexvec_segments_overlap ( struct m0_indexvec ivec)
static

Definition at line 93 of file io.c.

Here is the caller graph for this function:

◆ ioo_to_poolmach()

M0_INTERNAL struct m0_poolmach* ioo_to_poolmach ( struct m0_op_io ioo)

Gets pool state machine from m0_op_io.

Parameters
iooThe IO operation in question.
Returns
A pointer to the pool machine corresponding to the pool version of this operation acting on.

Definition at line 75 of file io.c.

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

◆ m0__obj_io_build()

M0_INTERNAL int m0__obj_io_build ( struct m0_io_args args,
struct m0_op **  op 
)

Definition at line 677 of file io.c.

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

◆ m0__obj_is_cksum_validation_allowed()

M0_INTERNAL bool m0__obj_is_cksum_validation_allowed ( struct m0_op_io ioo)

Definition at line 665 of file io.c.

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

◆ m0__obj_is_di_enabled()

M0_INTERNAL bool m0__obj_is_di_enabled ( struct m0_op_io ioo)

Definition at line 660 of file io.c.

Here is the caller graph for this function:

◆ m0__obj_is_parity_verify_mode()

M0_INTERNAL bool m0__obj_is_parity_verify_mode ( struct m0_client instance)

Definition at line 655 of file io.c.

Here is the caller graph for this function:

◆ m0__obj_op_done()

M0_INTERNAL void m0__obj_op_done ( struct m0_op op)

Definition at line 691 of file io.c.

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

◆ m0_client_init_io_op()

M0_INTERNAL void m0_client_init_io_op ( void  )

Initialisation for object io operations. This initialises certain list types. This is heavily based on m0t1fs/linux_kernel/file.cio_bob_tlists_init

Definition at line 815 of file io.c.

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

◆ m0_op_io_invariant()

M0_INTERNAL bool m0_op_io_invariant ( const struct m0_op_io iop)

Checks an object's IO operation is not malformed or corrupted.

Parameters
iopobject's IO operation to be checked.
Returns
true if the operation is not malformed or false if some error was detected.

Definition at line 161 of file io.c.

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

◆ obj_io_args_check()

static void obj_io_args_check ( struct m0_obj obj,
enum m0_obj_opcode  opcode,
struct m0_indexvec ext,
struct m0_bufvec data,
struct m0_bufvec attr,
uint64_t  mask 
)
static

Definition at line 627 of file io.c.

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

◆ obj_io_ast_fini()

static void obj_io_ast_fini ( struct m0_sm_group grp,
struct m0_sm_ast ast 
)
static

AST callback for op_fini on an IO operation. This does the work for freeing iofops et al, as it must be done from the AST that performed the IO work.

Parameters
grpThe (locked) state machine group for this ast.
astThe ast descriptor, embedded in an m0_op_io.

Definition at line 346 of file io.c.

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

◆ obj_io_cb_cancel()

static void obj_io_cb_cancel ( struct m0_op_common oc)
static

Cancels all the fops that are sent during launch operation

Parameters
ocoperation being launched. Note the operation is of type m0_op_common although it has to be allocated as a m0_op_obj.

Definition at line 295 of file io.c.

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

◆ obj_io_cb_fini()

static void obj_io_cb_fini ( struct m0_op_common oc)
static

Callback for an IO operation being finalised. This causes iofops et al to be freed.

Parameters
ocThe common callback struct for the operation being finialised.

Definition at line 395 of file io.c.

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

◆ obj_io_cb_free()

static void obj_io_cb_free ( struct m0_op_common oc)
static

'free entry' on the vtable for obj io operations. This callback gets invoked when freeing an operation.

Parameters
ocoperation being freed. Note the operation is of type m0_op_common although it should have been allocated as a m0_op_io.

Definition at line 442 of file io.c.

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

◆ obj_io_cb_launch()

static void obj_io_cb_launch ( struct m0_op_common oc)
static

Callback for an IO operation being launched. Prepares io maps and distributes the operations in the network transfer. Schedules an AST to acquire the resource manager file lock.

Parameters
ocThe common callback struct for the operation being launched.

Definition at line 234 of file io.c.

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

◆ obj_io_init()

static int obj_io_init ( struct m0_obj obj,
enum m0_obj_opcode  opcode,
struct m0_indexvec ext,
struct m0_bufvec data,
struct m0_bufvec attr,
uint64_t  mask,
uint32_t  flags,
struct m0_op op 
)
static

If checksum is disabled, then attr is NULL

Definition at line 461 of file io.c.

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

◆ obj_op_init()

static int obj_op_init ( struct m0_obj obj,
enum m0_obj_opcode  opcode,
struct m0_op op 
)
static

Definition at line 552 of file io.c.

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

◆ rm_domain_get()

M0_INTERNAL struct m0_rm_domain* rm_domain_get ( struct m0_client cinst)

This is heavily based on m0t1fs/linux_kernel/inode.cm0t1fs_rm_domain_get

Definition at line 59 of file io.c.

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

◆ segments_sort()

static void segments_sort ( struct m0_indexvec ivec,
struct m0_bufvec data,
struct m0_bufvec attr 
)
static

Sort the segments by ivec->iv_index order ... using bubble sort. This is heavily based on m0t1fs/linux_kernel/file.cindexvec_sort

Parameters
ivec[out]The index vector to operate over.

Definition at line 124 of file io.c.

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

Variable Documentation

◆ m0_rm_group

const struct m0_uint128 m0_rm_group = M0_UINT128(0, 1)

A note for rwlock.

As stated in client.h: "All other concurrency control, including ordering of reads and writes to a client object, and distributed transaction serializability, is up to the application.", rwlock related code is removed from Client (by Sining). And rwlock related commits are ignored as well, such as commit d3c06f4f. If rwlock is thought to be necessary for Client later, it will be added.Resource Manager group id, copied from m0t1fs

Definition at line 53 of file io.c.