Skip to content

Commit df9e8b6

Browse files
committed
Merge branch 'dfs_update_13_api' of https://github.com/johannlombardi/fio
* 'dfs_update_13_api' of https://github.com/johannlombardi/fio: engines/dfs: add support for 1.3 DAOS API
2 parents 5431966 + 2819492 commit df9e8b6

File tree

3 files changed

+22
-10
lines changed

3 files changed

+22
-10
lines changed

HOWTO

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2561,11 +2561,11 @@ with the caveat that when used on the command line, they must come after the
25612561

25622562
.. option:: pool=str : [dfs]
25632563

2564-
Specify the UUID of the DAOS pool to connect to.
2564+
Specify the label or UUID of the DAOS pool to connect to.
25652565

25662566
.. option:: cont=str : [dfs]
25672567

2568-
Specify the UUID of the DAOS container to open.
2568+
Specify the label or UUID of the DAOS container to open.
25692569

25702570
.. option:: chunk_size=int : [dfs]
25712571

engines/dfs.c

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,19 @@ struct daos_fio_options {
4949
static struct fio_option options[] = {
5050
{
5151
.name = "pool",
52-
.lname = "pool uuid",
52+
.lname = "pool uuid or label",
5353
.type = FIO_OPT_STR_STORE,
5454
.off1 = offsetof(struct daos_fio_options, pool),
55-
.help = "DAOS pool uuid",
55+
.help = "DAOS pool uuid or label",
5656
.category = FIO_OPT_C_ENGINE,
5757
.group = FIO_OPT_G_DFS,
5858
},
5959
{
6060
.name = "cont",
61-
.lname = "container uuid",
61+
.lname = "container uuid or label",
6262
.type = FIO_OPT_STR_STORE,
6363
.off1 = offsetof(struct daos_fio_options, cont),
64-
.help = "DAOS container uuid",
64+
.help = "DAOS container uuid or label",
6565
.category = FIO_OPT_C_ENGINE,
6666
.group = FIO_OPT_G_DFS,
6767
},
@@ -103,7 +103,6 @@ static struct fio_option options[] = {
103103
static int daos_fio_global_init(struct thread_data *td)
104104
{
105105
struct daos_fio_options *eo = td->eo;
106-
uuid_t pool_uuid, co_uuid;
107106
daos_pool_info_t pool_info;
108107
daos_cont_info_t co_info;
109108
int rc = 0;
@@ -124,6 +123,10 @@ static int daos_fio_global_init(struct thread_data *td)
124123
return rc;
125124
}
126125

126+
#if !defined(DAOS_API_VERSION_MAJOR) || \
127+
(DAOS_API_VERSION_MAJOR == 1 && DAOS_API_VERSION_MINOR < 3)
128+
uuid_t pool_uuid, co_uuid;
129+
127130
rc = uuid_parse(eo->pool, pool_uuid);
128131
if (rc) {
129132
log_err("Failed to parse 'Pool uuid': %s\n", eo->pool);
@@ -137,6 +140,7 @@ static int daos_fio_global_init(struct thread_data *td)
137140
td_verror(td, EINVAL, "uuid_parse(eo->cont)");
138141
return EINVAL;
139142
}
143+
#endif
140144

141145
/* Connect to the DAOS pool */
142146
#if !defined(DAOS_API_VERSION_MAJOR) || DAOS_API_VERSION_MAJOR < 1
@@ -152,9 +156,12 @@ static int daos_fio_global_init(struct thread_data *td)
152156
rc = daos_pool_connect(pool_uuid, NULL, svcl, DAOS_PC_RW,
153157
&poh, &pool_info, NULL);
154158
d_rank_list_free(svcl);
155-
#else
159+
#elif (DAOS_API_VERSION_MAJOR == 1 && DAOS_API_VERSION_MINOR < 3)
156160
rc = daos_pool_connect(pool_uuid, NULL, DAOS_PC_RW, &poh, &pool_info,
157161
NULL);
162+
#else
163+
rc = daos_pool_connect(eo->pool, NULL, DAOS_PC_RW, &poh, &pool_info,
164+
NULL);
158165
#endif
159166
if (rc) {
160167
log_err("Failed to connect to pool %d\n", rc);
@@ -163,7 +170,12 @@ static int daos_fio_global_init(struct thread_data *td)
163170
}
164171

165172
/* Open the DAOS container */
173+
#if !defined(DAOS_API_VERSION_MAJOR) || \
174+
(DAOS_API_VERSION_MAJOR == 1 && DAOS_API_VERSION_MINOR < 3)
166175
rc = daos_cont_open(poh, co_uuid, DAOS_COO_RW, &coh, &co_info, NULL);
176+
#else
177+
rc = daos_cont_open(poh, eo->cont, DAOS_COO_RW, &coh, &co_info, NULL);
178+
#endif
167179
if (rc) {
168180
log_err("Failed to open container: %d\n", rc);
169181
td_verror(td, rc, "daos_cont_open");

fio.1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2326,10 +2326,10 @@ the use of cudaMemcpy.
23262326
.RE
23272327
.TP
23282328
.BI (dfs)pool
2329-
Specify the UUID of the DAOS pool to connect to.
2329+
Specify the label or UUID of the DAOS pool to connect to.
23302330
.TP
23312331
.BI (dfs)cont
2332-
Specify the UUID of the DAOS DAOS container to open.
2332+
Specify the label or UUID of the DAOS container to open.
23332333
.TP
23342334
.BI (dfs)chunk_size
23352335
Specificy a different chunk size (in bytes) for the dfs file.

0 commit comments

Comments
 (0)