Motr  M0
Linear Enumeration Type.

Data Structures

struct  m0_layout_linear_attr
 
struct  m0_layout_linear_enum
 

Macros

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_LAYOUT
 

Functions

 M0_BOB_DEFINE (static, &linear_bob, m0_layout_linear_enum)
 
static bool linear_allocated_invariant (const struct m0_layout_linear_enum *le)
 
static bool linear_invariant (const struct m0_layout_linear_enum *le)
 
static int linear_allocate (struct m0_layout_domain *dom, struct m0_layout_enum **out)
 
static void linear_delete (struct m0_layout_enum *e)
 
static int linear_populate (struct m0_layout_linear_enum *lin_enum, const struct m0_layout_linear_attr *attr)
 
M0_INTERNAL int m0_linear_enum_build (struct m0_layout_domain *dom, const struct m0_layout_linear_attr *attr, struct m0_layout_linear_enum **out)
 
static struct m0_layout_linear_enumenum_to_linear_enum (const struct m0_layout_enum *e)
 
static void linear_fini (struct m0_layout_enum *e)
 
static int linear_register (struct m0_layout_domain *dom, const struct m0_layout_enum_type *et)
 
static void linear_unregister (struct m0_layout_domain *dom, const struct m0_layout_enum_type *et)
 
static m0_bcount_t linear_max_recsize (void)
 
static int linear_decode (struct m0_layout_enum *e, struct m0_bufvec_cursor *cur, enum m0_layout_xcode_op op, struct m0_be_tx *tx, struct m0_striped_layout *stl)
 
static int linear_encode (const struct m0_layout_enum *e, enum m0_layout_xcode_op op, struct m0_be_tx *tx, struct m0_bufvec_cursor *out)
 
static uint32_t linear_nr (const struct m0_layout_enum *e)
 
static void linear_get (const struct m0_layout_enum *e, uint32_t idx, const struct m0_fid *gfid, struct m0_fid *out)
 
static m0_bcount_t linear_recsize (struct m0_layout_enum *e)
 
 M0_BASSERT (M0_IS_8ALIGNED(sizeof(struct m0_layout_linear_attr)))
 

Variables

static const struct m0_bob_type linear_bob
 
static const struct m0_layout_enum_ops linear_enum_ops
 
static const struct m0_layout_enum_type_ops linear_type_ops
 
struct m0_layout_enum_type m0_linear_enum_type
 
struct m0_layout_enum_type m0_linear_enum_type
 

Detailed Description

A layout with linear enumeration type stores a linear formula that is used to enumerate all the component object identifiers.

Macro Definition Documentation

◆ M0_TRACE_SUBSYSTEM

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_LAYOUT

Definition at line 37 of file linear_enum.c.

Function Documentation

◆ enum_to_linear_enum()

static struct m0_layout_linear_enum* enum_to_linear_enum ( const struct m0_layout_enum e)
static

Definition at line 167 of file linear_enum.c.

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

◆ linear_allocate()

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

Implementation of leto_allocate for LINEAR enumeration type.

Definition at line 79 of file linear_enum.c.

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

◆ linear_allocated_invariant()

static bool linear_allocated_invariant ( const struct m0_layout_linear_enum le)
static

Definition at line 55 of file linear_enum.c.

Here is the caller graph for this function:

◆ linear_decode()

static int linear_decode ( struct m0_layout_enum e,
struct m0_bufvec_cursor cur,
enum m0_layout_xcode_op  op,
struct m0_be_tx tx,
struct m0_striped_layout stl 
)
static

Implementation of leo_decode() for linear enumeration type.

Definition at line 217 of file linear_enum.c.

Here is the call graph for this function:

◆ linear_delete()

static void linear_delete ( struct m0_layout_enum e)
static

Definition at line 106 of file linear_enum.c.

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

◆ linear_encode()

static int linear_encode ( const struct m0_layout_enum e,
enum m0_layout_xcode_op  op,
struct m0_be_tx tx,
struct m0_bufvec_cursor out 
)
static

Implementation of leo_encode() for linear enumeration type.

Definition at line 255 of file linear_enum.c.

Here is the call graph for this function:

◆ linear_fini()

static void linear_fini ( struct m0_layout_enum e)
static

Implementation of leo_fini for LINEAR enumeration type.

Definition at line 178 of file linear_enum.c.

Here is the call graph for this function:

◆ linear_get()

static void linear_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 LINEAR enumeration.

Definition at line 298 of file linear_enum.c.

Here is the call graph for this function:

◆ linear_invariant()

static bool linear_invariant ( const struct m0_layout_linear_enum le)
static

linear_invariant() can not be invoked until an enumeration object is associated with some layout object. Hence this separation.

Definition at line 67 of file linear_enum.c.

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

◆ linear_max_recsize()

static m0_bcount_t linear_max_recsize ( void  )
static

