Motr  M0
types.h File Reference
Include dependency graph for types.h:

Go to the source code of this file.

Data Structures

struct  m0_uint128
 

Macros

#define __MOTR_LIB_TYPES_H__
 
#define M0_UINT128(hi, lo)   (struct m0_uint128) { .u_hi = (hi), .u_lo = (lo) }
 
#define U128X_F   "%" PRIx64 ":%" PRIx64
 
#define U128D_F   "%" PRId64 ":%" PRId64
 
#define U128I_F   "%" PRIi64 ":%" PRIi64
 
#define U128_P(x)   (x)->u_hi, (x)->u_lo
 
#define U128_S(u)   &(u)->u_hi, &(u)->u_lo
 
#define U128X_F_SAFE   "%s%" PRIx64 ":%" PRIx64
 
#define U128_P_SAFE(x)
 
#define U128_P_SAFE_EX(y, x)
 

Typedefs

typedef uint64_t m0_bcount_t
 
typedef uint64_t m0_bindex_t
 

Enumerations

enum  { M0_BCOUNT_MAX = 0xffffffffffffffff, M0_BINDEX_MAX = M0_BCOUNT_MAX - 1, M0_BSIGNED_MAX = 0x7fffffffffffffff }
 

Functions

struct m0_uint128 M0_XCA_DOMAIN (rpc)
 
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 void m0_uint128_init (struct m0_uint128 *u128, const char *magic)
 
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)
 
M0_INTERNAL int m0_uint128_sscanf (const char *s, struct m0_uint128 *u128)
 

Variables

uint64_t u_hi
 
uint64_t u_lo
 
enum { ... }  M0_XCA_DOMAIN
 

Macro Definition Documentation

◆ __MOTR_LIB_TYPES_H__

#define __MOTR_LIB_TYPES_H__

Definition at line 26 of file types.h.

◆ M0_UINT128

#define M0_UINT128 (   hi,
  lo 
)    (struct m0_uint128) { .u_hi = (hi), .u_lo = (lo) }

Definition at line 40 of file types.h.

◆ U128_P

#define U128_P (   x)    (x)->u_hi, (x)->u_lo

Definition at line 45 of file types.h.

◆ U128_P_SAFE

#define U128_P_SAFE (   x)
Value:
((x) != NULL ? "" : "(null) "), \
((x) != NULL ? (x)->u_hi : 0), ((x) != NULL ? (x)->u_lo : 0)
#define NULL
Definition: misc.h:38
static bool x
Definition: sm.c:168
uint64_t u_lo
Definition: types.h:58

Definition at line 49 of file types.h.

◆ U128_P_SAFE_EX

#define U128_P_SAFE_EX (   y,
  x 
)
Value:
((y) != NULL ? "" : "(null) "), \
((y) != NULL ? (x)->u_hi : 0), ((y) != NULL ? (x)->u_lo : 0)
#define NULL
Definition: misc.h:38
static bool x
Definition: sm.c:168
uint64_t u_lo
Definition: types.h:58

Definition at line 53 of file types.h.

◆ U128_S

#define U128_S (   u)    &(u)->u_hi, &(u)->u_lo

Definition at line 46 of file types.h.

◆ U128D_F

#define U128D_F   "%" PRId64 ":%" PRId64

Definition at line 43 of file types.h.

◆ U128I_F

#define U128I_F   "%" PRIi64 ":%" PRIi64

Definition at line 44 of file types.h.

◆ U128X_F

#define U128X_F   "%" PRIx64 ":%" PRIx64

Definition at line 42 of file types.h.

◆ U128X_F_SAFE

#define U128X_F_SAFE   "%s%" PRIx64 ":%" PRIx64

Definition at line 48 of file types.h.

Typedef Documentation

◆ m0_bcount_t

typedef uint64_t m0_bcount_t

count of bytes (in extent, IO operation, etc.)

Definition at line 77 of file types.h.

◆ m0_bindex_t

typedef uint64_t m0_bindex_t

an index (offset) in a linear name-space (e.g., in a file, storage object, storage device, memory buffer) measured in bytes

Definition at line 80 of file types.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
M0_BCOUNT_MAX 
M0_BINDEX_MAX 
M0_BSIGNED_MAX 

Definition at line 82 of file types.h.

Function Documentation

◆ m0_uint128_add()

M0_INTERNAL void m0_uint128_add ( struct m0_uint128 res,
const struct m0_uint128 a,
const struct m0_uint128 b 
)

res = a + b;

Definition at line 62 of file misc.c.

Here is the caller graph for this function:

◆ m0_uint128_cmp()

M0_INTERNAL int m0_uint128_cmp ( const struct m0_uint128 u0,
const struct m0_uint128 u1 
)

Definition at line 45 of file misc.c.

Here is the caller graph for this function:

◆ m0_uint128_eq()

M0_INTERNAL bool m0_uint128_eq ( const struct m0_uint128 u0,
const struct m0_uint128 u1 
)

Definition at line 39 of file misc.c.

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

◆ m0_uint128_init()

M0_INTERNAL void m0_uint128_init ( struct m0_uint128 u128,
const char *  magic 
)

Definition at line 150 of file misc.c.

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

◆ m0_uint128_mul64()

M0_INTERNAL void m0_uint128_mul64 ( struct m0_uint128 res,
uint64_t  a,
uint64_t  b 
)

res = a * b;

Definition at line 76 of file misc.c.

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

◆ m0_uint128_sscanf()

M0_INTERNAL int m0_uint128_sscanf ( const char *  s,
struct m0_uint128 u128 
)

Scans uint128 in num:num format, where num can be in hex, octal or decimal format (depending on prefix).

Definition at line 51 of file misc.c.

◆ M0_XCA_DOMAIN()

struct m0_uint128 M0_XCA_DOMAIN ( rpc  )

Variable Documentation

◆ M0_XCA_DOMAIN

enum { ... } M0_XCA_DOMAIN

◆ u_hi

uint64_t u_hi

Definition at line 57 of file types.h.

◆ u_lo

uint64_t u_lo

Definition at line 58 of file types.h.