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

| DAOS API (v2.1 - dev)

Loading...
Searching...
No Matches
daos_array.h
Go to the documentation of this file.
1/*
2 * (C) Copyright 2016-2023 Intel Corporation.
3 *
4 * SPDX-License-Identifier: BSD-2-Clause-Patent
5 */
14
15#ifndef __DAOS_ARRAY_H__
16#define __DAOS_ARRAY_H__
17
18#if defined(__cplusplus)
19extern "C" {
20#endif
21
23 typedef struct {
25 daos_off_t rg_idx;
27 daos_size_t rg_len;
28} daos_range_t;
29
31 typedef struct {
33 daos_size_t arr_nr;
35 daos_range_t *arr_rgs;
40 daos_size_t arr_nr_short_read;
42 daos_size_t arr_nr_read;
43} daos_array_iod_t;
44
46 typedef struct {
48 daos_size_t st_size;
50 daos_epoch_t st_max_epoch;
51} daos_array_stbuf_t;
52
75static inline int
76daos_array_generate_oid(daos_handle_t coh, daos_obj_id_t *oid, bool add_attr, daos_oclass_id_t cid,
77 daos_oclass_hints_t hints, uint32_t args)
78{
79 enum daos_otype_t type;
80
81 type = DAOS_OT_ARRAY_ATTR;
82
83 if (add_attr)
84 type = DAOS_OT_ARRAY;
85
86 return daos_obj_generate_oid(coh, oid, type, cid, hints, args);
87}
88
123int
124daos_array_create(daos_handle_t coh, daos_obj_id_t oid, daos_handle_t th,
125 daos_size_t cell_size, daos_size_t chunk_size,
126 daos_handle_t *oh, daos_event_t *ev);
127
155int
156daos_array_open(daos_handle_t coh, daos_obj_id_t oid, daos_handle_t th,
157 unsigned int mode, daos_size_t *cell_size,
158 daos_size_t *chunk_size, daos_handle_t *oh, daos_event_t *ev);
159
188int
189daos_array_open_with_attr(daos_handle_t coh, daos_obj_id_t oid,
190 daos_handle_t th, unsigned int mode,
191 daos_size_t cell_size, daos_size_t chunk_size,
192 daos_handle_t *oh, daos_event_t *ev);
193
214int
215daos_array_local2global(daos_handle_t oh, d_iov_t *glob);
216
234int
235daos_array_global2local(daos_handle_t coh, d_iov_t glob, unsigned int mode,
236 daos_handle_t *oh);
237
250int
251daos_array_close(daos_handle_t oh, daos_event_t *ev);
252
275int
276daos_array_read(daos_handle_t oh, daos_handle_t th, daos_array_iod_t *iod,
277 d_sg_list_t *sgl, daos_event_t *ev);
278
300int
301daos_array_write(daos_handle_t oh, daos_handle_t th, daos_array_iod_t *iod,
302 d_sg_list_t *sgl, daos_event_t *ev);
303
320int
321daos_array_get_size(daos_handle_t oh, daos_handle_t th, daos_size_t *size, daos_event_t *ev);
322
339int
340daos_array_stat(daos_handle_t oh, daos_handle_t th, daos_array_stbuf_t *stbuf, daos_event_t *ev);
341
361int
362daos_array_set_size(daos_handle_t oh, daos_handle_t th, daos_size_t size,
363 daos_event_t *ev);
364
386int
387daos_array_destroy(daos_handle_t oh, daos_handle_t th, daos_event_t *ev);
388
405int
406daos_array_punch(daos_handle_t oh, daos_handle_t th, daos_array_iod_t *iod,
407 daos_event_t *ev);
408
424int
425daos_array_get_attr(daos_handle_t oh, daos_size_t *chunk_size,
426 daos_size_t *cell_size);
427
440int
441daos_array_update_chunk_size(daos_handle_t oh, daos_size_t chunk_size);
442
443#if defined(__cplusplus)
444}
445#endif
446
447#endif /* __DAOS_ARRAY_H__ */
daos_array_read
int daos_array_read(daos_handle_t oh, daos_handle_t th, daos_array_iod_t *iod, d_sg_list_t *sgl, daos_event_t *ev)
daos_array_local2global
int daos_array_local2global(daos_handle_t oh, d_iov_t *glob)
daos_array_close
int daos_array_close(daos_handle_t oh, daos_event_t *ev)
daos_array_open
int daos_array_open(daos_handle_t coh, daos_obj_id_t oid, daos_handle_t th, unsigned int mode, daos_size_t *cell_size, daos_size_t *chunk_size, daos_handle_t *oh, daos_event_t *ev)
daos_array_get_attr
int daos_array_get_attr(daos_handle_t oh, daos_size_t *chunk_size, daos_size_t *cell_size)
daos_array_set_size
int daos_array_set_size(daos_handle_t oh, daos_handle_t th, daos_size_t size, daos_event_t *ev)
daos_array_get_size
int daos_array_get_size(daos_handle_t oh, daos_handle_t th, daos_size_t *size, daos_event_t *ev)
daos_array_update_chunk_size
int daos_array_update_chunk_size(daos_handle_t oh, daos_size_t chunk_size)
daos_array_global2local
int daos_array_global2local(daos_handle_t coh, d_iov_t glob, unsigned int mode, daos_handle_t *oh)
daos_array_open_with_attr
int daos_array_open_with_attr(daos_handle_t coh, daos_obj_id_t oid, daos_handle_t th, unsigned int mode, daos_size_t cell_size, daos_size_t chunk_size, daos_handle_t *oh, daos_event_t *ev)
daos_array_punch
int daos_array_punch(daos_handle_t oh, daos_handle_t th, daos_array_iod_t *iod, daos_event_t *ev)
daos_array_write
int daos_array_write(daos_handle_t oh, daos_handle_t th, daos_array_iod_t *iod, d_sg_list_t *sgl, daos_event_t *ev)
daos_array_stat
int daos_array_stat(daos_handle_t oh, daos_handle_t th, daos_array_stbuf_t *stbuf, daos_event_t *ev)
daos_array_destroy
int daos_array_destroy(daos_handle_t oh, daos_handle_t th, daos_event_t *ev)
daos_array_create
int daos_array_create(daos_handle_t coh, daos_obj_id_t oid, daos_handle_t th, daos_size_t cell_size, daos_size_t chunk_size, daos_handle_t *oh, daos_event_t *ev)
daos_array_iod_t
Definition daos_array.h:31
daos_array_iod_t::arr_rgs
daos_range_t * arr_rgs
Definition daos_array.h:35
daos_array_iod_t::arr_nr
daos_size_t arr_nr
Definition daos_array.h:33
daos_array_iod_t::arr_nr_short_read
daos_size_t arr_nr_short_read
Definition daos_array.h:40
daos_array_iod_t::arr_nr_read
daos_size_t arr_nr_read
Definition daos_array.h:42
daos_array_stbuf_t
Definition daos_array.h:46
daos_array_stbuf_t::st_max_epoch
daos_epoch_t st_max_epoch
Definition daos_array.h:50
daos_array_stbuf_t::st_size
daos_size_t st_size
Definition daos_array.h:48
daos_handle_t
Definition daos_types.h:73
daos_obj_id_t
Definition daos_types.h:222
daos_range_t
Definition daos_array.h:23
daos_range_t::rg_len
daos_size_t rg_len
Definition daos_array.h:27
daos_range_t::rg_idx
daos_off_t rg_idx
Definition daos_array.h:25