Motr  M0
cob_foms.c File Reference
#include "lib/trace.h"
#include "lib/finject.h"
#include "ioservice/io_addb2.h"
#include "ioservice/cob_foms.h"
#include "ioservice/fid_convert.h"
#include "ioservice/io_service.h"
#include "ioservice/storage_dev.h"
#include "motr/setup.h"
#include "stob/domain.h"
Include dependency graph for cob_foms.c:

Go to the source code of this file.

Macros

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_COB
 

Enumerations

enum  { CC_COB_VERSION_INIT = 0, CC_COB_HARDLINK_NR = 1, CD_FOM_STOBIO_LAST_REFS = 1 }
 
enum  cob_attr_operation { COB_ATTR_GET, COB_ATTR_SET }
 

Functions

static void cc_fom_fini (struct m0_fom *fom)
 
static int cob_ops_fom_tick (struct m0_fom *fom)
 
static void cob_op_credit (struct m0_fom *fom, enum m0_cob_op opcode, struct m0_be_tx_credit *accum)
 
static int cc_cob_create (struct m0_fom *fom, struct m0_fom_cob_op *cc, const struct m0_cob_attr *attr)
 
static void cd_fom_fini (struct m0_fom *fom)
 
static int cd_cob_delete (struct m0_fom *fom, struct m0_fom_cob_op *cd, const struct m0_cob_attr *attr)
 
static void ce_stob_destroy_credit (struct m0_fom_cob_op *cob_op, struct m0_be_tx_credit *accum)
 
static int ce_stob_edit_credit (struct m0_fom *fom, struct m0_fom_cob_op *cc, struct m0_be_tx_credit *accum, uint32_t cot)
 
static int ce_stob_edit (struct m0_fom *fom, struct m0_fom_cob_op *cd, uint32_t cot)
 
static int cob_fom_populate (struct m0_fom *fom)
 
static int cob_op_fom_create (struct m0_fom **out)
 
static size_t cob_fom_locality_get (const struct m0_fom *fom)
 
static struct m0_fom_cob_opcob_fom_get (const struct m0_fom *fom)
 
static int cob_getattr_fom_tick (struct m0_fom *fom)
 
static void cob_getattr_fom_fini (struct m0_fom *fom)
 
static int cob_getattr (struct m0_fom *fom, struct m0_fom_cob_op *gop, struct m0_cob_attr *attr)
 
static int cob_setattr_fom_tick (struct m0_fom *fom)
 
static void cob_setattr_fom_fini (struct m0_fom *fom)
 
static int cob_setattr (struct m0_fom *fom, struct m0_fom_cob_op *gop, struct m0_cob_attr *attr)
 
static int cob_locate (const struct m0_fom *fom, struct m0_cob **cob)
 
static int cob_attr_get (struct m0_cob *cob, struct m0_cob_attr *attr)
 
static void cob_stob_create_credit (struct m0_fom *fom)
 
static int cob_stob_delete_credit (struct m0_fom *fom)
 
static struct m0_cob_domaincdom_get (const struct m0_fom *fom)
 
static int cob_ops_stob_find (struct m0_fom_cob_op *co)
 
static int cob_bytecount_decrement (struct m0_cob *cob, struct m0_cob_bckey *key, uint64_t bytecount, struct m0_be_tx *tx)
 
static bool cob_is_md (const struct m0_fom_cob_op *cfom)
 
static void cob_fom_stob2fid_map (const struct m0_fom_cob_op *cfom, struct m0_fid *out)
 
static void addb2_add_cob_fom_attrs (const struct m0_fom_cob_op *cfom)
 
M0_INTERNAL int m0_cob_fom_create (struct m0_fop *fop, struct m0_fom **out, struct m0_reqh *reqh)
 
M0_INTERNAL size_t m0_cob_io_fom_locality (const struct m0_fid *fid)
 
static void cob_tick_tail (struct m0_fom *fom, struct m0_fop_cob_op_rep_common *r_common)
 
static bool cob_pool_version_mismatch (const struct m0_fom *fom)
 
static int cob_stob_create (struct m0_fom *fom, struct m0_cob_attr *attr)
 
static int cob_stob_ref_drop_wait (struct m0_fom *fom)
 
M0_INTERNAL int m0_cc_stob_cr_credit (struct m0_stob_id *sid, struct m0_be_tx_credit *accum)
 
M0_INTERNAL int m0_cc_stob_create (struct m0_fom *fom, struct m0_stob_id *sid)
 
M0_INTERNAL int m0_cc_cob_nskey_make (struct m0_cob_nskey **nskey, const struct m0_fid *gfid, uint32_t cob_idx)
 
static int cc_md_cob_nskey_make (struct m0_cob_nskey **nskey, const struct m0_fid *gfid)
 
