Motr
M0
|
Data Structures | |
struct | m0_format_header |
struct | m0_format_footer |
struct | m0_format_tag |
struct | m0_be_mutex |
struct | m0_be_rwlock |
struct | m0_be_clink |
struct | m0_be_chan |
Macros | |
#define | M0_BE_MUTEX_PAD 168 |
#define | M0_BE_RWLOCK_PAD 144 |
#define | M0_BE_CLINK_PAD sizeof(struct m0_clink) |
Functions | |
M0_INTERNAL void | m0_format_header_pack (struct m0_format_header *dest, const struct m0_format_tag *src) |
M0_INTERNAL void | m0_format_header_unpack (struct m0_format_tag *dest, const struct m0_format_header *src) |
M0_INTERNAL void | m0_format_footer_generate (struct m0_format_footer *footer, const void *buffer, uint32_t size) |
static int | get_footer_from_buf (const void *buffer, const struct m0_format_footer **footer, uint32_t *footer_offset) |
M0_INTERNAL void | m0_format_footer_update (const void *buffer) |
static void | format_iem_post (const char *msg, bool iem) |
M0_INTERNAL int | m0_format_footer_verify_generic (const struct m0_format_footer *footer, const void *buffer, uint32_t size, bool iem) |
M0_INTERNAL int | m0_format_footer_verify (const void *buffer, bool iem) |
struct m0_format_header | M0_XCA_DOMAIN (be|rpc) |
M0_BASSERT (M0_FORMAT_TYPE_NR< UINT16_MAX) | |
struct m0_be_mutex | M0_XCA_DOMAIN (be) |
M0_BASSERT (sizeof(struct m0_mutex)<=sizeof(M0_FIELD_VALUE(struct m0_be_mutex, bm_u.pad))) | |
M0_BASSERT (sizeof(struct m0_rwlock)<=sizeof(M0_FIELD_VALUE(struct m0_be_rwlock, bl_u.pad))) | |
M0_BASSERT (sizeof(struct m0_clink)<=sizeof(M0_FIELD_VALUE(struct m0_be_clink, bc_u.pad))) | |
Variables | |
struct m0_format_tag | M0_XCA_DOMAIN |
enum m0_format_type | M0_XCA_ENUM |
enum m0_format_type |
Format types
|
static |
|
static |
M0_BASSERT | ( | ) |
M0_BASSERT | ( | sizeof(struct m0_mutex)<=sizeof(M0_FIELD_VALUE(struct m0_be_mutex, bm_u.pad)) | ) |
M0_BASSERT | ( | sizeof(struct m0_rwlock)<=sizeof(M0_FIELD_VALUE(struct m0_be_rwlock, bl_u.pad)) | ) |
M0_BASSERT | ( | sizeof(struct m0_clink)<=sizeof(M0_FIELD_VALUE(struct m0_be_clink, bc_u.pad)) | ) |
M0_INTERNAL void m0_format_footer_generate | ( | struct m0_format_footer * | footer, |
const void * | buffer, | ||
uint32_t | size | ||
) |
M0_INTERNAL void m0_format_footer_update | ( | const void * | buffer | ) |
Updates existing footer in a struct.
Expects a corretcly filled m0_format_header to be present at the beginning of a buffer.
Definition at line 95 of file format.c.
M0_INTERNAL int m0_format_footer_verify | ( | const void * | buffer, |
bool | iem | ||
) |
A wrapper around m0_format_footer_verify_generic() for the case when header and footer are contained withing the same parent/container struct.
buffer | - should point to a struct with m0_format_header and m0_format_footer inside; header should be right at the beginning of the struct; checksum is verified for the header and all other fields in the struct, which come after it but before the footer. |
iem | - true for metadata operations. false for non metadata operations and tools. |
Definition at line 149 of file format.c.
M0_INTERNAL int m0_format_footer_verify_generic | ( | const struct m0_format_footer * | footer, |
const void * | buffer, | ||
uint32_t | size, | ||
bool | iem | ||
) |
Verifies format footer, ensuring that checksum in the footer matches the data. It can be used when header and footer aren't contained within the same parent/container struct
footer | - actual footer, with original checksum |
buffer | - beginning of the data for which checksum is calculated |
size | - size of the data |
iem | - true for metadata operations. false for non metadata operations and tools. |
Definition at line 125 of file format.c.
M0_INTERNAL void m0_format_header_pack | ( | struct m0_format_header * | dest, |
const struct m0_format_tag * | src | ||
) |
M0_INTERNAL void m0_format_header_unpack | ( | struct m0_format_tag * | dest, |
const struct m0_format_header * | src | ||
) |
struct m0_format_header M0_XCA_DOMAIN | ( | be| | rpc | ) |
struct m0_be_mutex M0_XCA_DOMAIN | ( | be | ) |
struct m0_format_tag M0_XCA_DOMAIN |
enum m0_format_type M0_XCA_ENUM |