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-2024 Intel Corporation.
3 * (C) Copyright 2025 Hewlett Packard Enterprise Development LP
4 *
5 * SPDX-License-Identifier: BSD-2-Clause-Patent
6 */
15
16#ifndef __DAOS_ARRAY_H__
17#define __DAOS_ARRAY_H__
18
19#if defined(__cplusplus)
20extern "C" {
21#endif
22
23#include <daos_types.h>
24#include <daos_obj.h>
25#include <daos_obj_class.h>
26
28#define DAOS_ARRAY_LIST_IO_LIMIT 16384
30#define DAOS_ARRAY_RG_LEN_THD 16
31
33 typedef struct {
35 daos_off_t rg_idx;
37 daos_size_t rg_len;
38} daos_range_t;
39
41 typedef struct {
43 daos_size_t arr_nr;
45 daos_range_t *arr_rgs;
50 daos_size_t arr_nr_short_read;
52 daos_size_t arr_nr_read;
53} daos_array_iod_t;
54
56 typedef struct {
58 daos_size_t st_size;
60 daos_epoch_t st_max_epoch;
61} daos_array_stbuf_t;
62
85static inline int
86daos_array_generate_oid(daos_handle_t coh, daos_obj_id_t *oid, bool add_attr, daos_oclass_id_t cid,
87 daos_oclass_hints_t hints, uint32_t args)
88{
89 enum daos_otype_t type;
90
91 type = DAOS_OT_ARRAY_ATTR;
92
93 if (add_attr)
94 type = DAOS_OT_ARRAY;
95
96 return daos_obj_generate_oid(coh, oid, type, cid, hints, args);
97}
98
133int
134daos_array_create(daos_handle_t coh, daos_obj_id_t oid, daos_handle_t th,
135 daos_size_t cell_size, daos_size_t chunk_size,
136 daos_handle_t *oh, daos_event_t *ev);
137
165int
166daos_array_open(daos_handle_t coh, daos_obj_id_t oid, daos_handle_t th,
167 unsigned int mode, daos_size_t *cell_size,
168 daos_size_t *chunk_size, daos_handle_t *oh, daos_event_t *ev);
169
198int
199daos_array_open_with_attr(daos_handle_t coh, daos_obj_id_t oid,
200 daos_handle_t th, unsigned int mode,
201 daos_size_t cell_size, daos_size_t chunk_size,
202 daos_handle_t *oh, daos_event_t *ev);
203
224int
225daos_array_local2global(daos_handle_t oh, d_iov_t *glob);
226
244int
245daos_array_global2local(daos_handle_t coh, d_iov_t glob, unsigned int mode,
246 daos_handle_t *oh);
247
260int
261daos_array_close(daos_handle_t oh, daos_event_t *ev);
262
287int
288daos_array_read(daos_handle_t oh, daos_handle_t th, daos_array_iod_t *iod,
289 d_sg_list_t *sgl, daos_event_t *ev);
290
314int
315daos_array_write(daos_handle_t oh, daos_handle_t th, daos_array_iod_t *iod,
316 d_sg_list_t *sgl, daos_event_t *ev);
317
334int
335daos_array_get_size(daos_handle_t oh, daos_handle_t th, daos_size_t *size, daos_event_t *ev);
336
353int
354daos_array_stat(daos_handle_t oh, daos_handle_t th, daos_array_stbuf_t *stbuf, daos_event_t *ev);
355
375int
376daos_array_set_size(daos_handle_t oh, daos_handle_t th, daos_size_t size,
377 daos_event_t *ev);
378
400int
401daos_array_destroy(daos_handle_t oh, daos_handle_t th, daos_event_t *ev);
402
419int
420daos_array_punch(daos_handle_t oh, daos_handle_t th, daos_array_iod_t *iod,
421 daos_event_t *ev);
422
438int
439daos_array_get_attr(daos_handle_t oh, daos_size_t *chunk_size,
440 daos_size_t *cell_size);
441
454int
455daos_array_update_chunk_size(daos_handle_t oh, daos_size_t chunk_size);
456
457#if defined(__cplusplus)
458}
459#endif
460
461#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:41
daos_array_iod_t::arr_rgs
daos_range_t * arr_rgs
Definition daos_array.h:45
daos_array_iod_t::arr_nr
daos_size_t arr_nr
Definition daos_array.h:43
daos_array_iod_t::arr_nr_short_read
daos_size_t arr_nr_short_read
Definition daos_array.h:50
daos_array_iod_t::arr_nr_read
daos_size_t arr_nr_read
Definition daos_array.h:52
daos_array_stbuf_t
Definition daos_array.h:56
daos_array_stbuf_t::st_max_epoch
daos_epoch_t st_max_epoch
Definition daos_array.h:60
daos_array_stbuf_t::st_size
daos_size_t st_size
Definition daos_array.h:58
daos_handle_t
Definition daos_types.h:76
daos_obj_id_t
Definition daos_types.h:231
daos_range_t
Definition daos_array.h:33
daos_range_t::rg_len
daos_size_t rg_len
Definition daos_array.h:37
daos_range_t::rg_idx
daos_off_t rg_idx
Definition daos_array.h:35