DAOS API: src/include/daos_api.h Source File

| DAOS API (v2.1 - dev)

Loading...
Searching...
No Matches
daos_api.h
Go to the documentation of this file.
1/*
2 * (C) Copyright 2015-2024 Intel Corporation.
3 *
4 * SPDX-License-Identifier: BSD-2-Clause-Patent
5 */
11
12#ifndef __DAOS_API_H__
13#define __DAOS_API_H__
14
15#if defined(__cplusplus)
16extern "C" {
17#endif
18
19#include <daos_types.h>
20
22enum {
24 DAOS_TF_RDONLY = (1 << 0),
33 DAOS_TF_ZERO_COPY = (1 << 1),
34};
35
47d_rank_list_t *daos_rank_list_parse(const char *str, const char *sep);
48
49/*
50 * Transaction API
51 */
52
70int
71daos_tx_open(daos_handle_t coh, daos_handle_t *th, uint64_t flags,
72 daos_event_t *ev);
73
92int
93daos_tx_commit(daos_handle_t th, daos_event_t *ev);
94
110int
111daos_tx_open_snap(daos_handle_t coh, daos_epoch_t epoch, daos_handle_t *th,
112 daos_event_t *ev);
113
124int
125daos_tx_abort(daos_handle_t th, daos_event_t *ev);
126
136int
137daos_tx_close(daos_handle_t th, daos_event_t *ev);
138
154int
155daos_tx_restart(daos_handle_t th, daos_event_t *ev);
156
171int
172daos_tx_hdl2epoch(daos_handle_t th, daos_epoch_t *epoch);
173
180static inline int
181daos_anchor_init(daos_anchor_t *anchor, __attribute__((unused)) unsigned int opts)
182{
183 daos_anchor_t _anchor = DAOS_ANCHOR_INIT;
184
185 *anchor = _anchor;
186 return 0;
187}
188
195static inline void
196daos_anchor_fini(__attribute__((unused)) daos_anchor_t *anchor)
197{
198 /* NOOP for now, might need to free memory */
199}
200
204static inline bool
205daos_anchor_is_eof(daos_anchor_t *anchor)
206{
207 return anchor->da_type == DAOS_ANCHOR_TYPE_EOF;
208}
209
219int
220daos_hlc2timespec(uint64_t hlc, struct timespec *ts);
221
232int
233daos_hlc2timestamp(uint64_t hlc, time_t *ts);
234
235#if defined(__cplusplus)
236}
237#endif
238#endif /* __DAOS_API_H__ */
DAOS_TF_ZERO_COPY
@ DAOS_TF_ZERO_COPY
Definition daos_api.h:33
DAOS_TF_RDONLY
@ DAOS_TF_RDONLY
Definition daos_api.h:24
daos_tx_hdl2epoch
int daos_tx_hdl2epoch(daos_handle_t th, daos_epoch_t *epoch)
daos_tx_abort
int daos_tx_abort(daos_handle_t th, daos_event_t *ev)
daos_tx_commit
int daos_tx_commit(daos_handle_t th, daos_event_t *ev)
daos_hlc2timespec
int daos_hlc2timespec(uint64_t hlc, struct timespec *ts)
daos_tx_open
int daos_tx_open(daos_handle_t coh, daos_handle_t *th, uint64_t flags, daos_event_t *ev)
daos_hlc2timestamp
int daos_hlc2timestamp(uint64_t hlc, time_t *ts)
daos_rank_list_parse
d_rank_list_t * daos_rank_list_parse(const char *str, const char *sep)
daos_tx_restart
int daos_tx_restart(daos_handle_t th, daos_event_t *ev)
daos_tx_close
int daos_tx_close(daos_handle_t th, daos_event_t *ev)
daos_tx_open_snap
int daos_tx_open_snap(daos_handle_t coh, daos_epoch_t epoch, daos_handle_t *th, daos_event_t *ev)
daos_anchor_t
Definition daos_types.h:60
daos_anchor_t::da_type
uint16_t da_type
Definition daos_types.h:61
daos_handle_t
Definition daos_types.h:75