Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 76 additions & 1 deletion src/engine/ult.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* (C) Copyright 2016-2024 Intel Corporation.
* (C) Copyright 2025 Hewlett Packard Enterprise Development LP
* (C) Copyright 2025-2026 Hewlett Packard Enterprise Development LP
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*/
Expand All @@ -9,6 +9,7 @@

#include <abt.h>
#include <daos/common.h>
#include <daos_srv/vos.h>
#include <daos_errno.h>
#include "srv_internal.h"

Expand Down Expand Up @@ -945,3 +946,77 @@ dss_chore_queue_fini(struct dss_xstream *dx)
ABT_cond_free(&queue->chq_cond);
ABT_mutex_free(&queue->chq_mutex);
}

struct dss_vos_pool_create_args {
const char *spc_path;
unsigned char *spc_uuid;
daos_size_t spc_scm_size;
daos_size_t spc_blob_sz;
unsigned int spc_flags;
uint32_t spc_version;
daos_handle_t *spc_pool;
};

static int
dss_vos_pool_create_ult(void *varg)
{
struct dss_vos_pool_create_args *arg = varg;

return vos_pool_create(arg->spc_path, arg->spc_uuid, arg->spc_scm_size, arg->spc_blob_sz,
arg->spc_flags, arg->spc_version, arg->spc_pool);
}

/**
* Call vos_pool_create in a new deep-stack ULT on the same xstream. This is to
* avoid pmemobj_create or SPDK from overflowing the stack of the calling ULT.
*/
int
dss_vos_pool_create(const char *path, unsigned char *uuid, daos_size_t scm_size,
daos_size_t blob_sz, unsigned int flags, uint32_t version, daos_handle_t *pool)
{
struct dss_vos_pool_create_args args;

args.spc_path = path;
args.spc_uuid = uuid;
args.spc_scm_size = scm_size;
args.spc_blob_sz = blob_sz;
args.spc_flags = flags;
args.spc_version = version;
args.spc_pool = pool;

return dss_ult_execute(dss_vos_pool_create_ult, &args, NULL /* user_cb */,
NULL /* cb_args */, DSS_XS_SELF, 0 /* tgt_id */, DSS_DEEP_STACK_SZ);
}

struct dss_vos_pool_open_args {
const char *spo_path;
unsigned char *spo_uuid;
unsigned int spo_flags;
daos_handle_t *spo_pool;
};

static int
dss_vos_pool_open_ult(void *varg)
{
struct dss_vos_pool_open_args *arg = varg;

return vos_pool_open(arg->spo_path, arg->spo_uuid, arg->spo_flags, arg->spo_pool);
}

/**
* Call vos_pool_open in a new deep-stack ULT on the same xstream. This is to
* avoid pmemobj_open or SPDK from overflowing the stack of the calling ULT.
*/
int
dss_vos_pool_open(const char *path, unsigned char *uuid, unsigned int flags, daos_handle_t *pool)
{
struct dss_vos_pool_open_args args;

args.spo_path = path;
args.spo_uuid = uuid;
args.spo_flags = flags;
args.spo_pool = pool;

return dss_ult_execute(dss_vos_pool_open_ult, &args, NULL /* user_cb */, NULL /* cb_args */,
DSS_XS_SELF, 0 /* tgt_id */, DSS_DEEP_STACK_SZ);
}
8 changes: 7 additions & 1 deletion src/include/daos_srv/daos_engine.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* (C) Copyright 2016-2024 Intel Corporation.
* (C) Copyright 2025 Hewlett Packard Enterprise Development LP
* (C) Copyright 2025-2026 Hewlett Packard Enterprise Development LP
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*/
Expand Down Expand Up @@ -801,4 +801,10 @@ dss_chore_diy(struct dss_chore *chore);
bool
engine_in_check(void);

int
dss_vos_pool_create(const char *path, unsigned char *uuid, daos_size_t scm_size,
daos_size_t blob_sz, unsigned int flags, uint32_t version, daos_handle_t *pool);
int
dss_vos_pool_open(const char *path, unsigned char *uuid, unsigned int flags, daos_handle_t *pool);

#endif /* __DSS_API_H__ */
11 changes: 5 additions & 6 deletions src/rdb/rdb.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/**
* (C) Copyright 2017-2023 Intel Corporation.
* (C) Copyright 2026 Hewlett Packard Enterprise Development LP
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*/
Expand Down Expand Up @@ -58,11 +59,10 @@ rdb_create(const char *path, const uuid_t uuid, uint64_t caller_term, size_t siz
* basic system memory reservation and VOS_POF_EXCL for concurrent
* access protection.
*/
rc = vos_pool_create(path, (unsigned char *)uuid, size, 0 /* nvme_sz */,
VOS_POF_SMALL | VOS_POF_EXCL | VOS_POF_RDB, vos_df_version, &pool);
rc = dss_vos_pool_create(path, (unsigned char *)uuid, size, 0 /* nvme_sz */,
VOS_POF_SMALL | VOS_POF_EXCL | VOS_POF_RDB, vos_df_version, &pool);
if (rc != 0)
goto out;
ABT_thread_yield();

/* Create and open the metadata container. */
rc = vos_cont_create(pool, (unsigned char *)uuid);
Expand Down Expand Up @@ -385,8 +385,8 @@ rdb_open(const char *path, const uuid_t uuid, uint64_t caller_term, struct rdb_c
* RDB pools specify VOS_POF_SMALL for basic system memory reservation
* and VOS_POF_EXCL for concurrent access protection.
*/
rc = vos_pool_open(path, (unsigned char *)uuid,
VOS_POF_SMALL | VOS_POF_EXCL | VOS_POF_RDB, &pool);
rc = dss_vos_pool_open(path, (unsigned char *)uuid,
VOS_POF_SMALL | VOS_POF_EXCL | VOS_POF_RDB, &pool);
if (rc == -DER_ID_MISMATCH) {
ds_notify_ras_eventf(RAS_RDB_DF_INCOMPAT, RAS_TYPE_INFO, RAS_SEV_ERROR,
NULL /* hwid */, NULL /* rank */, NULL /* inc */,
Expand All @@ -399,7 +399,6 @@ rdb_open(const char *path, const uuid_t uuid, uint64_t caller_term, struct rdb_c
path, DP_RC(rc));
goto err;
}
ABT_thread_yield();

rc = vos_cont_open(pool, (unsigned char *)uuid, &mc);
if (rc != 0) {
Expand Down
Loading