Commit dc9aef79 authored by Ramon Nou's avatar Ramon Nou Committed by Ramon Nou
Browse files

deploy_adhoc_storage adaptation

parent ee8d7163
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -174,6 +174,9 @@ typedef struct adm_pfs_context {
    const char* c_mount;
} adm_pfs_context;

hg_return_t
hg_proc_ADM_pfs_context_t(hg_proc_t proc, void* data);

// clang-format off
MERCURY_GEN_STRUCT_PROC(
    adm_pfs_context, // NOLINT
@@ -371,9 +374,9 @@ MERCURY_GEN_PROC(
);

/// ADM_deploy_adhoc_storage
MERCURY_GEN_PROC(ADM_deploy_adhoc_storage_in_t, ((int32_t) (reqs)))
MERCURY_GEN_PROC(ADM_deploy_adhoc_storage_in_t, ((ADM_storage_t) (reqs)))

MERCURY_GEN_PROC(ADM_deploy_adhoc_storage_out_t, ((int32_t) (ret)))
MERCURY_GEN_PROC(ADM_deploy_adhoc_storage_out_t, ((int32_t) (retval)))

/// ADM_register_pfs_storage
MERCURY_GEN_PROC(ADM_register_pfs_storage_in_t, ((int32_t) (reqs)))
+2 −23
Original line number Diff line number Diff line
@@ -284,29 +284,8 @@ remove_adhoc_storage(const server& srv, const adhoc_storage& adhoc_storage) {
}

ADM_return_t
deploy_adhoc_storage(const server& srv, ADM_storage_t adhoc_storage) {

    (void) srv;
    (void) adhoc_storage;

    scord::network::rpc_client rpc_client{srv.protocol(), rpc_registration_cb};

    auto endp = rpc_client.lookup(srv.address());

    LOGGER_INFO("ADM_deploy_adhoc_storage(...)");

    ADM_deploy_adhoc_storage_in_t in{};
    ADM_deploy_adhoc_storage_out_t out;

    const auto rpc = endp.call("ADM_deploy_adhoc_storage", &in, &out);

    if(out.ret < 0) {
        LOGGER_ERROR("ADM_deploy_adhoc_storage() = {}", out.ret);
        return static_cast<ADM_return_t>(out.ret);
    }

    LOGGER_INFO("ADM_deploy_adhoc_storage() = {}", ADM_SUCCESS);
    return ADM_SUCCESS;
deploy_adhoc_storage(const server& srv, const admire::adhoc_storage& adhoc_storage) {
    return detail::deploy_adhoc_storage(srv, adhoc_storage);
}

ADM_return_t
+1 −1
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ void
remove_adhoc_storage(const server& srv, const adhoc_storage& adhoc_storage);

ADM_return_t
deploy_adhoc_storage(const server& srv, ADM_storage_t adhoc_storage);
deploy_adhoc_storage(const server& srv, const adhoc_storage& reqs);

ADM_return_t
register_pfs_storage(const server& srv, ADM_pfs_context_t ctx,
+4 −1
Original line number Diff line number Diff line
@@ -124,8 +124,11 @@ ADM_return_t
ADM_deploy_adhoc_storage(ADM_server_t server, ADM_storage_t adhoc_storage) {

    const admire::server srv{server};
    auto storage = admire::adhoc_storage{
            static_cast<enum admire::storage::type>(adhoc_storage->s_type),
            adhoc_storage->s_id, adhoc_storage->s_adhoc_ctx};

    return admire::deploy_adhoc_storage(srv, adhoc_storage);
    return admire::deploy_adhoc_storage(srv, storage);
}

ADM_return_t
+2 −2
Original line number Diff line number Diff line
@@ -439,11 +439,11 @@ ADM_deploy_adhoc_storage(hg_handle_t h) {
    ret = margo_get_input(h, &in);
    assert(ret == HG_SUCCESS);

    out.ret = -1;
    out.retval = -1;

    LOGGER_INFO("ADM_deploy_adhoc_storage()");

    out.ret = 0;
    out.retval = 0;

    ret = margo_respond(h, &out);
    assert(ret == HG_SUCCESS);