static int cob_attr_op (struct m0_fom *fom, struct m0_fom_cob_op *gop, struct m0_cob_attr *attr, enum cob_attr_operation op)
 
M0_INTERNAL int m0_cc_cob_setup (struct m0_fom_cob_op *cc, struct m0_cob_domain *cdom, const struct m0_cob_attr *attr, struct m0_be_tx *ctx)
 

Variables

struct m0_sm_state_descr cob_ops_phases []
 
const struct m0_sm_conf cob_ops_conf
 
const struct m0_fom_type_ops cob_fom_type_ops
 
static const struct m0_fom_ops cc_fom_ops
 
static const struct m0_fom_ops cd_fom_ops
 
static const struct m0_fom_ops ct_fom_ops
 
static const struct m0_fom_ops cob_getattr_fom_ops
 
static const struct m0_fom_ops cob_setattr_fom_ops
 

Macro Definition Documentation

◆ M0_TRACE_SUBSYSTEM

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_COB

Definition at line 23 of file cob_foms.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
CC_COB_VERSION_INIT 
CC_COB_HARDLINK_NR 
CD_FOM_STOBIO_LAST_REFS 

Definition at line 80 of file cob_foms.c.

◆ cob_attr_operation

Enumerator
COB_ATTR_GET 
COB_ATTR_SET 

Definition at line 879 of file cob_foms.c.

Function Documentation

◆ addb2_add_cob_fom_attrs()

static void addb2_add_cob_fom_attrs ( const struct m0_fom_cob_op cfom)
static

Definition at line 162 of file cob_foms.c.

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

◆ cc_cob_create()

static int cc_cob_create ( struct m0_fom fom,
struct m0_fom_cob_op cc,
const struct m0_cob_attr attr 
)
static

Definition at line 1014 of file cob_foms.c.

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

◆ cc_fom_fini()

static void cc_fom_fini ( struct m0_fom fom)
static

Definition at line 259 of file cob_foms.c.

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

◆ cc_md_cob_nskey_make()

static int cc_md_cob_nskey_make ( struct m0_cob_nskey **  nskey,
const struct m0_fid gfid 
)
static

Definition at line 860 of file cob_foms.c.

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

◆ cd_cob_delete()

static int cd_cob_delete ( struct m0_fom fom,
struct m0_fom_cob_op cd,
const struct m0_cob_attr attr 
)
static

Definition at line 1119 of file cob_foms.c.

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

◆ cd_fom_fini()

static void cd_fom_fini ( struct m0_fom fom)
static

Definition at line 1084 of file cob_foms.c.

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

◆ cdom_get()

static struct m0_cob_domain * cdom_get ( const struct m0_fom fom)
static

Definition at line 834 of file cob_foms.c.

Here is the caller graph for this function:

◆ ce_stob_destroy_credit()

static void ce_stob_destroy_credit ( struct m0_fom_cob_op cob_op,
struct m0_be_tx_credit accum 
)
static

Definition at line 1163 of file cob_foms.c.

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

◆ ce_stob_edit()

static int ce_stob_edit ( struct m0_fom fom,
struct m0_fom_cob_op cd,
uint32_t  cot 
)
static

Definition at line 1206 of file cob_foms.c.

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

◆ ce_stob_edit_credit()

static int ce_stob_edit_credit ( struct m0_fom fom,
struct m0_fom_cob_op cc,
struct m0_be_tx_credit accum,
uint32_t  cot 
)
static

Definition at line 1169 of file cob_foms.c.

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

◆ cob_attr_get()

static int cob_attr_get ( struct m0_cob cob,
struct m0_cob_attr attr 
)
static

Definition at line 884 of file cob_foms.c.

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

◆ cob_attr_op()

static int cob_attr_op ( struct m0_fom fom,
struct m0_fom_cob_op gop,
struct m0_cob_attr attr,
enum cob_attr_operation  op 
)
static

Definition at line 944 of file cob_foms.c.

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

◆ cob_bytecount_decrement()

static int cob_bytecount_decrement ( struct m0_cob cob,
struct m0_cob_bckey key,
uint64_t  bytecount,
struct m0_be_tx tx 
)
static

Definition at line 1246 of file cob_foms.c.

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

◆ cob_fom_get()

static struct m0_fom_cob_op * cob_fom_get ( const struct m0_fom fom)
inlinestatic

Definition at line 252 of file cob_foms.c.

Here is the caller graph for this function:

◆ cob_fom_locality_get()

static size_t cob_fom_locality_get ( const struct m0_fom fom)
static

Definition at line 278 of file cob_foms.c.

Here is the call graph for this function:

◆ cob_fom_populate()

static int cob_fom_populate ( struct m0_fom fom)
static

Definition at line 285 of file cob_foms.c.

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

◆ cob_fom_stob2fid_map()

