9#define daos_obj_generate_oid daos_obj_generate_oid2
11#if defined(__cplusplus)
15#include <daos_types.h>
16#include <daos_event.h>
17#include <daos_obj_class.h>
20#define DAOS_OBJ_NIL ((daos_obj_id_t){0})
23#define OID_FMT_INTR_BITS 32
25#define OID_FMT_TYPE_BITS 8
27#define OID_FMT_CLASS_BITS 8
29#define OID_FMT_META_BITS 16
32#define OID_FMT_TYPE_SHIFT (64 - OID_FMT_TYPE_BITS)
34#define OID_FMT_CLASS_SHIFT (OID_FMT_TYPE_SHIFT - OID_FMT_CLASS_BITS)
36#define OID_FMT_META_SHIFT (OID_FMT_CLASS_SHIFT - OID_FMT_META_BITS)
39#define OID_FMT_TYPE_MAX ((1ULL << OID_FMT_TYPE_BITS) - 1)
41#define OID_FMT_CLASS_MAX ((1ULL << OID_FMT_CLASS_BITS) - 1)
43#define OID_FMT_META_MAX ((1ULL << OID_FMT_META_BITS) - 1)
46#define OID_FMT_TYPE_MASK (OID_FMT_TYPE_MAX << OID_FMT_TYPE_SHIFT)
48#define OID_FMT_CLASS_MASK (OID_FMT_CLASS_MAX << OID_FMT_CLASS_SHIFT)
50#define OID_FMT_META_MASK (OID_FMT_META_MAX << OID_FMT_META_SHIFT)
55 DAOS_OT_MULTI_HASHED = 0,
63 DAOS_OT_DKEY_UINT64 = 2,
66 DAOS_OT_AKEY_UINT64 = 3,
69 DAOS_OT_MULTI_UINT64 = 4,
72 DAOS_OT_DKEY_LEXICAL = 5,
75 DAOS_OT_AKEY_LEXICAL = 6,
78 DAOS_OT_MULTI_LEXICAL = 7,
81 DAOS_OT_KV_HASHED = 8,
84 DAOS_OT_KV_UINT64 = 9,
87 DAOS_OT_KV_LEXICAL = 10,
93 DAOS_OT_ARRAY_ATTR = 12,
96 DAOS_OT_ARRAY_BYTE = 13,
117daos_otype_t_is_valid(
enum daos_otype_t type)
119 return type <= DAOS_OT_MAX;
123daos_pa_domain_is_valid(uint32_t pa_domain)
125 return pa_domain == DAOS_PROP_CO_REDUN_NODE || pa_domain == DAOS_PROP_CO_REDUN_RANK;
128static inline enum daos_otype_t
133 type = (oid.
hi & OID_FMT_TYPE_MASK) >> OID_FMT_TYPE_SHIFT;
135 return (
enum daos_otype_t)type;
139daos_is_dkey_lexical_type(
enum daos_otype_t type)
142 case DAOS_OT_DKEY_LEXICAL:
143 case DAOS_OT_MULTI_LEXICAL:
144 case DAOS_OT_KV_LEXICAL:
155 return daos_is_dkey_lexical_type(daos_obj_id2type(oid));
159daos_is_akey_lexical_type(
enum daos_otype_t type)
162 case DAOS_OT_AKEY_LEXICAL:
163 case DAOS_OT_MULTI_LEXICAL:
174 return daos_is_akey_lexical_type(daos_obj_id2type(oid));
178daos_is_dkey_uint64_type(
enum daos_otype_t type)
181 case DAOS_OT_ARRAY_BYTE:
182 case DAOS_OT_MULTI_UINT64:
183 case DAOS_OT_DKEY_UINT64:
184 case DAOS_OT_KV_UINT64:
186 case DAOS_OT_ARRAY_ATTR:
197 return daos_is_dkey_uint64_type(daos_obj_id2type(oid));
201daos_is_akey_uint64_type(
enum daos_otype_t type)
204 case DAOS_OT_MULTI_UINT64:
205 case DAOS_OT_AKEY_UINT64:
216 return daos_is_akey_uint64_type(daos_obj_id2type(oid));
220daos_is_array_type(
enum daos_otype_t type)
223 case DAOS_OT_ARRAY_BYTE:
225 case DAOS_OT_ARRAY_ATTR:
236 enum daos_otype_t type = daos_obj_id2type(oid);
238 return daos_is_array_type(type);
242daos_is_kv_type(
enum daos_otype_t type)
245 case DAOS_OT_KV_HASHED:
246 case DAOS_OT_KV_UINT64:
247 case DAOS_OT_KV_LEXICAL:
258 enum daos_otype_t type = daos_obj_id2type(oid);
260 return daos_is_kv_type(type);
264#define IO_FLAGS_COND_BITS 8
268 DAOS_COND_PUNCH = (1 << 0),
270 DAOS_COND_DKEY_INSERT = (1 << 1),
272 DAOS_COND_DKEY_UPDATE = (1 << 2),
274 DAOS_COND_DKEY_FETCH = (1 << 3),
276 DAOS_COND_AKEY_INSERT = (1 << 4),
278 DAOS_COND_AKEY_UPDATE = (1 << 5),
280 DAOS_COND_AKEY_FETCH = (1 << 6),
285 DAOS_COND_PER_AKEY = (1 << 7),
287 DAOS_COND_MASK = ((1 << IO_FLAGS_COND_BITS) - 1),
304 DAOS_OO_RO = (1 << 1),
306 DAOS_OO_RW = (1 << 2),
308 DAOS_OO_EXCL = (1 << 3),
310 DAOS_OO_IO_RAND = (1 << 4),
312 DAOS_OO_IO_SEQ = (1 << 5),
411#define DAOS_IOMF_DETAIL (0x1U)
460 DAOS_GET_MAX = (1 << 0),
462 DAOS_GET_MIN = (1 << 1),
464 DAOS_GET_DKEY = (1 << 2),
466 DAOS_GET_AKEY = (1 << 3),
468 DAOS_GET_RECX = (1 << 4),
485static enum daos_obj_redun
488 return (
enum daos_obj_redun)((oid.
hi & OID_FMT_CLASS_MASK) >> OID_FMT_CLASS_SHIFT);
491static inline daos_oclass_id_t
494 enum daos_obj_redun ord;
497 ord = daos_obj_id2ord(oid);
498 nr_grps = (oid.
hi & OID_FMT_META_MASK) >> OID_FMT_META_SHIFT;
500 return (ord << OC_REDUN_SHIFT) | nr_grps;
506 return oid.
hi == 0 && oid.
lo == 0;
509#define DAOS_OCH_RDD_BITS 4
510#define DAOS_OCH_SHD_BITS 6
511#define DAOS_OCH_RDD_SHIFT 0
512#define DAOS_OCH_SHD_SHIFT DAOS_OCH_RDD_BITS
513#define DAOS_OCH_RDD_MAX_VAL ((1ULL << DAOS_OCH_RDD_BITS) - 1)
514#define DAOS_OCH_SHD_MAX_VAL ((1ULL << DAOS_OCH_SHD_BITS) - 1)
515#define DAOS_OCH_RDD_MASK (DAOS_OCH_RDD_MAX_VAL << DAOS_OCH_RDD_SHIFT)
516#define DAOS_OCH_SHD_MASK (DAOS_OCH_SHD_MAX_VAL << DAOS_OCH_SHD_SHIFT)
521 DAOS_OCH_RDD_DEF = (1 << 0),
522 DAOS_OCH_RDD_NO = (1 << 1),
523 DAOS_OCH_RDD_RP = (1 << 2),
524 DAOS_OCH_RDD_EC = (1 << 3),
526 DAOS_OCH_SHD_DEF = (1 << 4),
529 DAOS_OCH_SHD_TINY = (1 << 5),
530 DAOS_OCH_SHD_REG = (1 << 6),
531 DAOS_OCH_SHD_HI = (1 << 7),
532 DAOS_OCH_SHD_EXT = (1 << 8),
533 DAOS_OCH_SHD_MAX = (1 << 9),
564 enum daos_otype_t type, daos_oclass_id_t cid,
565 daos_oclass_hints_t hints, uint32_t args);
685 daos_key_t *dkey,
unsigned int nr, daos_key_t *akeys,
773 daos_key_t *dkey,
unsigned int nr,
daos_iod_t *iods,
826 daos_key_t *dkey,
unsigned int nr,
daos_iod_t *iods,
980 daos_key_t *akey, daos_size_t *size, uint32_t *nr,
1030 daos_key_t *dkey, daos_key_t *akey,
daos_recx_t *recx,
1189#define DAOS_OIT_MARKER_MAX_LEN (32)
1277#if defined(__cplusplus)
struct daos_oclass_attr * oa_oa