DAOS API (v2.0)
Loading...
Searching...
No Matches
daos_types.h
1
10#ifndef DAOS_TYPES_H
11#define DAOS_TYPES_H
12
13#if defined(__cplusplus)
14extern "C" {
15#endif
16
17#include <stdint.h>
18#include <stdio.h>
19#include <string.h>
20#include <stdbool.h>
21
23#include <uuid/uuid.h>
25#include <cart/types.h>
26
27#include <daos_errno.h>
28
30#define DAOS_SYS_NAME_MAX 15
31
33#define DAOS_SYS_INFO_STRING_MAX 63
34
39typedef uint64_t daos_size_t;
40typedef uint64_t daos_off_t;
41
42#define crt_proc_daos_key_t crt_proc_d_iov_t
43#define crt_proc_daos_size_t crt_proc_uint64_t
44#define crt_proc_daos_epoch_t crt_proc_uint64_t
45
47#define DAOS_HKEY_MAX 32
48
49typedef enum {
50 DAOS_ANCHOR_TYPE_ZERO = 0,
51 DAOS_ANCHOR_TYPE_HKEY = 1,
52 DAOS_ANCHOR_TYPE_KEY = 2,
53 DAOS_ANCHOR_TYPE_EOF = 3,
54} daos_anchor_type_t;
55
56#define DAOS_ANCHOR_BUF_MAX 104
58typedef struct {
59 uint16_t da_type;
60 uint16_t da_shard;
61 uint32_t da_flags;
62 uint64_t da_sub_anchors;
63 uint8_t da_buf[DAOS_ANCHOR_BUF_MAX];
65
66#define DAOS_ANCHOR_INIT { .da_type = DAOS_ANCHOR_TYPE_ZERO, \
67 .da_shard = 0, \
68 .da_flags = 0, \
69 .da_sub_anchors = 0, \
70 .da_buf = { 0 } }
71
73typedef struct {
74 uint64_t cookie;
76
77#define DAOS_HDL_INVAL ((daos_handle_t){0})
78#define DAOS_TX_NONE DAOS_HDL_INVAL
79
80static inline bool
81daos_handle_is_inval(daos_handle_t hdl)
82{
83 return hdl.cookie == 0;
84}
85
86static inline bool
87daos_handle_is_valid(daos_handle_t hdl)
88{
89 return !daos_handle_is_inval(hdl);
90}
91
103#define DAOS_PC_RO (1U << 0)
104#define DAOS_PC_RW (1U << 1)
105#define DAOS_PC_EX (1U << 2)
106
107#define DAOS_PC_NBITS 3
108#define DAOS_PC_MASK ((1U << DAOS_PC_NBITS) - 1)
109
113typedef uint64_t daos_epoch_t;
114
115typedef struct {
117 daos_epoch_t epr_lo;
119 daos_epoch_t epr_hi;
121
123#define DAOS_EPOCH_MAX (~0ULL)
124
125typedef d_iov_t daos_key_t;
126
131typedef struct daos_event {
132 int ev_error;
134 struct {
135 uint64_t space[20];
138 uint64_t ev_debug;
140
142#define DAOS_EQ_WAIT -1
144#define DAOS_EQ_NOWAIT 0
145
146typedef enum {
148 DAOS_EQR_COMPLETED = (1),
150 DAOS_EQR_WAITING = (1 << 1),
152 DAOS_EQR_ALL = (DAOS_EQR_COMPLETED | DAOS_EQR_WAITING),
153} daos_eq_query_t;
154
155typedef enum {
156 DAOS_EVS_READY,
157 DAOS_EVS_RUNNING,
158 DAOS_EVS_COMPLETED,
159 DAOS_EVS_ABORTED,
160} daos_ev_status_t;
161
168 d_rank_t *tl_ranks;
170 int32_t *tl_tgts;
172 uint32_t tl_nr;
173};
174
175struct daos_eq;
176
183enum {
184 DAOS_HTYPE_EQ = 1,
185 DAOS_HTYPE_POOL = 3,
186 DAOS_HTYPE_CO = 5,
187 DAOS_HTYPE_OBJ = 7,
188 DAOS_HTYPE_ARRAY = 9,
189 DAOS_HTYPE_TX = 11,
190 DAOS_HTYPE_KV = 13,
191 /* Must enlarge D_HTYPE_BITS to add more types */
192};
193
202typedef struct {
203 uint64_t lo;
204 uint64_t hi;
206
208#define DAOS_ATTR_NAME_MAX 511
209
210#if defined(__cplusplus)
211}
212#endif
213
214#endif /* DAOS_TYPES_H */
int32_t * tl_tgts
Definition daos_types.h:170
uint32_t tl_nr
Definition daos_types.h:172
d_rank_t * tl_ranks
Definition daos_types.h:168
uint16_t da_type
Definition daos_types.h:59
uint32_t da_flags
Definition daos_types.h:61
uint64_t da_sub_anchors
Definition daos_types.h:62
daos_epoch_t epr_lo
Definition daos_types.h:117
daos_epoch_t epr_hi
Definition daos_types.h:119
uint64_t ev_debug
Definition daos_types.h:138
struct daos_event::@22 ev_private