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-2022 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
20enum {
22 DAOS_TF_RDONLY = (1 << 0),
31 DAOS_TF_ZERO_COPY = (1 << 1),
32};
33
45d_rank_list_t *daos_rank_list_parse(const char *str, const char *sep);
46
47/*
48 * Transaction API
49 */
50
68int
69daos_tx_open(daos_handle_t coh, daos_handle_t *th, uint64_t flags,
70 daos_event_t *ev);
71
90int
91daos_tx_commit(daos_handle_t th, daos_event_t *ev);
92
108int
109daos_tx_open_snap(daos_handle_t coh, daos_epoch_t epoch, daos_handle_t *th,
110 daos_event_t *ev);
111
122int
123daos_tx_abort(daos_handle_t th, daos_event_t *ev);
124
134int
135daos_tx_close(daos_handle_t th, daos_event_t *ev);
136
152int
153daos_tx_restart(daos_handle_t th, daos_event_t *ev);
154
169int
170daos_tx_hdl2epoch(daos_handle_t th, daos_epoch_t *epoch);
171
178static inline int
179daos_anchor_init(daos_anchor_t *anchor, __attribute__((unused)) unsigned int opts)
180{
181 daos_anchor_t _anchor = DAOS_ANCHOR_INIT;
182
183 *anchor = _anchor;
184 return 0;
185}
186
193static inline void
194daos_anchor_fini(__attribute__((unused)) daos_anchor_t *anchor)
195{
196 /* NOOP for now, might need to free memory */
197}
198
202static inline bool
203daos_anchor_is_eof(daos_anchor_t *anchor)
204{
205 return anchor->da_type == DAOS_ANCHOR_TYPE_EOF;
206}
207
217int
218daos_hlc2timespec(uint64_t hlc, struct timespec *ts);
219
230int
231daos_hlc2timestamp(uint64_t hlc, time_t *ts);
232
233#if defined(__cplusplus)
234}
235#endif
236#endif /* __DAOS_API_H__ */
DAOS_TF_ZERO_COPY
@ DAOS_TF_ZERO_COPY
Definition daos_api.h:31
DAOS_TF_RDONLY
@ DAOS_TF_RDONLY
Definition daos_api.h:22
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:58
daos_anchor_t::da_type
uint16_t da_type
Definition daos_types.h:59
daos_handle_t
Definition daos_types.h:73