Implementation of leto_max_recsize() for linear enumeration type.

Definition at line 211 of file linear_enum.c.

◆ linear_nr()

static uint32_t linear_nr ( const struct m0_layout_enum e)
static

Implementation of leo_nr for LINEAR enumeration.

Definition at line 282 of file linear_enum.c.

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

◆ linear_populate()

static int linear_populate ( struct m0_layout_linear_enum lin_enum,
const struct m0_layout_linear_attr attr 
)
static

Definition at line 121 of file linear_enum.c.

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

◆ linear_recsize()

static m0_bcount_t linear_recsize ( struct m0_layout_enum e)
static

Implementation of leo_recsize() for linear enumeration type.

Definition at line 320 of file linear_enum.c.

◆ linear_register()

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

Implementation of leto_register for LINEAR enumeration type. No table is required specifically for LINEAR enum type.

Definition at line 198 of file linear_enum.c.

◆ linear_unregister()

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

Implementation of leto_unregister for LINEAR enumeration type.

Definition at line 205 of file linear_enum.c.

◆ M0_BASSERT()

M0_BASSERT ( M0_IS_8ALIGNED(sizeof(struct m0_layout_linear_attr))  )

◆ M0_BOB_DEFINE()

M0_BOB_DEFINE ( static  ,
linear_bob,
m0_layout_linear_enum   
)

◆ m0_linear_enum_build()

M0_INTERNAL int m0_linear_enum_build ( struct m0_layout_domain dom,
const struct m0_layout_linear_attr attr,
struct m0_layout_linear_enum **  out 
)

Allocates and builds linear enumeration object.

Postcondition
ergo(rc == 0, linear_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 138 of file linear_enum.c.

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

Variable Documentation

◆ linear_bob

const struct m0_bob_type linear_bob
static
Initial value:
= {
.bt_name = "linear_enum",
.bt_magix_offset = offsetof(struct m0_layout_linear_enum, lla_magic),
.bt_check = NULL
}
#define NULL
Definition: misc.h:38
#define offsetof(typ, memb)
Definition: misc.h:29

Definition at line 46 of file linear_enum.c.

◆ linear_enum_ops

static const struct m0_layout_enum_ops linear_enum_ops
static
Initial value:
= {
.leo_nr = linear_nr,
.leo_get = linear_get,
.leo_recsize = linear_recsize,
.leo_fini = linear_fini,
.leo_delete = linear_delete,
.leo_decode = linear_decode,
.leo_encode = linear_encode
}
static m0_bcount_t linear_recsize(struct m0_layout_enum *e)
Definition: linear_enum.c:320
static void linear_get(const struct m0_layout_enum *e, uint32_t idx, const struct m0_fid *gfid, struct m0_fid *out)
Definition: linear_enum.c:298
static void linear_fini(struct m0_layout_enum *e)
Definition: linear_enum.c:178
static int linear_encode(const struct m0_layout_enum *e, enum m0_layout_xcode_op op, struct m0_be_tx *tx, struct m0_bufvec_cursor *out)
Definition: linear_enum.c:255
static int linear_decode(struct m0_layout_enum *e, struct m0_bufvec_cursor *cur, enum m0_layout_xcode_op op, struct m0_be_tx *tx, struct m0_striped_layout *stl)
Definition: linear_enum.c:217
static uint32_t linear_nr(const struct m0_layout_enum *e)
Definition: linear_enum.c:282
static void linear_delete(struct m0_layout_enum *e)
Definition: linear_enum.c:106

Definition at line 76 of file linear_enum.c.

◆ linear_type_ops

const struct m0_layout_enum_type_ops linear_type_ops
static
Initial value:
= {
.leto_register = linear_register,
.leto_unregister = linear_unregister,
.leto_max_recsize = linear_max_recsize,
.leto_allocate = linear_allocate
}
static int linear_register(struct m0_layout_domain *dom, const struct m0_layout_enum_type *et)
Definition: linear_enum.c:198
static int linear_allocate(struct m0_layout_domain *dom, struct m0_layout_enum **out)
Definition: linear_enum.c:79
static m0_bcount_t linear_max_recsize(void)
Definition: linear_enum.c:211
static void linear_unregister(struct m0_layout_domain *dom, const struct m0_layout_enum_type *et)
Definition: linear_enum.c:205

Definition at line 335 of file linear_enum.c.

◆ m0_linear_enum_type [1/2]

struct m0_layout_enum_type m0_linear_enum_type

Definition at line 342 of file linear_enum.c.

◆ m0_linear_enum_type [2/2]

struct m0_layout_enum_type m0_linear_enum_type
Initial value:
= {
.let_name = "linear",
.let_id = 1,
.let_ref_count = 0,
.let_ops = &linear_type_ops
}
static const struct m0_layout_enum_type_ops linear_type_ops
Definition: linear_enum.c:335

Definition at line 342 of file linear_enum.c.