Merge pull request #221 from daos-stack/mschaara/dfs_l2g

DFS driver update to share DFS mount on init
master
Julian Kunkel 2020-04-14 10:13:55 +01:00 committed by GitHub
commit 8bc9a12f80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 14 deletions

View File

@ -219,6 +219,7 @@ AC_ARG_WITH([cart],
AS_IF([test "x$with_cart" != xno], [
CART="yes"
LDFLAGS="$LDFLAGS -L$with_cart/lib64 -Wl,--enable-new-dtags -Wl,-rpath=$with_cart/lib64"
LDFLAGS="$LDFLAGS -L$with_cart/lib -Wl,--enable-new-dtags -Wl,-rpath=$with_cart/lib"
CPPFLAGS="$CPPFLAGS -I$with_cart/include/"
AC_CHECK_HEADERS(gurt/common.h,, [unset CART])

View File

@ -52,7 +52,7 @@ struct aiori_dir_hdl {
enum handleType {
POOL_HANDLE,
CONT_HANDLE,
ARRAY_HANDLE
DFS_HANDLE
};
/************************** O P T I O N S *****************************/
@ -194,7 +194,7 @@ static d_hash_table_ops_t hdl_hash_ops = {
/* Distribute process 0's pool or container handle to others. */
static void
HandleDistribute(daos_handle_t *handle, enum handleType type)
HandleDistribute(enum handleType type)
{
d_iov_t global;
int rc;
@ -203,13 +203,15 @@ HandleDistribute(daos_handle_t *handle, enum handleType type)
global.iov_buf_len = 0;
global.iov_len = 0;
assert(type == POOL_HANDLE || type == CONT_HANDLE);
assert(type == POOL_HANDLE || type == CONT_HANDLE || type == DFS_HANDLE);
if (rank == 0) {
/* Get the global handle size. */
if (type == POOL_HANDLE)
rc = daos_pool_local2global(*handle, &global);
rc = daos_pool_local2global(poh, &global);
else if (type == CONT_HANDLE)
rc = daos_cont_local2global(coh, &global);
else
rc = daos_cont_local2global(*handle, &global);
rc = dfs_local2global(dfs, &global);
DCHECK(rc, "Failed to get global handle size");
}
@ -224,9 +226,11 @@ HandleDistribute(daos_handle_t *handle, enum handleType type)
if (rank == 0) {
if (type == POOL_HANDLE)
rc = daos_pool_local2global(*handle, &global);
rc = daos_pool_local2global(poh, &global);
else if (type == CONT_HANDLE)
rc = daos_cont_local2global(coh, &global);
else
rc = daos_cont_local2global(*handle, &global);
rc = dfs_local2global(dfs, &global);
DCHECK(rc, "Failed to create global handle");
}
@ -236,9 +240,11 @@ HandleDistribute(daos_handle_t *handle, enum handleType type)
if (rank != 0) {
if (type == POOL_HANDLE)
rc = daos_pool_global2local(global, handle);
rc = daos_pool_global2local(global, &poh);
else if (type == CONT_HANDLE)
rc = daos_cont_global2local(poh, global, &coh);
else
rc = daos_cont_global2local(poh, global, handle);
rc = dfs_global2local(poh, coh, 0, global, &dfs);
DCHECK(rc, "Failed to get local handle");
}
@ -435,13 +441,14 @@ DFS_Init() {
} else if (rc) {
DCHECK(rc, "Failed to create container");
}
rc = dfs_mount(poh, coh, O_RDWR, &dfs);
DCHECK(rc, "Failed to mount DFS namespace");
}
HandleDistribute(&poh, POOL_HANDLE);
HandleDistribute(&coh, CONT_HANDLE);
rc = dfs_mount(poh, coh, O_RDWR, &dfs);
DCHECK(rc, "Failed to mount DFS namespace");
HandleDistribute(POOL_HANDLE);
HandleDistribute(CONT_HANDLE);
HandleDistribute(DFS_HANDLE);
if (o.prefix) {
rc = dfs_set_prefix(dfs, o.prefix);