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
104#define DAOS_PC_RO (1U << 0)
105#define DAOS_PC_RW (1U << 1)
106#define DAOS_PC_EX (1U << 2)
107
108#define DAOS_PC_NBITS 3
109#define DAOS_PC_MASK ((1U << DAOS_PC_NBITS) - 1)
110
114typedef uint64_t daos_epoch_t;
115
119typedef struct {
121 daos_epoch_t epr_lo;
123 daos_epoch_t epr_hi;
125
127#define DAOS_EPOCH_MAX (~0ULL)
128
129typedef d_iov_t daos_key_t;
130
135typedef struct daos_event {
139 struct {
140 uint64_t space[20];
143 uint64_t ev_debug;
145
147#define DAOS_EQ_WAIT -1
149#define DAOS_EQ_NOWAIT 0
150
151typedef enum {
153 DAOS_EQR_COMPLETED = (1),
155 DAOS_EQR_WAITING = (1 << 1),
157 DAOS_EQR_ALL = (DAOS_EQR_COMPLETED | DAOS_EQR_WAITING),
158} daos_eq_query_t;
159
160typedef enum {
161 DAOS_EVS_READY,
162 DAOS_EVS_RUNNING,
163 DAOS_EVS_COMPLETED,
164 DAOS_EVS_ABORTED,
165} daos_ev_status_t;
166
173 d_rank_t *tl_ranks;
175 int32_t *tl_tgts;
177 uint32_t tl_nr;
178};
179
180struct daos_eq;
181
188enum {
189 DAOS_HTYPE_EQ = 1,
190 DAOS_HTYPE_POOL = 3,
191 DAOS_HTYPE_CO = 5,
192 DAOS_HTYPE_OBJ = 7,
193 DAOS_HTYPE_ARRAY = 9,
194 DAOS_HTYPE_TX = 11,
195 DAOS_HTYPE_KV = 13,
196 /* Must enlarge D_HTYPE_BITS to add more types */
197};
198
207typedef struct {
209 uint64_t lo;
211 uint64_t hi;
213
215#define DAOS_ATTR_NAME_MAX 511
216
217#if defined(__cplusplus)
218}
219#endif
220
221#endif /* DAOS_TYPES_H */
int32_t * tl_tgts
Definition daos_types.h:175
uint32_t tl_nr
Definition daos_types.h:177
d_rank_t * tl_ranks
Definition daos_types.h:173
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
daos_epoch_t epr_lo
Definition daos_types.h:121
daos_epoch_t epr_hi
Definition daos_types.h:123
struct daos_event::@25 ev_private
uint64_t ev_debug
Definition daos_types.h:143
uint64_t cookie
Definition daos_types.h:75
uint64_t hi
Definition daos_types.h:211
uint64_t lo
Definition daos_types.h:209