Unverified Commit c7262480 authored by Tommaso Tocci's avatar Tommaso Tocci
Browse files

fs_conf RPC doesn't need input

parent 66905b81
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -115,7 +115,6 @@ MERCURY_GEN_PROC(rpc_get_dirents_out_t,
        ((hg_size_t) (dirents_size))
)

MERCURY_GEN_PROC(rpc_config_in_t, ((hg_int32_t) (dummy))) // XXX remove that.

MERCURY_GEN_PROC(rpc_config_out_t, ((hg_const_string_t) (mountdir))
        ((hg_const_string_t) (rootdir)) \
+7 −2
Original line number Diff line number Diff line
@@ -55,8 +55,13 @@ margo_instance_id ld_margo_rpc_id;
 * @param mode
 */
void register_client_rpcs(margo_instance_id mid) {
    rpc_config_id = MARGO_REGISTER(mid, hg_tag::fs_config, rpc_config_in_t, rpc_config_out_t,

    rpc_config_id = MARGO_REGISTER(mid,
        hg_tag::fs_config,
        void,
        rpc_config_out_t,
        NULL);

    rpc_mk_node_id = MARGO_REGISTER(mid, hg_tag::create, rpc_mk_node_in_t, rpc_err_out_t, NULL);
    rpc_stat_id = MARGO_REGISTER(mid, hg_tag::stat, rpc_path_only_in_t, rpc_stat_out_t, NULL);
    rpc_rm_node_id = MARGO_REGISTER(mid, hg_tag::remove, rpc_rm_node_in_t,
+1 −3
Original line number Diff line number Diff line
@@ -28,10 +28,8 @@ namespace rpc_send {
 */
bool get_fs_config() {
    hg_handle_t handle;
    rpc_config_in_t in{};
    rpc_config_out_t out{};
    // fill in
    in.dummy = 0; // XXX should be removed. havent checked yet how empty input with margo works
    auto local_addr = get_local_addr();
    if (local_addr == HG_ADDR_NULL) {
        CTX->log()->error("{}() Unable to lookup local addr", __func__);
@@ -45,7 +43,7 @@ bool get_fs_config() {
    }
    CTX->log()->debug("{}() Forwarding request", __func__);
    for (int i = 0; i < RPC_TRIES; ++i) {
        ret = margo_forward_timed(handle, &in, RPC_TIMEOUT);
        ret = margo_forward_timed(handle, nullptr, RPC_TIMEOUT);
        if (ret == HG_SUCCESS) {
            break;
        }
+0 −4
Original line number Diff line number Diff line
@@ -20,11 +20,8 @@
using namespace std;

static hg_return_t rpc_srv_fs_config(hg_handle_t handle) {
    rpc_config_in_t in{};
    rpc_config_out_t out{};

    auto ret = margo_get_input(handle, &in);
    assert(ret == HG_SUCCESS);
    ADAFS_DATA->spdlogger()->debug("{}() Got config RPC", __func__);

    // get fs config
@@ -51,7 +48,6 @@ static hg_return_t rpc_srv_fs_config(hg_handle_t handle) {
    }

    // Destroy handle when finished
    margo_free_input(handle, &in);
    margo_destroy(handle);
    return HG_SUCCESS;
}
+1 −1
Original line number Diff line number Diff line
@@ -224,7 +224,7 @@ void init_rpc_server(const string & protocol_port) {
 * @param hg_class
 */
void register_server_rpcs(margo_instance_id mid) {
    MARGO_REGISTER(mid, hg_tag::fs_config, rpc_config_in_t, rpc_config_out_t, rpc_srv_fs_config);
    MARGO_REGISTER(mid, hg_tag::fs_config, void, rpc_config_out_t, rpc_srv_fs_config);
    MARGO_REGISTER(mid, hg_tag::create, rpc_mk_node_in_t, rpc_err_out_t, rpc_srv_mk_node);
    MARGO_REGISTER(mid, hg_tag::stat, rpc_path_only_in_t, rpc_stat_out_t, rpc_srv_stat);
    MARGO_REGISTER(mid, hg_tag::decr_size, rpc_trunc_in_t, rpc_err_out_t, rpc_srv_decr_size);