DAOS API (v2.1 - dev)
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 {
75 uint64_t cookie;
77
78#define DAOS_HDL_INVAL ((daos_handle_t){0})
79#define DAOS_TX_NONE DAOS_HDL_INVAL
80
81static inline bool
82daos_handle_is_inval(daos_handle_t hdl)
83{
84 return hdl.cookie == 0;
85}
86
87static inline bool
88daos_handle_is_valid(daos_handle_t hdl)
89{
90 return !daos_handle_is_inval(hdl);
91}
92
102#define DAOS_PC_RO (1U << 0)
103#define DAOS_PC_RW (1U << 1)
104#define DAOS_PC_EX (1U << 2)
105
106#define DAOS_PC_NBITS 3
107#define DAOS_PC_MASK ((1U << DAOS_PC_NBITS) - 1)
108
112typedef uint64_t daos_epoch_t;
113
117typedef struct {
119 daos_epoch_t epr_lo;
121 daos_epoch_t epr_hi;
123
125#define DAOS_EPOCH_MAX (~0ULL)
126
128typedef struct {
130 uuid_t ci_uuid;
132 daos_epoch_t ci_lsnapshot;
134 uint32_t ci_nhandles;
138 uint64_t ci_md_otime;
140 uint64_t ci_md_mtime;
141 /* TODO: add more members, e.g., size, # objects, uid, gid... */
143
144typedef d_iov_t daos_key_t;
145
150typedef struct daos_event {
154 struct {
155 uint64_t space[20];
158 uint64_t ev_debug;
160
162#define DAOS_EQ_WAIT -1
164#define DAOS_EQ_NOWAIT 0
165
166typedef enum {
168 DAOS_EQR_COMPLETED = (1),
170 DAOS_EQR_WAITING = (1 << 1),
172 DAOS_EQR_ALL = (DAOS_EQR_COMPLETED | DAOS_EQR_WAITING),
173} daos_eq_query_t;
174
175typedef enum {
176 DAOS_EVS_READY,
177 DAOS_EVS_RUNNING,
178 DAOS_EVS_COMPLETED,
179 DAOS_EVS_ABORTED,
180} daos_ev_status_t;
181
188 d_rank_t *tl_ranks;
190 int32_t *tl_tgts;
192 uint32_t tl_nr;
193};
194
195struct daos_eq;
196
203enum {
204 DAOS_HTYPE_EQ = 1,
205 DAOS_HTYPE_POOL = 3,
206 DAOS_HTYPE_CO = 5,
207 DAOS_HTYPE_OBJ = 7,
208 DAOS_HTYPE_ARRAY = 9,
209 DAOS_HTYPE_TX = 11,
210 DAOS_HTYPE_KV = 13,
211 /* Must enlarge D_HTYPE_BITS to add more types */
212};
213
222typedef struct {
224 uint64_t lo;
226 uint64_t hi;
228
234 uint32_t dru_rank;
236 char *dru_uri;
237};
238
244 char dsi_system_name[DAOS_SYS_INFO_STRING_MAX + 1];
246 char dsi_fabric_provider[DAOS_SYS_INFO_STRING_MAX + 1];
248 uint32_t dsi_nr_ranks;
251};
252
254#define DAOS_ATTR_NAME_MAX 511
255
256#if defined(__cplusplus)
257}
258#endif
259
260#endif /* DAOS_TYPES_H */
int32_t * tl_tgts
Definition daos_types.h:190
uint32_t tl_nr
Definition daos_types.h:192
d_rank_t * tl_ranks
Definition daos_types.h:188
uint16_t da_type
Definition daos_types.h:59
uint32_t da_flags
Definition daos_types.h:61
uint16_t da_shard
Definition daos_types.h:60
uint64_t da_sub_anchors
Definition daos_types.h:62
uint64_t ci_md_otime
Definition daos_types.h:138
daos_epoch_t ci_lsnapshot
Definition daos_types.h:132
uint64_t ci_md_mtime
Definition daos_types.h:140
uint32_t ci_nhandles
Definition daos_types.h:134
uint32_t ci_nsnapshots
Definition daos_types.h:136
daos_epoch_t epr_lo
Definition daos_types.h:119
daos_epoch_t epr_hi
Definition daos_types.h:121
struct daos_event::@31 ev_private
uint64_t ev_debug
Definition daos_types.h:158
uint64_t cookie
Definition daos_types.h:75
uint64_t hi
Definition daos_types.h:226
uint64_t lo
Definition daos_types.h:224
uint32_t dru_rank
Definition daos_types.h:234
struct daos_rank_uri * dsi_ranks
Definition daos_types.h:250
uint32_t dsi_nr_ranks
Definition daos_types.h:248
char dsi_system_name[DAOS_SYS_INFO_STRING_MAX+1]
Definition daos_types.h:244
char dsi_fabric_provider[DAOS_SYS_INFO_STRING_MAX+1]
Definition daos_types.h:246