9#if defined(__cplusplus)
13#include <daos_types.h>
14#include <daos_event.h>
15#include <daos_obj_class.h>
17#define DAOS_OBJ_NIL ((daos_obj_id_t){0})
20#define OID_FMT_INTR_BITS 32
22#define OID_FMT_TYPE_BITS 8
24#define OID_FMT_CLASS_BITS 8
26#define OID_FMT_META_BITS 16
29#define OID_FMT_TYPE_SHIFT (64 - OID_FMT_TYPE_BITS)
31#define OID_FMT_CLASS_SHIFT (OID_FMT_TYPE_SHIFT - OID_FMT_CLASS_BITS)
33#define OID_FMT_META_SHIFT (OID_FMT_CLASS_SHIFT - OID_FMT_META_BITS)
36#define OID_FMT_TYPE_MAX ((1ULL << OID_FMT_TYPE_BITS) - 1)
38#define OID_FMT_CLASS_MAX ((1ULL << OID_FMT_CLASS_BITS) - 1)
40#define OID_FMT_META_MAX ((1ULL << OID_FMT_META_BITS) - 1)
43#define OID_FMT_TYPE_MASK (OID_FMT_TYPE_MAX << OID_FMT_TYPE_SHIFT)
45#define OID_FMT_CLASS_MASK (OID_FMT_CLASS_MAX << OID_FMT_CLASS_SHIFT)
47#define OID_FMT_META_MASK (OID_FMT_META_MAX << OID_FMT_META_SHIFT)
52 DAOS_OT_MULTI_HASHED = 0,
60 DAOS_OT_DKEY_UINT64 = 2,
63 DAOS_OT_AKEY_UINT64 = 3,
66 DAOS_OT_MULTI_UINT64 = 4,
69 DAOS_OT_DKEY_LEXICAL = 5,
72 DAOS_OT_AKEY_LEXICAL = 6,
75 DAOS_OT_MULTI_LEXICAL = 7,
78 DAOS_OT_KV_HASHED = 8,
81 DAOS_OT_KV_UINT64 = 9,
84 DAOS_OT_KV_LEXICAL = 10,
90 DAOS_OT_ARRAY_ATTR = 12,
93 DAOS_OT_ARRAY_BYTE = 13,
108daos_otype_t_is_valid(
enum daos_otype_t type)
110 return type <= DAOS_OT_MAX;
113static inline enum daos_otype_t
118 type = (oid.hi & OID_FMT_TYPE_MASK) >> OID_FMT_TYPE_SHIFT;
120 return (
enum daos_otype_t)type;
124daos_is_dkey_lexical_type(
enum daos_otype_t type)
127 case DAOS_OT_DKEY_LEXICAL:
128 case DAOS_OT_MULTI_LEXICAL:
129 case DAOS_OT_KV_LEXICAL:
140 return daos_is_dkey_lexical_type(daos_obj_id2type(oid));
144daos_is_akey_lexical_type(
enum daos_otype_t type)
147 case DAOS_OT_AKEY_LEXICAL:
148 case DAOS_OT_MULTI_LEXICAL:
159 return daos_is_akey_lexical_type(daos_obj_id2type(oid));
163daos_is_dkey_uint64_type(
enum daos_otype_t type)
166 case DAOS_OT_MULTI_UINT64:
167 case DAOS_OT_DKEY_UINT64:
168 case DAOS_OT_KV_UINT64:
170 case DAOS_OT_ARRAY_ATTR:
171 case DAOS_OT_ARRAY_BYTE:
182 return daos_is_dkey_uint64_type(daos_obj_id2type(oid));
186daos_is_akey_uint64_type(
enum daos_otype_t type)
189 case DAOS_OT_MULTI_UINT64:
190 case DAOS_OT_AKEY_UINT64:
201 return daos_is_akey_uint64_type(daos_obj_id2type(oid));
205daos_is_array_type(
enum daos_otype_t type)
209 case DAOS_OT_ARRAY_ATTR:
210 case DAOS_OT_ARRAY_BYTE:
221 enum daos_otype_t type = daos_obj_id2type(oid);
223 return daos_is_array_type(type);
227daos_is_kv_type(
enum daos_otype_t type)
230 case DAOS_OT_KV_HASHED:
231 case DAOS_OT_KV_UINT64:
232 case DAOS_OT_KV_LEXICAL:
243 enum daos_otype_t type = daos_obj_id2type(oid);
245 return daos_is_kv_type(type);
249#define IO_FLAGS_COND_BITS 8
253 DAOS_COND_PUNCH = (1 << 0),
255 DAOS_COND_DKEY_INSERT = (1 << 1),
257 DAOS_COND_DKEY_UPDATE = (1 << 2),
259 DAOS_COND_DKEY_FETCH = (1 << 3),
261 DAOS_COND_AKEY_INSERT = (1 << 4),
263 DAOS_COND_AKEY_UPDATE = (1 << 5),
265 DAOS_COND_AKEY_FETCH = (1 << 6),
270 DAOS_COND_PER_AKEY = (1 << 7),
272 DAOS_COND_MASK = ((1 << IO_FLAGS_COND_BITS) - 1),
289 DAOS_OO_RO = (1 << 1),
291 DAOS_OO_RW = (1 << 2),
293 DAOS_OO_EXCL = (1 << 3),
295 DAOS_OO_IO_RAND = (1 << 4),
297 DAOS_OO_IO_SEQ = (1 << 5),
369 daos_iod_type_t iod_type;
404#define DAOS_IOMF_DETAIL (0x1U)
452 DAOS_GET_MAX = (1 << 0),
454 DAOS_GET_MIN = (1 << 1),
456 DAOS_GET_DKEY = (1 << 2),
458 DAOS_GET_AKEY = (1 << 3),
460 DAOS_GET_RECX = (1 << 4),
477static inline daos_oclass_id_t
480 enum daos_obj_redun ord;
483 ord = (
enum daos_obj_redun)((oid.hi & OID_FMT_CLASS_MASK) >> OID_FMT_CLASS_SHIFT);
484 nr_grps = (oid.hi & OID_FMT_META_MASK) >> OID_FMT_META_SHIFT;
486 return (ord << OC_REDUN_SHIFT) | nr_grps;
492 return oid.hi == 0 && oid.lo == 0;
495#define DAOS_OCH_RDD_BITS 4
496#define DAOS_OCH_SHD_BITS 6
497#define DAOS_OCH_RDD_SHIFT 0
498#define DAOS_OCH_SHD_SHIFT DAOS_OCH_RDD_BITS
499#define DAOS_OCH_RDD_MAX_VAL ((1ULL << DAOS_OCH_RDD_BITS) - 1)
500#define DAOS_OCH_SHD_MAX_VAL ((1ULL << DAOS_OCH_SHD_BITS) - 1)
501#define DAOS_OCH_RDD_MASK (DAOS_OCH_RDD_MAX_VAL << DAOS_OCH_RDD_SHIFT)
502#define DAOS_OCH_SHD_MASK (DAOS_OCH_SHD_MAX_VAL << DAOS_OCH_SHD_SHIFT)
507 DAOS_OCH_RDD_DEF = (1 << 0),
508 DAOS_OCH_RDD_NO = (1 << 1),
509 DAOS_OCH_RDD_RP = (1 << 2),
510 DAOS_OCH_RDD_EC = (1 << 3),
512 DAOS_OCH_SHD_DEF = (1 << 4),
515 DAOS_OCH_SHD_TINY = (1 << 5),
516 DAOS_OCH_SHD_REG = (1 << 6),
517 DAOS_OCH_SHD_HI = (1 << 7),
518 DAOS_OCH_SHD_EXT = (1 << 8),
519 DAOS_OCH_SHD_MAX = (1 << 9),
550 enum daos_otype_t type, daos_oclass_id_t cid,
551 daos_oclass_hints_t hints, uint32_t args);
671 daos_key_t *dkey,
unsigned int nr, daos_key_t *akeys,
759 daos_key_t *dkey,
unsigned int nr,
daos_iod_t *iods,
812 daos_key_t *dkey,
unsigned int nr,
daos_iod_t *iods,
966 daos_key_t *akey, daos_size_t *size, uint32_t *nr,
1016 daos_key_t *dkey, daos_key_t *akey,
daos_recx_t *recx,
1140typedef uint16_t daos_ofeat_t;
1143 daos_ofeat_t type, daos_oclass_id_t cid,
1144 daos_oclass_hints_t hints, uint32_t args);
1147 enum daos_otype_t type, daos_oclass_id_t cid,
1148 daos_oclass_hints_t hints, uint32_t args);
1153#define DAOS_OF_DKEY_UINT64 ((daos_ofeat_t)(1 << 0))
1155#define DAOS_OF_DKEY_LEXICAL ((daos_ofeat_t)(1 << 1))
1159#define DAOS_OF_AKEY_UINT64 ((daos_ofeat_t)(1 << 2))
1161#define DAOS_OF_AKEY_LEXICAL ((daos_ofeat_t)(1 << 3))
1163#define DAOS_OF_KV_FLAT ((daos_ofeat_t)(1 << 4))
1165#define DAOS_OF_ARRAY ((daos_ofeat_t)(1 << 5))
1167#define DAOS_OF_ARRAY_MD ((daos_ofeat_t)(1 << 6))
1169#define DAOS_OF_ARRAY_BYTE ((daos_ofeat_t)(1 << 7))
1176#define DAOS_OF_ECHO ((daos_ofeat_t)(1 << 15))
1178#define DAOS_OF_MASK ((daos_ofeat_t)((1 << 16) - 1))
1180#if defined(__cplusplus)
1182#define daos_obj_generate_oid daos_obj_generate_oid_cpp
1185 enum daos_otype_t type, daos_oclass_id_t cid,
1186 daos_oclass_hints_t hints, uint32_t args)
1188 return daos_obj_generate_oid2(coh, oid, type, cid, hints, args);
1192 daos_ofeat_t feat, daos_oclass_id_t cid,
1193 daos_oclass_hints_t hints, uint32_t args)
1195 return daos_obj_generate_oid1(coh, oid, feat, cid, hints, args);
1202#define daos_obj_generate_oid(coh, oid, type, ...) \
1205 if (__builtin_types_compatible_p(__typeof__(type), \
1207 _ret = daos_obj_generate_oid((coh), (oid), \
1211 _ret = daos_obj_generate_oid2((coh), (oid), \
struct daos_oclass_attr * oa_oa