static void cob_fom_stob2fid_map ( const struct m0_fom_cob_op cfom,
struct m0_fid out 
)
static

Definition at line 153 of file cob_foms.c.

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

◆ cob_getattr()

static int cob_getattr ( struct m0_fom fom,
struct m0_fom_cob_op gop,
struct m0_cob_attr attr 
)
static

Definition at line 1000 of file cob_foms.c.

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

◆ cob_getattr_fom_fini()

static void cob_getattr_fom_fini ( struct m0_fom fom)
static

Definition at line 1099 of file cob_foms.c.

Here is the call graph for this function:

◆ cob_getattr_fom_tick()

static int cob_getattr_fom_tick ( struct m0_fom fom)
static

Definition at line 358 of file cob_foms.c.

Here is the call graph for this function:

◆ cob_is_md()

static bool cob_is_md ( const struct m0_fom_cob_op cfom)
static

Definition at line 148 of file cob_foms.c.

Here is the caller graph for this function:

◆ cob_locate()

static int cob_locate ( const struct m0_fom fom,
struct m0_cob **  cob 
)
static

Definition at line 923 of file cob_foms.c.

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

◆ cob_op_credit()

static void cob_op_credit ( struct m0_fom fom,
enum m0_cob_op  opcode,
struct m0_be_tx_credit accum 
)
static

Definition at line 868 of file cob_foms.c.

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

◆ cob_op_fom_create()

static int cob_op_fom_create ( struct m0_fom **  out)
static

Definition at line 238 of file cob_foms.c.

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

◆ cob_ops_fom_tick()

static int cob_ops_fom_tick ( struct m0_fom fom)
static

Definition at line 576 of file cob_foms.c.

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

◆ cob_ops_stob_find()

static int cob_ops_stob_find ( struct m0_fom_cob_op co)
static

Definition at line 335 of file cob_foms.c.

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

◆ cob_pool_version_mismatch()

static bool cob_pool_version_mismatch ( const struct m0_fom fom)
static

Definition at line 480 of file cob_foms.c.

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

◆ cob_setattr()

static int cob_setattr ( struct m0_fom fom,
struct m0_fom_cob_op gop,
struct m0_cob_attr attr 
)
static

Definition at line 1007 of file cob_foms.c.

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

◆ cob_setattr_fom_fini()

static void cob_setattr_fom_fini ( struct m0_fom fom)
static

Definition at line 1109 of file cob_foms.c.

Here is the call graph for this function:

◆ cob_setattr_fom_tick()

static int cob_setattr_fom_tick ( struct m0_fom fom)
static

Definition at line 414 of file cob_foms.c.

Here is the call graph for this function:

◆ cob_stob_create()

static int cob_stob_create ( struct m0_fom fom,
struct m0_cob_attr attr 
)
static

Definition at line 511 of file cob_foms.c.

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

◆ cob_stob_create_credit()

static void cob_stob_create_credit ( struct m0_fom fom)
static

Definition at line 498 of file cob_foms.c.

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

◆ cob_stob_delete_credit()

static int cob_stob_delete_credit ( struct m0_fom fom)
static

Definition at line 522 of file cob_foms.c.

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

◆ cob_stob_ref_drop_wait()

static int cob_stob_ref_drop_wait ( struct m0_fom fom)
static

Definition at line 559 of file cob_foms.c.

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

◆ cob_tick_tail()

static void cob_tick_tail ( struct m0_fom fom,
struct m0_fop_cob_op_rep_common r_common 
)
static

Definition at line 348 of file cob_foms.c.

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

◆ m0_cc_cob_nskey_make()

M0_INTERNAL int m0_cc_cob_nskey_make ( struct m0_cob_nskey **  nskey,
const struct m0_fid gfid,
uint32_t  cob_idx 
)

Definition at line 846 of file cob_foms.c.

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

◆ m0_cc_cob_setup()

M0_INTERNAL int m0_cc_cob_setup ( struct m0_fom_cob_op cc,
struct m0_cob_domain cdom,
const struct m0_cob_attr attr,
struct m0_be_tx ctx 
)

Create the cob for the cob domain.

Definition at line 1033 of file cob_foms.c.

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

◆ m0_cc_stob_cr_credit()

M0_INTERNAL int m0_cc_stob_cr_credit ( struct m0_stob_id sid,
struct m0_be_tx_credit accum 
)

Definition at line 807 of file cob_foms.c.

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

◆ m0_cc_stob_create()

M0_INTERNAL int m0_cc_stob_create ( struct m0_fom fom,
struct m0_stob_id sid 
)

Definition at line 824 of file cob_foms.c.

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

◆ m0_cob_fom_create()

M0_INTERNAL int m0_cob_fom_create ( struct m0_fop fop,
struct m0_fom **  out,
struct m0_reqh reqh 
)

