Motr  M0
List Enumeration Type.

Data Structures

struct  list_schema_data
 
struct  cob_lists_key
 
struct  cob_lists_rec
 
struct  m0_layout_list_enum
 

Macros

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_LAYOUT
 

Functions

 M0_BOB_DEFINE (static, &list_bob, m0_layout_list_enum)
 
static int lcl_key_cmp (struct m0_table *table, const void *key0, const void *key1)
 
static bool list_allocated_invariant (const struct m0_layout_list_enum *le)
 
static bool list_invariant (const struct m0_layout_list_enum *le)
 
static int list_allocate (struct m0_layout_domain *dom, struct m0_layout_enum **out)
 
static void list_delete (struct m0_layout_enum *e)
 
static int list_populate (struct m0_layout_list_enum *list_enum, struct m0_fid *cob_list, uint32_t nr)
 
M0_INTERNAL int m0_list_enum_build (struct m0_layout_domain *dom, struct m0_fid *cob_list, uint32_t nr, struct m0_layout_list_enum **out)
 
static struct m0_layout_list_enumenum_to_list_enum (const struct m0_layout_enum *e)
 
static void list_fini (struct m0_layout_enum *e)
 
static int list_register (struct m0_layout_domain *dom, const struct m0_layout_enum_type *et)
 
static void list_unregister (struct m0_layout_domain *dom, const struct m0_layout_enum_type *et)
 
static m0_bcount_t list_max_recsize (void)
 
static int noninline_read (struct m0_fid *cob_list, struct m0_striped_layout *stl, struct m0_db_tx *tx, uint32_t idx_start, uint32_t idx_end)
 
static int list_decode (struct m0_layout_enum *e, struct m0_bufvec_cursor *cur, enum m0_layout_xcode_op op, struct m0_db_tx *tx, struct m0_striped_layout *stl)
 
static int noninline_write (const struct m0_layout_enum *e, struct m0_db_tx *tx, enum m0_layout_xcode_op op, uint32_t idx_start)
 
static int list_encode (const struct m0_layout_enum *e, enum m0_layout_xcode_op op, struct m0_db_tx *tx, struct m0_bufvec_cursor *out)
 
static uint32_t list_nr (const struct m0_layout_enum *e)
 
static void list_get (const struct m0_layout_enum *e, uint32_t idx, const struct m0_fid *gfid, struct m0_fid *out)
 
static m0_bcount_t list_recsize (struct m0_layout_enum *e)
 

Variables

static const struct m0_bob_type list_bob
 
static const struct m0_table_ops cob_lists_table_ops
 
static const struct m0_layout_enum_ops list_enum_ops
 
static const struct m0_layout_enum_type_ops list_type_ops
 
struct m0_layout_enum_type m0_list_enum_type
 
struct m0_layout_enum_type m0_list_enum_type
 

Detailed Description

List Enumeration Type. A layout with list enumeration type lists all the COB identifiers as a part of the layout itself.

A layout with list enumeration type contains list of component object identifiers in itself.

Macro Definition Documentation

◆ M0_TRACE_SUBSYSTEM

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_LAYOUT

Definition at line 37 of file list_enum.c.

Function Documentation

◆ enum_to_list_enum()

static struct m0_layout_list_enum* enum_to_list_enum ( const struct m0_layout_enum e)
static

Definition at line 229 of file list_enum.c.

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

◆ lcl_key_cmp()

static int lcl_key_cmp ( struct m0_table *  table,
const void *  key0,
const void *  key1 
)
static

Compare cob_lists table keys. This is a 3WAY comparison.

Definition at line 84 of file list_enum.c.

◆ list_allocate()

static int list_allocate ( struct m0_layout_domain dom,
struct m0_layout_enum **  out 
)
static

Implementation of leto_allocate for LIST enumeration type.

Definition at line 129 of file list_enum.c.

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

◆ list_allocated_invariant()

static bool list_allocated_invariant ( const struct m0_layout_list_enum le)
static

