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

| DAOS API (v2.1 - dev)

Loading...
Searching...
No Matches
daos_uns.h
Go to the documentation of this file.
1/*
2 * (C) Copyright 2019-2024 Intel Corporation.
3 *
4 * SPDX-License-Identifier: BSD-2-Clause-Patent
5 */
15
16#ifndef __DAOS_UNS_H__
17#define __DAOS_UNS_H__
18
19#if defined(__cplusplus)
20extern "C" {
21#endif
22
23#include <daos_prop.h>
24#include <daos_obj_class.h>
25#include <daos_cont.h>
26
28enum {
29 /*
30 * String does not include daos:// prefix
31 * Path that is passed does not have daos: prefix but is direct:
32 * (/puuid/cuuid/xyz) and does not need to parse a path UNS attrs.
33 * This is usually not set.
34 */
35 DUNS_NO_PREFIX = (1 << 0),
36
37 /* look only at the last entry in the path. */
38 DUNS_NO_REVERSE_LOOKUP = (1 << 1),
39
40 /*
41 * check only for direct path.
42 * Do not attempt to get the extended attribute of the path, and assume
43 * the path is a direct path that is either of format:
44 * - /puuid/cuuid/xyz
45 * - /pool_label/container_label/xyz
46 * This is usually not set.
47 */
48 DUNS_NO_CHECK_PATH = (1 << 2),
49};
50
52 struct duns_attr_t {
54 daos_cont_layout_t da_type;
56 daos_oclass_id_t da_oclass_id;
58 daos_size_t da_chunk_size;
60 daos_prop_t *da_props;
67 uint32_t da_flags;
75 char da_pool[DAOS_PROP_LABEL_MAX_LEN + 1];
84 char da_cont[DAOS_PROP_LABEL_MAX_LEN + 1];
90 char *da_sys;
99 char *da_rel_path;
101 bool da_on_lustre;
107 bool da_no_prefix;
113 uuid_t da_puuid;
120 uuid_t da_cuuid;
122 daos_oclass_id_t da_dir_oclass_id;
124 daos_oclass_id_t da_file_oclass_id;
126 char da_hints[DAOS_CONT_HINT_MAX_LEN];
127};
128
130#define DUNS_XATTR_NAME "user.daos"
132#define DUNS_MAX_XATTR_LEN 170
134#define DUNS_XATTR_FMT "DAOS.%s://%36s/%36s"
140#define DUNS_LUSTRE_XATTR_FMT "%36s/%36s"
141
161int
162duns_create_path(daos_handle_t poh, const char *path, struct duns_attr_t *attrp);
163
190int
191duns_resolve_path(const char *path, struct duns_attr_t *attr);
192
201int
202duns_destroy_path(daos_handle_t poh, const char *path);
203
213int
214duns_parse_attr(char *str, daos_size_t len, struct duns_attr_t *attr);
215
225int
226duns_set_sys_name(struct duns_attr_t *attrp, const char *sys);
227
233void
234duns_destroy_attr(struct duns_attr_t *attrp);
235
253int
254duns_link_cont(daos_handle_t poh, const char *cont, const char *path);
255
256#if defined(__cplusplus)
257}
258#endif
259#endif /* __DAOS_UNS_H__ */
daos_cont.h
DAOS_CONT_HINT_MAX_LEN
#define DAOS_CONT_HINT_MAX_LEN
Definition daos_cont.h:94
duns_set_sys_name
int duns_set_sys_name(struct duns_attr_t *attrp, const char *sys)
duns_destroy_attr
void duns_destroy_attr(struct duns_attr_t *attrp)
duns_destroy_path
int duns_destroy_path(daos_handle_t poh, const char *path)
duns_parse_attr
int duns_parse_attr(char *str, daos_size_t len, struct duns_attr_t *attr)
duns_resolve_path
int duns_resolve_path(const char *path, struct duns_attr_t *attr)
duns_link_cont
int duns_link_cont(daos_handle_t poh, const char *cont, const char *path)
duns_create_path
int duns_create_path(daos_handle_t poh, const char *path, struct duns_attr_t *attrp)
daos_handle_t
Definition daos_types.h:76
daos_prop_t
Definition daos_prop.h:657
duns_attr_t
Definition daos_uns.h:52
duns_attr_t::da_no_prefix
bool da_no_prefix
Definition daos_uns.h:107
duns_attr_t::da_hints
char da_hints[DAOS_CONT_HINT_MAX_LEN]
Definition daos_uns.h:126
duns_attr_t::da_file_oclass_id
daos_oclass_id_t da_file_oclass_id
Definition daos_uns.h:124
duns_attr_t::da_type
daos_cont_layout_t da_type
Definition daos_uns.h:54
duns_attr_t::da_puuid
uuid_t da_puuid
Definition daos_uns.h:113
duns_attr_t::da_pool
char da_pool[DAOS_PROP_LABEL_MAX_LEN+1]
Definition daos_uns.h:75
duns_attr_t::da_flags
uint32_t da_flags
Definition daos_uns.h:67
duns_attr_t::da_dir_oclass_id
daos_oclass_id_t da_dir_oclass_id
Definition daos_uns.h:122
duns_attr_t::da_props
daos_prop_t * da_props
Definition daos_uns.h:60
duns_attr_t::da_on_lustre
bool da_on_lustre
Definition daos_uns.h:101
duns_attr_t::da_cont
char da_cont[DAOS_PROP_LABEL_MAX_LEN+1]
Definition daos_uns.h:84
duns_attr_t::da_chunk_size
daos_size_t da_chunk_size
Definition daos_uns.h:58
duns_attr_t::da_sys
char * da_sys
Definition daos_uns.h:90
duns_attr_t::da_rel_path
char * da_rel_path
Definition daos_uns.h:99
duns_attr_t::da_oclass_id
daos_oclass_id_t da_oclass_id
Definition daos_uns.h:56
duns_attr_t::da_cuuid
uuid_t da_cuuid
Definition daos_uns.h:120