Definition at line 183 of file cob_foms.c.

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

◆ m0_cob_io_fom_locality()

M0_INTERNAL size_t m0_cob_io_fom_locality ( const struct m0_fid fid)

Definition at line 271 of file cob_foms.c.

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

Variable Documentation

◆ cc_fom_ops

const struct m0_fom_ops cc_fom_ops
static
Initial value:
= {
.fo_fini = cc_fom_fini,
.fo_tick = cob_ops_fom_tick,
.fo_home_locality = cob_fom_locality_get
}
static void cc_fom_fini(struct m0_fom *fom)
Definition: cob_foms.c:259
static int cob_ops_fom_tick(struct m0_fom *fom)
Definition: cob_foms.c:576
static size_t cob_fom_locality_get(const struct m0_fom *fom)
Definition: cob_foms.c:278

Cob create fom ops.

Definition at line 114 of file cob_foms.c.

◆ cd_fom_ops

const struct m0_fom_ops cd_fom_ops
static
Initial value:
= {
.fo_fini = cd_fom_fini,
.fo_tick = cob_ops_fom_tick,
.fo_home_locality = cob_fom_locality_get
}
static void cd_fom_fini(struct m0_fom *fom)
Definition: cob_foms.c:1084
static int cob_ops_fom_tick(struct m0_fom *fom)
Definition: cob_foms.c:576
static size_t cob_fom_locality_get(const struct m0_fom *fom)
Definition: cob_foms.c:278

Cob delete fom ops.

Definition at line 121 of file cob_foms.c.

◆ cob_fom_type_ops

const struct m0_fom_type_ops cob_fom_type_ops
Initial value:
= {
.fto_create = m0_cob_fom_create,
}
M0_INTERNAL int m0_cob_fom_create(struct m0_fop *fop, struct m0_fom **out, struct m0_reqh *reqh)
Definition: cob_foms.c:183

Common fom_type_ops for m0_fop_cob_create, m0_fop_cob_delete, m0_fop_cob_getattr, and m0_fop_cob_setattr fops.

Definition at line 109 of file cob_foms.c.

◆ cob_getattr_fom_ops

const struct m0_fom_ops cob_getattr_fom_ops
static
Initial value:
= {
.fo_home_locality = cob_fom_locality_get
}
static int cob_getattr_fom_tick(struct m0_fom *fom)
Definition: cob_foms.c:358
static void cob_getattr_fom_fini(struct m0_fom *fom)
Definition: cob_foms.c:1099
static size_t cob_fom_locality_get(const struct m0_fom *fom)
Definition: cob_foms.c:278

Cob getattr fom ops.

Definition at line 135 of file cob_foms.c.

◆ cob_ops_conf

const struct m0_sm_conf cob_ops_conf
Initial value:
= {
.scf_name = "COB create/delete/getattr",
.scf_nr_states = ARRAY_SIZE(cob_ops_phases),
.scf_state = cob_ops_phases
}
struct m0_sm_state_descr cob_ops_phases[]
Definition: cob_foms.c:86
#define ARRAY_SIZE(a)
Definition: misc.h:45

Definition at line 99 of file cob_foms.c.

◆ cob_ops_phases

struct m0_sm_state_descr cob_ops_phases[]
Initial value:
= {
.sd_name = "COB OP Prepare",
},
.sd_name = "COB OP EXECUTE",
.sd_allowed = M0_BITS(M0_FOPH_SUCCESS,
}
}
#define M0_BITS(...)
Definition: misc.h:236

Definition at line 86 of file cob_foms.c.

◆ cob_setattr_fom_ops

const struct m0_fom_ops cob_setattr_fom_ops
static
Initial value:
= {
.fo_home_locality = cob_fom_locality_get
}
static int cob_setattr_fom_tick(struct m0_fom *fom)
Definition: cob_foms.c:414
static void cob_setattr_fom_fini(struct m0_fom *fom)
Definition: cob_foms.c:1109
static size_t cob_fom_locality_get(const struct m0_fom *fom)
Definition: cob_foms.c:278

Cob setattr fom ops.

Definition at line 142 of file cob_foms.c.

◆ ct_fom_ops

const struct m0_fom_ops ct_fom_ops
static
Initial value:
= {
.fo_fini = cd_fom_fini,
.fo_tick = cob_ops_fom_tick,
.fo_home_locality = cob_fom_locality_get
}
static void cd_fom_fini(struct m0_fom *fom)
Definition: cob_foms.c:1084
static int cob_ops_fom_tick(struct m0_fom *fom)
Definition: cob_foms.c:576
static size_t cob_fom_locality_get(const struct m0_fom *fom)
Definition: cob_foms.c:278

Cob truncate fom ops.

Definition at line 128 of file cob_foms.c.