Definition at line 107 of file list_enum.c.

Here is the caller graph for this function:

◆ list_decode()

static int list_decode ( struct m0_layout_enum e,
struct m0_bufvec_cursor cur,
enum m0_layout_xcode_op  op,
struct m0_db_tx *  tx,
struct m0_striped_layout stl 
)
static

Implementation of leo_decode() for LIST enumeration type.

Definition at line 389 of file list_enum.c.

Here is the call graph for this function:

◆ list_delete()

static void list_delete ( struct m0_layout_enum e)
static

Implementation of leo_delete for LIST enumeration type.

Definition at line 157 of file list_enum.c.

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

◆ list_encode()

static int list_encode ( const struct m0_layout_enum e,
enum m0_layout_xcode_op  op,
struct m0_db_tx *  tx,
struct m0_bufvec_cursor out 
)
static

Implementation of leo_encode() for LIST enumeration type.

Definition at line 573 of file list_enum.c.

Here is the call graph for this function:

◆ list_fini()

static void list_fini ( struct m0_layout_enum e)
static

Implementation of leo_fini for LIST enumeration type.

Definition at line 240 of file list_enum.c.

Here is the call graph for this function:

◆ list_get()

static void list_get ( const struct m0_layout_enum e,
uint32_t  idx,
const struct m0_fid gfid,
struct m0_fid out 
)
static

Implementation of leo_get for LIST enumeration.

Definition at line 656 of file list_enum.c.

Here is the call graph for this function:

◆ list_invariant()

static bool list_invariant ( const struct m0_layout_list_enum le)
static

Definition at line 115 of file list_enum.c.

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

◆ list_max_recsize()

static m0_bcount_t list_max_recsize ( void  )
static

Implementation of leto_max_recsize() for LIST enumeration type.

Definition at line 314 of file list_enum.c.

◆ list_nr()

static uint32_t list_nr ( const struct m0_layout_enum e)
static

Implementation of leo_nr for LIST enumeration.

Definition at line 640 of file list_enum.c.

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

◆ list_populate()

static int list_populate ( struct m0_layout_list_enum list_enum,
struct m0_fid cob_list,
uint32_t  nr 
)
static

Definition at line 173 of file list_enum.c.

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

◆ list_recsize()

static m0_bcount_t list_recsize ( struct m0_layout_enum e)
static

Implementation of leo_recsize() for list enumeration type.

Definition at line 676 of file list_enum.c.

Here is the call graph for this function:

◆ list_register()

static int list_register ( struct m0_layout_domain dom,
const struct m0_layout_enum_type et 
)
static

Implementation of leto_register for LIST enumeration type.

Definition at line 258 of file list_enum.c.

Here is the call graph for this function:

◆ list_unregister()

static void list_unregister ( struct m0_layout_domain dom,
const struct m0_layout_enum_type et 
)
static

Implementation of leto_unregister for LIST enumeration type.

Definition at line 297 of file list_enum.c.

Here is the call graph for this function:

◆ M0_BOB_DEFINE()

M0_BOB_DEFINE ( static  ,
list_bob,
m0_layout_list_enum   
)

◆ m0_list_enum_build()

M0_INTERNAL int m0_list_enum_build ( struct m0_layout_domain dom,
struct m0_fid cob_list,
uint32_t  nr,
struct m0_layout_list_enum **  out 
)

Allocates and builds list enumeration object.

Parameters
cob_listList of cob identifiers, allocated and supplied by the user. User shall not free the memory allocated for this list but it will be internally freed as a part of the enum object finalisation that happens through layout finalisation.
Postcondition
ergo(rc == 0, list_invariant_internal(lin_enum))
Note
Enum object is not to be finalised explicitly by the user. It is finalised internally through m0_layout__striped_fini().

Definition at line 191 of file list_enum.c.

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

◆ noninline_read()

static int noninline_read ( struct m0_fid cob_list,
struct m0_striped_layout stl,
struct m0_db_tx *  tx,
uint32_t  idx_start,
uint32_t  idx_end 
)
static

