Motr  M0
m0_layout_ops Struct Reference

#include <layout.h>

Collaboration diagram for m0_layout_ops:
Collaboration graph

Data Fields

void(* lo_fini )(struct m0_ref *ref)
 
void(* lo_delete )(struct m0_layout *l)
 
m0_bcount_t(* lo_recsize )(const struct m0_layout *l)
 
int(* lo_instance_build )(struct m0_layout *l, const struct m0_fid *fid, struct m0_layout_instance **linst)
 
int(* lo_decode )(struct m0_layout *l, struct m0_bufvec_cursor *cur, enum m0_layout_xcode_op op, struct m0_be_tx *tx, uint32_t user_count)
 
int(* lo_encode )(struct m0_layout *l, enum m0_layout_xcode_op op, struct m0_be_tx *tx, struct m0_bufvec_cursor *out)
 

Detailed Description

Definition at line 264 of file layout.h.

Field Documentation

◆ lo_decode

int(* lo_decode) (struct m0_layout *l, struct m0_bufvec_cursor *cur, enum m0_layout_xcode_op op, struct m0_be_tx *tx, uint32_t user_count)

Continues building the in-memory layout object from its representation either 'stored in the Layout DB' or 'received through the buffer'.

Parameters
opThis enum parameter indicates what, if a DB operation is to be performed on the layout record and it could be LOOKUP if at all. If it is BUFFER_OP, then the layout is decoded from its representation received through the buffer.
Precondition
M0_IN(op, (M0_LXO_DB_LOOKUP, M0_LXO_BUFFER_OP))
ergo(op == M0_LXO_DB_LOOKUP, tx != NULL)
Postcondition
  • ergo(rc == 0, pdclust_invariant(pl))
  • The cursor cur is advanced by the size of the data that is read from it.

Definition at line 324 of file layout.h.

◆ lo_delete

void(* lo_delete) (struct m0_layout *l)

Finalises the layout object that is only allocated and not populated. Since it is not populated, it does not contain enumeration object. Dual to lto_allocate() when an allocated layout object can not be populated for some reason. In the other regular cases, dual to the sequence of "lto_allocate() followed by the type specific populate operation" is lo_fini().

Definition at line 286 of file layout.h.

◆ lo_encode

int(* lo_encode) (struct m0_layout *l, enum m0_layout_xcode_op op, struct m0_be_tx *tx, struct m0_bufvec_cursor *out)

Continues to use the in-memory layout object and

  • Either adds/updates/deletes it to/from the Layout DB
  • Or converts it to a buffer.
    Parameters
    opThis enum parameter indicates what is the DB operation to be performed on the layout record if at all and it could be one of ADD/UPDATE/DELETE. If it is BUFFER_OP, then the layout is stored in the buffer.
    Precondition
    M0_IN(op, (M0_LXO_DB_ADD, M0_LXO_DB_UPDATE, M0_LXO_DB_DELETE, M0_LXO_BUFFER_OP))
    ergo(op != M0_LXO_BUFFER_OP, tx != NULL)

Definition at line 343 of file layout.h.

◆ lo_fini

void(* lo_fini) (struct m0_ref *ref)

Finalises the type specific layout object. It involves finalising its enumeration object, if applicable.

Dual to the sequence "lto_allocate() followed by the type specific populate operation", but the user is not expected to invoke this method explicitly. It is called implicitly when the last reference on the layout object is released.

See also
m0_layout_put().

Definition at line 275 of file layout.h.

◆ lo_instance_build

int(* lo_instance_build) (struct m0_layout *l, const struct m0_fid *fid, struct m0_layout_instance **linst)

Allocates and builds a layout instance using the supplied layout. Increments a reference on the supplied layout.

Definition at line 303 of file layout.h.

◆ lo_recsize

m0_bcount_t(* lo_recsize) (const struct m0_layout *l)

Returns size of the record stored in the "layouts" (primary) table, for the specified layout. It includes the size required for storing the generic data, the layout type specific data and the enum type specific data.

Invariant
l->l_ops->lo_recsize(l) <= l->l_type->lt_ops->lto_max_recsize(l->l_dom);

Definition at line 297 of file layout.h.


The documentation for this struct was generated from the following file: