|
static uint64_t | md_crc32_cksum (void *data, uint64_t len, uint64_t *cksum) |
|
static void | crc_mktable (void) |
|
static uint32_t | crc32 (uint32_t crc, unsigned char const *data, m0_bcount_t len) |
|
M0_INTERNAL void | m0_crc32 (const void *data, uint64_t len, uint64_t *cksum) |
|
M0_INTERNAL bool | m0_crc32_chk (const void *data, uint64_t len, const uint64_t *cksum) |
|
static void | md_crc32_cksum_set (void *data, uint64_t len, uint64_t *cksum) |
|
static bool | md_crc32_cksum_check (void *data, uint64_t len, uint64_t *cksum) |
|
static m0_bcount_t | current_pos (const struct di_info *info, int i) |
|
static uint64_t | file_di_crc_mask (const struct m0_file *file) |
|
static uint64_t | file_di_crc_in_shift (const struct m0_file *file) |
|
static uint64_t | file_di_crc_out_shift (const struct m0_file *file) |
|
static void | file_di_crc_sum (const struct m0_file *file, const struct m0_indexvec *io_info, const struct m0_bufvec *in_vec, struct m0_bufvec *di_vec) |
|
static bool | file_di_crc_check (const struct m0_file *file, const struct m0_indexvec *io_info, const struct m0_bufvec *in_vec, const struct m0_bufvec *di_vec) |
|
static void | file_checksum (void(*checksum)(const void *data, m0_bcount_t bsize, uint64_t *csum), const struct m0_bufvec *in_vec, const struct m0_indexvec *io_info, struct di_info *di, struct m0_bufvec *di_vec) |
|
static bool | file_checksum_check (bool(*checksum)(const void *data, m0_bcount_t bsize, const uint64_t *csum), const struct m0_bufvec *in_vec, const struct m0_indexvec *io_info, struct di_info *di, const struct m0_bufvec *di_vec) |
|
static void | t10_ref_tag_compute (const struct m0_indexvec *io_info, struct di_info *di, struct m0_bufvec *di_vec) |
|
static bool | t10_ref_tag_check (const struct m0_indexvec *io_info, struct di_info *di, const struct m0_bufvec *di_vec) |
|
static void | file_di_info_setup (const struct m0_file *file, const struct m0_indexvec *io_info, struct di_info *di) |
|
static void | file_di_none_sum (const struct m0_file *file, const struct m0_indexvec *io_info, const struct m0_bufvec *in_vec, struct m0_bufvec *di_vec) |
|
static bool | file_di_none_check (const struct m0_file *file, const struct m0_indexvec *io_info, const struct m0_bufvec *in_vec, const struct m0_bufvec *di_vec) |
|
static uint64_t | file_di_none_mask (const struct m0_file *file) |
|
static uint64_t | file_di_none_in_shift (const struct m0_file *file) |
|
static uint64_t | file_di_none_out_shift (const struct m0_file *file) |
|
static bool | file_di_invariant (const struct m0_bufvec *in_vec, const struct m0_bufvec *di_vec, const struct m0_indexvec *io_info, const struct di_info *di) |
|
M0_INTERNAL const struct m0_di_ops * | m0_di_ops_get (enum m0_di_types di_type) |
|
M0_INTERNAL void | m0_md_di_set (void *addr, m0_bcount_t nob, uint64_t *cksum_field) |
|
M0_INTERNAL bool | m0_md_di_chk (void *addr, m0_bcount_t nob, uint64_t *cksum_field) |
|
M0_INTERNAL m0_bcount_t | m0_di_size_get (const struct m0_file *file, const m0_bcount_t size) |
|
Checksum for data blocks is computed based on checksum algorithm selected from configuration. Also checksum length is chosen based on this algorithm.
A di data bufvec, consisting of a single buffer is added as m0_buf in iofop and passed across the network.
Data-integrity type represents a particular combination of data-integrity methods applied to a file.
i.e., data-integrity type prescribes a particular check-summing algorithm with a particular block size, producing output of a particular size, plus, possibly, a particular encryption algorithm, etc.
Data integrity type and operations are initialized in m0_file. Using do_sum(), checksum values are computed for each block of data and using do_chk() checksum values are verified.
For documentation links, please refer to this file : doc/motr-design-doc-list.rst
◆ CRC_POLY
#define CRC_POLY 0x04C11DB7 |
Table-driven implementaion of crc32. CRC table is generated during first crc operation which contains the all possible crc values for the byte of data. These values are used to compute CRC for the all the bytes of data in the block of given length.
Definition at line 40 of file crc.c.
◆ CRC_SLICE_SIZE
Definition at line 42 of file crc.c.
◆ CRC_TABLE_SIZE
#define CRC_TABLE_SIZE 256 |
Definition at line 43 of file crc.c.
◆ CRC_WIDTH
Definition at line 41 of file crc.c.
◆ M0_MD_DI_CHK
Value:({ \
m0_md_di_chk(__obj,
sizeof *(
obj), &__obj->field); \
})
Definition at line 164 of file di.h.
◆ M0_MD_DI_SET
Value:({ \
m0_md_di_set(__obj,
sizeof *(
obj), &__obj->field); \
})
Definition at line 158 of file di.h.
◆ M0_TRACE_SUBSYSTEM
#define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_FILE |
Definition at line 28 of file di.c.
◆ anonymous enum
Enumerator |
---|
M0_DI_DEFAULT_TYPE | |
Definition at line 83 of file di.h.
◆ m0_di_checksum_len
Enumerator |
---|
M0_DI_CRC32_LEN | |
M0_DI_ELEMENT_SIZE | |
Definition at line 67 of file di.h.
◆ m0_di_types
Enumerator |
---|
M0_DI_NONE | |
M0_DI_CRC32_4K | CRC32 checksum for block size data of 4k.
|
M0_DI_CRC32_64K | CRC32 checksum for block size data of 16k.
|
M0_DI_T10_DIF | T10 tag for block size data of 4k.
|
M0_DI_NR | |
Definition at line 72 of file di.h.
◆ crc32()
static uint32_t crc32 |
( |
uint32_t |
crc, |
|
|
unsigned char const * |
data, |
|
|
m0_bcount_t |
len |
|
) |
| |
|
static |
Definition at line 66 of file crc.c.
◆ crc_mktable()
static void crc_mktable |
( |
void |
| ) |
|
|
static |
Definition at line 48 of file crc.c.
◆ current_pos()
Definition at line 45 of file di.c.
◆ file_checksum()
Definition at line 227 of file di.c.
◆ file_checksum_check()
Definition at line 290 of file di.c.
◆ file_di_crc_check()
Definition at line 255 of file di.c.
◆ file_di_crc_in_shift()
static uint64_t file_di_crc_in_shift |
( |
const struct m0_file * |
file | ) |
|
|
static |
Definition at line 153 of file di.c.
◆ file_di_crc_mask()
static uint64_t file_di_crc_mask |
( |
const struct m0_file * |
file | ) |
|
|
static |
Definition at line 148 of file di.c.
◆ file_di_crc_out_shift()
static uint64_t file_di_crc_out_shift |
( |
const struct m0_file * |
file | ) |
|
|
static |
Definition at line 158 of file di.c.
◆ file_di_crc_sum()
Definition at line 163 of file di.c.
◆ file_di_info_setup()
Definition at line 182 of file di.c.
◆ file_di_invariant()
Definition at line 193 of file di.c.
◆ file_di_none_check()
Definition at line 105 of file di.c.
◆ file_di_none_in_shift()
static uint64_t file_di_none_in_shift |
( |
const struct m0_file * |
file | ) |
|
|
static |
Definition at line 118 of file di.c.
◆ file_di_none_mask()
static uint64_t file_di_none_mask |
( |
const struct m0_file * |
file | ) |
|
|
static |
Definition at line 113 of file di.c.
◆ file_di_none_out_shift()
static uint64_t file_di_none_out_shift |
( |
const struct m0_file * |
file | ) |
|
|
static |
Definition at line 123 of file di.c.
◆ file_di_none_sum()
Definition at line 97 of file di.c.
◆ m0_crc32()
M0_INTERNAL void m0_crc32 |
( |
const void * |
data, |
|
|
uint64_t |
len, |
|
|
uint64_t * |
cksum |
|
) |
| |
Computes crc32 checksum for data of length "len" and stores it in "cksum".
- Parameters
-
data | A block of data of size "len". |
len | Length of data. |
cksum | Checksum values to be computed are stored in it. |
Definition at line 83 of file crc.c.
◆ m0_crc32_chk()
M0_INTERNAL bool m0_crc32_chk |
( |
const void * |
data, |
|
|
uint64_t |
len, |
|
|
const uint64_t * |
cksum |
|
) |
| |
Compares the crc32 checksum for data of length "len" with checksum values in "cksum".
- Parameters
-
data | A block of data of size "len". |
len | Length of data. |
cksum | Checksum values to be verified are read from it.. |
Definition at line 93 of file crc.c.
◆ m0_di_ops_get()
Returns di ops for a given di_type.
Definition at line 365 of file di.c.
◆ m0_di_size_get()
Definition at line 384 of file di.c.
◆ m0_md_di_chk()
M0_INTERNAL bool m0_md_di_chk |
( |
void * |
addr, |
|
|
m0_bcount_t |
nob, |
|
|
uint64_t * |
cksum_field |
|
) |
| |
Compares the checksum value in cksum_field with the computed checksum for this region.
- Parameters
-
cksum_field | Address of the checksum field |
Definition at line 378 of file di.c.
◆ m0_md_di_set()
M0_INTERNAL void m0_md_di_set |
( |
void * |
addr, |
|
|
m0_bcount_t |
nob, |
|
|
uint64_t * |
cksum_field |
|
) |
| |
Computes the checksum for the region excluding checksum field and sets this value in the checksum field.
- Parameters
-
cksum_field | Address of the checksum field |
Definition at line 372 of file di.c.
◆ md_crc32_cksum()
static uint64_t md_crc32_cksum |
( |
void * |
data, |
|
|
uint64_t |
len, |
|
|
uint64_t * |
cksum |
|
) |
| |
|
static |
◆ md_crc32_cksum_check()
static bool md_crc32_cksum_check |
( |
void * |
data, |
|
|
uint64_t |
len, |
|
|
uint64_t * |
cksum |
|
) |
| |
|
static |
◆ md_crc32_cksum_set()
static void md_crc32_cksum_set |
( |
void * |
data, |
|
|
uint64_t |
len, |
|
|
uint64_t * |
cksum |
|
) |
| |
|
static |
◆ t10_ref_tag_check()
Definition at line 339 of file di.c.
◆ t10_ref_tag_compute()
Definition at line 321 of file di.c.
◆ crc_table
Definition at line 45 of file crc.c.
◆ di_ops
Initial value:= {
},
},
}
static void file_di_none_sum(const struct m0_file *file, const struct m0_indexvec *io_info, const struct m0_bufvec *in_vec, struct m0_bufvec *di_vec)
static struct m0_di_type file_di_crc
static bool file_di_crc_check(const struct m0_file *file, const struct m0_indexvec *io_info, const struct m0_bufvec *in_vec, const struct m0_bufvec *di_vec)
static void file_di_crc_sum(const struct m0_file *file, const struct m0_indexvec *io_info, const struct m0_bufvec *in_vec, struct m0_bufvec *di_vec)
static bool file_di_none_check(const struct m0_file *file, const struct m0_indexvec *io_info, const struct m0_bufvec *in_vec, const struct m0_bufvec *di_vec)
static uint64_t file_di_none_mask(const struct m0_file *file)
static uint64_t file_di_crc_in_shift(const struct m0_file *file)
static uint64_t file_di_none_in_shift(const struct m0_file *file)
static uint64_t file_di_crc_out_shift(const struct m0_file *file)
static uint64_t file_di_crc_mask(const struct m0_file *file)
static uint64_t file_di_none_out_shift(const struct m0_file *file)
static struct m0_di_type file_di_none_type
Definition at line 128 of file di.c.
◆ file_di_crc
Initial value:= {
.dt_name = "crc32-4k+t10-ref-tag",
}
Definition at line 89 of file di.c.
◆ file_di_none_type
Initial value:= {
.dt_name = "di-none",
}
Definition at line 93 of file di.c.
◆ is_table
Definition at line 46 of file crc.c.