Definition at line 320 of file list_enum.c.

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

◆ noninline_write()

static int noninline_write ( const struct m0_layout_enum e,
struct m0_db_tx *  tx,
enum m0_layout_xcode_op  op,
uint32_t  idx_start 
)
static

Definition at line 478 of file list_enum.c.

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

Variable Documentation

◆ cob_lists_table_ops

const struct m0_table_ops cob_lists_table_ops
static
Initial value:
= {
.to = {
[TO_KEY] = {
.max_size = sizeof(struct cob_lists_key)
},
[TO_REC] = {
.max_size = sizeof(struct cob_lists_rec)
}
},
.key_cmp = lcl_key_cmp
}
static int lcl_key_cmp(struct m0_table *table, const void *key0, const void *key1)
Definition: list_enum.c:84

table_ops for cob_lists table.

Definition at line 95 of file list_enum.c.

◆ list_bob

const struct m0_bob_type list_bob
static
Initial value:
= {
.bt_name = "list_enum",
.bt_magix_offset = offsetof(struct m0_layout_list_enum, lle_magic),
.bt_check = NULL
}
#define NULL
Definition: misc.h:38
#define offsetof(typ, memb)
Definition: misc.h:29

Definition at line 45 of file list_enum.c.

◆ list_enum_ops

static const struct m0_layout_enum_ops list_enum_ops
static
Initial value:
= {
.leo_nr = list_nr,
.leo_get = list_get,
.leo_recsize = list_recsize,
.leo_fini = list_fini,
.leo_delete = list_delete,
.leo_decode = list_decode,
.leo_encode = list_encode
}
static int list_encode(const struct m0_layout_enum *e, enum m0_layout_xcode_op op, struct m0_db_tx *tx, struct m0_bufvec_cursor *out)
Definition: list_enum.c:573
static void list_fini(struct m0_layout_enum *e)
Definition: list_enum.c:240
static void list_delete(struct m0_layout_enum *e)
Definition: list_enum.c:157
static int list_decode(struct m0_layout_enum *e, struct m0_bufvec_cursor *cur, enum m0_layout_xcode_op op, struct m0_db_tx *tx, struct m0_striped_layout *stl)
Definition: list_enum.c:389
static uint32_t list_nr(const struct m0_layout_enum *e)
Definition: list_enum.c:640
static m0_bcount_t list_recsize(struct m0_layout_enum *e)
Definition: list_enum.c:676
static void list_get(const struct m0_layout_enum *e, uint32_t idx, const struct m0_fid *gfid, struct m0_fid *out)
Definition: list_enum.c:656

Definition at line 126 of file list_enum.c.

◆ list_type_ops

const struct m0_layout_enum_type_ops list_type_ops
static
Initial value:
= {
.leto_register = list_register,
.leto_unregister = list_unregister,
.leto_max_recsize = list_max_recsize,
.leto_allocate = list_allocate
}
static void list_unregister(struct m0_layout_domain *dom, const struct m0_layout_enum_type *et)
Definition: list_enum.c:297
static int list_allocate(struct m0_layout_domain *dom, struct m0_layout_enum **out)
Definition: list_enum.c:129
static int list_register(struct m0_layout_domain *dom, const struct m0_layout_enum_type *et)
Definition: list_enum.c:258
static m0_bcount_t list_max_recsize(void)
Definition: list_enum.c:314

Definition at line 699 of file list_enum.c.

◆ m0_list_enum_type [1/2]

struct m0_layout_enum_type m0_list_enum_type

Definition at line 706 of file list_enum.c.

◆ m0_list_enum_type [2/2]

struct m0_layout_enum_type m0_list_enum_type
Initial value:
= {
.let_name = "list",
.let_id = 0,
.let_ref_count = 0,
.let_ops = &list_type_ops
}
static const struct m0_layout_enum_type_ops list_type_ops
Definition: list_enum.c:699

Definition at line 706 of file list_enum.c.