|
void | __dummy_function (void) |
|
| M0_BASSERT (sizeof(struct m0_uint128)==16) |
|
M0_INTERNAL bool | m0_uint128_eq (const struct m0_uint128 *u0, const struct m0_uint128 *u1) |
|
M0_INTERNAL int | m0_uint128_cmp (const struct m0_uint128 *u0, const struct m0_uint128 *u1) |
|
M0_INTERNAL int | m0_uint128_sscanf (const char *s, struct m0_uint128 *u128) |
|
M0_INTERNAL void | m0_uint128_add (struct m0_uint128 *res, const struct m0_uint128 *a, const struct m0_uint128 *b) |
|
M0_INTERNAL void | m0_uint128_mul64 (struct m0_uint128 *res, uint64_t a, uint64_t b) |
|
uint64_t | m0_rnd64 (uint64_t *prev) |
|
uint64_t | m0_rnd (uint64_t max, uint64_t *prev) |
|
M0_INTERNAL uint64_t | m0_gcd64 (uint64_t p, uint64_t q) |
|
static uint64_t | m0u64 (const unsigned char *s) |
|
M0_INTERNAL void | m0_uint128_init (struct m0_uint128 *u128, const char *magic) |
|
static int64_t | getdelta (uint64_t x0, uint64_t x1) |
|
M0_INTERNAL bool | m0_mod_gt (uint64_t x0, uint64_t x1) |
|
M0_INTERNAL bool | m0_mod_ge (uint64_t x0, uint64_t x1) |
|
M0_INTERNAL uint64_t | m0_round_up (uint64_t val, uint64_t size) |
|
M0_INTERNAL uint64_t | m0_round_down (uint64_t val, uint64_t size) |
|
| M0_BASSERT (ergo(false, false)==true) |
|
| M0_BASSERT (ergo(false, true)==true) |
|
| M0_BASSERT (ergo(true, false)==false) |
|
| M0_BASSERT (ergo(true, true)==true) |
|
| M0_BASSERT (equi(false, false)==true) |
|
| M0_BASSERT (equi(false, true)==false) |
|
| M0_BASSERT (equi(true, false)==false) |
|
| M0_BASSERT (equi(true, true)==true) |
|
M0_INTERNAL const char * | m0_bool_to_str (bool b) |
|
M0_INTERNAL const char * | m0_short_file_name (const char *fname) |
|
M0_INTERNAL uint32_t | m0_no_of_bits_set (uint64_t val) |
|
M0_INTERNAL bool | m0_elems_are_unique (const void *array, unsigned nr_elems, size_t elem_size) |
|
M0_INTERNAL unsigned int | m0_full_name_hash (const unsigned char *name, unsigned int len) |
|
M0_INTERNAL uint64_t | m0_ptr_wrap (const void *p) |
|
M0_INTERNAL const void * | m0_ptr_unwrap (uint64_t val) |
|
M0_INTERNAL void | m0_permute (uint64_t n, uint64_t *k, uint64_t *s, uint64_t *r) |
|
M0_INTERNAL void | m0_array_sort (uint64_t *arr, uint64_t arr_len) |
|
M0_INTERNAL bool | m0_bit_get (void *buffer, m0_bcount_t i) |
|
M0_INTERNAL void | m0_bit_set (void *buffer, m0_bcount_t i, bool val) |
|
M0_INTERNAL bool | m0_key_val_is_null (struct m0_key_val *kv) |
|
M0_INTERNAL void | m0_key_val_init (struct m0_key_val *kv, const struct m0_buf *key, const struct m0_buf *val) |
|
M0_INTERNAL void | m0_key_val_null_set (struct m0_key_val *kv) |
|
M0_INTERNAL void * | m0_vote_majority_get (struct m0_key_val *arr, uint32_t len, bool(*cmp)(const struct m0_buf *, const struct m0_buf *), uint32_t *vote_nr) |
|
M0_INTERNAL uint64_t | m0_dummy_id_generate (void) |
|
M0_INTERNAL uint64_t m0_ptr_wrap |
( |
const void * |
p | ) |
|
Converts Motr function pointer in a form that can be stored somewhere (e.g., in a trace log or addb2 record) and later decoded back into original pointer.
Such transformation is needed, because function pointers depend on the address at which Motr library is loaded.
- Precondition
- "p" must be a pointer to Motr executable code or NULL.
Definition at line 277 of file misc.c.
M0_INTERNAL const char* m0_short_file_name |
( |
const char * |
fname | ) |
|
Extracts the file name, relative to a motr sources directory, from a full-path file name. A motr source directory is detected by a name "motr/".
For example, given the following full-path file name:
/path/to/motr/lib/ut/finject.c
A short file name, relative to the "motr/" directory, is:
lib/ut/finject.c
- Bug:
- { This function doesn't search for the rightmost occurrence of "motr/" in a file path, if "motr/" encounters several times in the path the first one will be picked up:
/path/to/motr/fs/motr/lib/misc.h => fs/motr/lib/misc.h
}
- Parameters
-
- Returns
- short file name - a pointer inside fname string to the remaining file path, after motr source directory; if short file name cannot be found, then full fname is returned.
Definition at line 212 of file misc.c.