diff options
author | Amar Tumballi <amar@gluster.com> | 2011-08-29 17:53:24 +0530 |
---|---|---|
committer | Anand Avati <avati@gluster.com> | 2011-09-07 10:48:52 -0700 |
commit | f0f3b040dfa062021d3a193e5a19c380eb5e908d (patch) | |
tree | 5e78d2dc05a2aa143b68b0980e21f09511c9120b | |
parent | f78c8253d7fb75762effcf64683cbce10783a55b (diff) |
modify to the way we used XDR definitions files (.x files)
Earlier:
step 1: copy the existing <xdr>.x files to /tmp
step 2: generate '.[ch]' files using 'rpcgen <xdr>.x'
step 3: check diff with the to the existing files, add only your part
of changes back to the original file. (ignore other changes).
step 4: there is another file to write wrapper functions to convert
structures to/from XDR buffers, update it with your new structure.
step 5: use these wrapper functions in the newly written procedures.
step 6: commit :-|
Now:
step 1: update (mostly adding only) the <xdr>.x file
step 2: run '<path-to-src>/extras/generate-xdr-files.sh <xdr>.x' command
step 3: implement rpc procedure to handle the request/response.
step 4: commit :-)
Change-Id: I219f9159fc980438c86e847c6b030be96e595ea2
BUG: 3488
Reviewed-on: http://review.gluster.com/341
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@gluster.com>
50 files changed, 957 insertions, 4137 deletions
diff --git a/cli/src/cli-cmd.c b/cli/src/cli-cmd.c index 8751a570353..385e2ac2e1c 100644 --- a/cli/src/cli-cmd.c +++ b/cli/src/cli-cmd.c @@ -364,16 +364,14 @@ int cli_cmd_submit (void *req, call_frame_t *frame, rpc_clnt_prog_t *prog, int procnum, struct iobref *iobref, - cli_serialize_t sfunc, xlator_t *this, - fop_cbk_fn_t cbkfn, xdrproc_t xdrproc) + xlator_t *this, fop_cbk_fn_t cbkfn, xdrproc_t xdrproc) { int ret = -1; cli_cmd_lock (); cmd_sent = 0; ret = cli_submit_request (req, frame, prog, - procnum, NULL, sfunc, - this, cbkfn, xdrproc); + procnum, NULL, this, cbkfn, xdrproc); if (!ret) { cmd_sent = 1; diff --git a/cli/src/cli-cmd.h b/cli/src/cli-cmd.h index b5680d5da35..f6abfa4645f 100644 --- a/cli/src/cli-cmd.h +++ b/cli/src/cli-cmd.h @@ -83,8 +83,7 @@ int cli_cmd_submit (void *req, call_frame_t *frame, rpc_clnt_prog_t *prog, int procnum, struct iobref *iobref, - cli_serialize_t sfunc, xlator_t *this, - fop_cbk_fn_t cbkfn, xdrproc_t xdrproc); + xlator_t *this, fop_cbk_fn_t cbkfn, xdrproc_t xdrproc); gf_answer_t cli_cmd_get_confirmation (struct cli_state *state, const char *question); diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index 52e3d11d7fc..31ede5007fd 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -35,14 +35,14 @@ #include <stdlib.h> #include <sys/mount.h> #include "cli1-xdr.h" -#include "cli1.h" +#include "xdr-generic.h" #include "protocol-common.h" #include "cli-mem-types.h" #include "compat.h" #include "syscall.h" #include "glusterfs3.h" -#include "portmap.h" +#include "portmap-xdr.h" #include "run.h" @@ -94,7 +94,7 @@ gf_cli3_1_probe_cbk (struct rpc_req *req, struct iovec *iov, goto out; } - ret = gf_xdr_to_cli_probe_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf1_cli_probe_rsp); if (ret < 0) { gf_log ("", GF_LOG_ERROR, "error"); //rsp.op_ret = -1; @@ -170,7 +170,7 @@ gf_cli3_1_deprobe_cbk (struct rpc_req *req, struct iovec *iov, goto out; } - ret = gf_xdr_to_cli_deprobe_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf1_cli_deprobe_rsp); if (ret < 0) { gf_log ("", GF_LOG_ERROR, "error"); //rsp.op_ret = -1; @@ -233,7 +233,7 @@ gf_cli3_1_list_friends_cbk (struct rpc_req *req, struct iovec *iov, goto out; } - ret = gf_xdr_to_cli_peer_list_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf1_cli_peer_list_rsp); if (ret < 0) { gf_log ("", GF_LOG_ERROR, "error"); //rsp.op_ret = -1; @@ -400,7 +400,7 @@ gf_cli3_1_get_volume_cbk (struct rpc_req *req, struct iovec *iov, goto out; } - ret = gf_xdr_to_cli_get_vol_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf1_cli_get_vol_rsp); if (ret < 0) { gf_log ("", GF_LOG_ERROR, "error"); //rsp.op_ret = -1; @@ -624,7 +624,7 @@ gf_cli3_1_create_volume_cbk (struct rpc_req *req, struct iovec *iov, local = ((call_frame_t *) (myframe))->local; ((call_frame_t *) (myframe))->local = NULL; - ret = gf_xdr_to_cli_create_vol_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf1_cli_create_vol_rsp); if (ret < 0) { gf_log ("", GF_LOG_ERROR, "error"); goto out; @@ -671,7 +671,7 @@ gf_cli3_1_delete_volume_cbk (struct rpc_req *req, struct iovec *iov, goto out; } - ret = gf_xdr_to_cli_delete_vol_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf1_cli_delete_vol_rsp); if (ret < 0) { gf_log ("", GF_LOG_ERROR, "error"); goto out; @@ -717,7 +717,7 @@ gf_cli3_1_start_volume_cbk (struct rpc_req *req, struct iovec *iov, goto out; } - ret = gf_xdr_to_cli_start_vol_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf1_cli_start_vol_rsp); if (ret < 0) { gf_log ("", GF_LOG_ERROR, "error"); goto out; @@ -768,7 +768,7 @@ gf_cli3_1_stop_volume_cbk (struct rpc_req *req, struct iovec *iov, goto out; } - ret = gf_xdr_to_cli_stop_vol_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf1_cli_stop_vol_rsp); if (ret < 0) { gf_log ("", GF_LOG_ERROR, "error"); goto out; @@ -816,7 +816,8 @@ gf_cli3_1_defrag_volume_cbk (struct rpc_req *req, struct iovec *iov, goto out; } - ret = gf_xdr_to_cli_defrag_vol_rsp_v2 (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, + (xdrproc_t)xdr_gf2_cli_defrag_vol_rsp); if (ret < 0) { gf_log ("", GF_LOG_ERROR, "error"); goto out; @@ -928,7 +929,7 @@ gf_cli3_1_rename_volume_cbk (struct rpc_req *req, struct iovec *iov, goto out; } - ret = gf_xdr_to_cli_rename_vol_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf1_cli_rename_vol_rsp); if (ret < 0) { gf_log ("", GF_LOG_ERROR, "error"); goto out; @@ -957,7 +958,7 @@ gf_cli3_1_reset_volume_cbk (struct rpc_req *req, struct iovec *iov, goto out; } - ret = gf_xdr_to_cli_reset_vol_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf1_cli_reset_vol_rsp); if (ret < 0) { gf_log ("", GF_LOG_ERROR, "error"); goto out; @@ -991,7 +992,7 @@ gf_cli3_1_set_volume_cbk (struct rpc_req *req, struct iovec *iov, goto out; } - ret = gf_xdr_to_cli_set_vol_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf1_cli_set_vol_rsp); if (ret < 0) { gf_log ("", GF_LOG_ERROR, "error"); goto out; @@ -1038,7 +1039,7 @@ gf_cli3_1_add_brick_cbk (struct rpc_req *req, struct iovec *iov, goto out; } - ret = gf_xdr_to_cli_add_brick_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf1_cli_add_brick_rsp); if (ret < 0) { gf_log ("", GF_LOG_ERROR, "error"); goto out; @@ -1075,7 +1076,7 @@ gf_cli3_1_remove_brick_cbk (struct rpc_req *req, struct iovec *iov, goto out; } - ret = gf_xdr_to_cli_remove_brick_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf1_cli_remove_brick_rsp); if (ret < 0) { gf_log ("", GF_LOG_ERROR, "error"); goto out; @@ -1123,7 +1124,7 @@ gf_cli3_1_replace_brick_cbk (struct rpc_req *req, struct iovec *iov, frame = (call_frame_t *) myframe; - ret = gf_xdr_to_cli_replace_brick_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf1_cli_replace_brick_rsp); if (ret < 0) { gf_log ("", GF_LOG_ERROR, "error"); goto out; @@ -1234,7 +1235,7 @@ gf_cli3_1_log_filename_cbk (struct rpc_req *req, struct iovec *iov, goto out; } - ret = gf_xdr_to_cli_log_filename_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf1_cli_log_filename_rsp); if (ret < 0) { gf_log ("", GF_LOG_ERROR, "error"); goto out; @@ -1266,7 +1267,7 @@ gf_cli3_1_log_locate_cbk (struct rpc_req *req, struct iovec *iov, goto out; } - ret = gf_xdr_to_cli_log_locate_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf1_cli_log_locate_rsp); if (ret < 0) { gf_log ("", GF_LOG_ERROR, "error"); goto out; @@ -1293,7 +1294,7 @@ gf_cli3_1_log_rotate_cbk (struct rpc_req *req, struct iovec *iov, goto out; } - ret = gf_xdr_to_cli_log_rotate_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf1_cli_log_rotate_rsp); if (ret < 0) { gf_log ("", GF_LOG_ERROR, "error"); goto out; @@ -1325,7 +1326,7 @@ gf_cli3_1_sync_volume_cbk (struct rpc_req *req, struct iovec *iov, goto out; } - ret = gf_xdr_to_cli_sync_volume_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf1_cli_sync_volume_rsp); if (ret < 0) { gf_log ("", GF_LOG_ERROR, "error"); goto out; @@ -1471,7 +1472,7 @@ gf_cli3_1_quota_cbk (struct rpc_req *req, struct iovec *iov, goto out; } - ret = gf_xdr_to_cli_quota_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf1_cli_quota_rsp); if (ret < 0) { gf_log ("", GF_LOG_ERROR, "error"); goto out; @@ -1516,7 +1517,7 @@ gf_cli3_1_getspec_cbk (struct rpc_req *req, struct iovec *iov, goto out; } - ret = xdr_to_getspec_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf_getspec_rsp); if (ret < 0 || rsp.op_ret == -1) { gf_log ("", GF_LOG_ERROR, "error"); goto out; @@ -1553,7 +1554,7 @@ gf_cli3_1_pmap_b2p_cbk (struct rpc_req *req, struct iovec *iov, goto out; } - ret = xdr_to_pmap_port_by_brick_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_pmap_port_by_brick_rsp); if (ret < 0 || rsp.op_ret == -1) { gf_log ("", GF_LOG_ERROR, "error"); goto out; @@ -1600,7 +1601,7 @@ gf_cli3_1_probe (call_frame_t *frame, xlator_t *this, req.port = port; ret = cli_cmd_submit (&req, frame, cli_rpc_prog, - GLUSTER_CLI_PROBE, NULL, gf_xdr_from_cli_probe_req, + GLUSTER_CLI_PROBE, NULL, this, gf_cli3_1_probe_cbk, (xdrproc_t)xdr_gf1_cli_probe_req); @@ -1638,7 +1639,6 @@ gf_cli3_1_deprobe (call_frame_t *frame, xlator_t *this, ret = cli_cmd_submit (&req, frame, cli_rpc_prog, GLUSTER_CLI_DEPROBE, NULL, - gf_xdr_from_cli_deprobe_req, this, gf_cli3_1_deprobe_cbk, (xdrproc_t)xdr_gf1_cli_deprobe_req); @@ -1663,7 +1663,6 @@ gf_cli3_1_list_friends (call_frame_t *frame, xlator_t *this, ret = cli_cmd_submit (&req, frame, cli_rpc_prog, GLUSTER_CLI_LIST_FRIENDS, NULL, - gf_xdr_from_cli_peer_list_req, this, gf_cli3_1_list_friends_cbk, (xdrproc_t) xdr_gf1_cli_peer_list_req); @@ -1743,7 +1742,6 @@ gf_cli3_1_get_volume (call_frame_t *frame, xlator_t *this, ret = cli_cmd_submit (&req, frame, cli_rpc_prog, GLUSTER_CLI_GET_VOLUME, NULL, - gf_xdr_from_cli_get_vol_req, this, gf_cli3_1_get_volume_cbk, (xdrproc_t) xdr_gf1_cli_get_vol_req); @@ -1801,7 +1799,6 @@ gf_cli3_1_create_volume (call_frame_t *frame, xlator_t *this, ret = cli_cmd_submit (&req, frame, cli_rpc_prog, GLUSTER_CLI_CREATE_VOLUME, NULL, - gf_xdr_from_cli_create_vol_req, this, gf_cli3_1_create_volume_cbk, (xdrproc_t) xdr_gf1_cli_create_vol_req); @@ -1844,7 +1841,6 @@ gf_cli3_1_delete_volume (call_frame_t *frame, xlator_t *this, ret = cli_cmd_submit (&req, frame, cli_rpc_prog, GLUSTER_CLI_DELETE_VOLUME, NULL, - gf_xdr_from_cli_delete_vol_req, this, gf_cli3_1_delete_volume_cbk, (xdrproc_t)xdr_gf1_cli_delete_vol_req); @@ -1878,7 +1874,6 @@ gf_cli3_1_start_volume (call_frame_t *frame, xlator_t *this, ret = cli_cmd_submit (req, frame, cli_rpc_prog, GLUSTER_CLI_START_VOLUME, NULL, - gf_xdr_from_cli_start_vol_req, this, gf_cli3_1_start_volume_cbk, (xdrproc_t) xdr_gf1_cli_start_vol_req); @@ -1912,7 +1907,6 @@ gf_cli3_1_stop_volume (call_frame_t *frame, xlator_t *this, ret = cli_cmd_submit (&req, frame, cli_rpc_prog, GLUSTER_CLI_STOP_VOLUME, NULL, - gf_xdr_from_cli_stop_vol_req, this, gf_cli3_1_stop_volume_cbk, (xdrproc_t) xdr_gf1_cli_stop_vol_req); @@ -1987,7 +1981,6 @@ done: ret = cli_cmd_submit (&req, frame, cli_rpc_prog, GLUSTER_CLI_DEFRAG_VOLUME, NULL, - gf_xdr_from_cli_defrag_vol_req, this, gf_cli3_1_defrag_volume_cbk, (xdrproc_t) xdr_gf1_cli_defrag_vol_req); @@ -2024,7 +2017,6 @@ gf_cli3_1_rename_volume (call_frame_t *frame, xlator_t *this, ret = cli_cmd_submit (&req, frame, cli_rpc_prog, GLUSTER_CLI_RENAME_VOLUME, NULL, - gf_xdr_from_cli_rename_vol_req, this, gf_cli3_1_rename_volume_cbk, (xdrproc_t) xdr_gf1_cli_rename_vol_req); @@ -2065,7 +2057,6 @@ gf_cli3_1_reset_volume (call_frame_t *frame, xlator_t *this, ret = cli_cmd_submit (&req, frame, cli_rpc_prog, GLUSTER_CLI_RESET_VOLUME, NULL, - gf_xdr_from_cli_reset_vol_req, this, gf_cli3_1_reset_volume_cbk, (xdrproc_t) xdr_gf1_cli_reset_vol_req); @@ -2106,7 +2097,6 @@ gf_cli3_1_set_volume (call_frame_t *frame, xlator_t *this, ret = cli_cmd_submit (&req, frame, cli_rpc_prog, GLUSTER_CLI_SET_VOLUME, NULL, - gf_xdr_from_cli_set_vol_req, this, gf_cli3_1_set_volume_cbk, (xdrproc_t) xdr_gf1_cli_set_vol_req); @@ -2152,7 +2142,6 @@ gf_cli3_1_add_brick (call_frame_t *frame, xlator_t *this, ret = cli_cmd_submit (&req, frame, cli_rpc_prog, GLUSTER_CLI_ADD_BRICK, NULL, - gf_xdr_from_cli_add_brick_req, this, gf_cli3_1_add_brick_cbk, (xdrproc_t) xdr_gf1_cli_add_brick_req); @@ -2202,7 +2191,6 @@ gf_cli3_1_remove_brick (call_frame_t *frame, xlator_t *this, ret = cli_cmd_submit (&req, frame, cli_rpc_prog, GLUSTER_CLI_REMOVE_BRICK, NULL, - gf_xdr_from_cli_remove_brick_req, this, gf_cli3_1_remove_brick_cbk, (xdrproc_t) xdr_gf1_cli_remove_brick_req); @@ -2298,7 +2286,6 @@ gf_cli3_1_replace_brick (call_frame_t *frame, xlator_t *this, ret = cli_cmd_submit (&req, frame, cli_rpc_prog, GLUSTER_CLI_REPLACE_BRICK, NULL, - gf_xdr_from_cli_replace_brick_req, this, gf_cli3_1_replace_brick_cbk, (xdrproc_t) xdr_gf1_cli_replace_brick_req); @@ -2341,7 +2328,6 @@ gf_cli3_1_log_filename (call_frame_t *frame, xlator_t *this, ret = cli_cmd_submit (&req, frame, cli_rpc_prog, GLUSTER_CLI_LOG_FILENAME, NULL, - gf_xdr_from_cli_log_filename_req, this, gf_cli3_1_log_filename_cbk, (xdrproc_t) xdr_gf1_cli_log_filename_req); @@ -2361,7 +2347,7 @@ gf_cli3_1_log_level_cbk (struct rpc_req *req, struct iovec *iov, if (req->rpc_status == -1) goto out; - ret = gf_xdr_to_cli_log_level_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf1_cli_log_level_rsp); if (ret < 0) { gf_log ("cli", GF_LOG_ERROR, "log level response error"); goto out; @@ -2411,7 +2397,6 @@ gf_cli3_1_log_level (call_frame_t *frame, xlator_t *this, ret = cli_cmd_submit (&req, frame, cli_rpc_prog, GLUSTER_CLI_LOG_LEVEL, NULL, - gf_xdr_from_cli_log_level_req, this, gf_cli3_1_log_level_cbk, (xdrproc_t) xdr_gf1_cli_log_level_req); @@ -2446,7 +2431,6 @@ gf_cli3_1_log_locate (call_frame_t *frame, xlator_t *this, ret = cli_cmd_submit (&req, frame, cli_rpc_prog, GLUSTER_CLI_LOG_LOCATE, NULL, - gf_xdr_from_cli_log_locate_req, this, gf_cli3_1_log_locate_cbk, (xdrproc_t) xdr_gf1_cli_log_locate_req); @@ -2481,7 +2465,6 @@ gf_cli3_1_log_rotate (call_frame_t *frame, xlator_t *this, ret = cli_cmd_submit (&req, frame, cli_rpc_prog, GLUSTER_CLI_LOG_ROTATE, NULL, - gf_xdr_from_cli_log_rotate_req, this, gf_cli3_1_log_rotate_cbk, (xdrproc_t) xdr_gf1_cli_log_rotate_req); @@ -2505,8 +2488,7 @@ gf_cli3_1_sync_volume (call_frame_t *frame, xlator_t *this, ret = cli_cmd_submit ((gf1_cli_sync_volume_req*)data, frame, cli_rpc_prog, GLUSTER_CLI_SYNC_VOLUME, - NULL, gf_xdr_from_cli_sync_volume_req, - this, gf_cli3_1_sync_volume_cbk, + NULL, this, gf_cli3_1_sync_volume_cbk, (xdrproc_t) xdr_gf1_cli_sync_volume_req); out: @@ -2536,7 +2518,6 @@ gf_cli3_1_getspec (call_frame_t *frame, xlator_t *this, ret = cli_cmd_submit (&req, frame, &cli_handshake_prog, GF_HNDSK_GETSPEC, NULL, - xdr_from_getspec_req, this, gf_cli3_1_getspec_cbk, (xdrproc_t) xdr_gf_getspec_req); @@ -2576,10 +2557,9 @@ gf_cli3_1_quota (call_frame_t *frame, xlator_t *this, } ret = cli_cmd_submit (&req, frame, cli_rpc_prog, - GLUSTER_CLI_QUOTA, NULL, - gf_xdr_from_cli_quota_req, - this, gf_cli3_1_quota_cbk, - (xdrproc_t) xdr_gf1_cli_quota_req); + GLUSTER_CLI_QUOTA, NULL, + this, gf_cli3_1_quota_cbk, + (xdrproc_t) xdr_gf1_cli_quota_req); GF_FREE (req.dict.dict_val); out: @@ -2606,7 +2586,6 @@ gf_cli3_1_pmap_b2p (call_frame_t *frame, xlator_t *this, void *data) ret = cli_cmd_submit (&req, frame, &cli_pmap_prog, GF_PMAP_PORTBYBRICK, NULL, - xdr_from_pmap_port_by_brick_req, this, gf_cli3_1_pmap_b2p_cbk, (xdrproc_t) xdr_pmap_port_by_brick_req); @@ -2635,7 +2614,7 @@ gf_cli3_1_fsm_log_cbk (struct rpc_req *req, struct iovec *iov, goto out; } - ret = gf_xdr_to_cli_fsm_log_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf1_cli_fsm_log_rsp); if (ret < 0) { gf_log ("", GF_LOG_ERROR, "error"); goto out; @@ -2721,7 +2700,6 @@ gf_cli3_1_fsm_log (call_frame_t *frame, xlator_t *this, void *data) req.name = data; ret = cli_cmd_submit (&req, frame, cli_rpc_prog, GLUSTER_CLI_FSM_LOG, NULL, - gf_xdr_from_cli_fsm_log_req, this, gf_cli3_1_fsm_log_cbk, (xdrproc_t) xdr_gf1_cli_fsm_log_req); @@ -2844,7 +2822,7 @@ gf_cli3_1_gsync_set_cbk (struct rpc_req *req, struct iovec *iov, goto out; } - ret = gf_xdr_to_cli_gsync_set_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf1_cli_gsync_set_rsp); if (ret < 0) { gf_log ("", GF_LOG_ERROR, "Unable to get response structure"); @@ -2937,7 +2915,6 @@ gf_cli3_1_gsync_set (call_frame_t *frame, xlator_t *this, ret = cli_cmd_submit (&req, frame, cli_rpc_prog, GLUSTER_CLI_GSYNC_SET, NULL, - gf_xdr_from_cli_gsync_set_req, this, gf_cli3_1_gsync_set_cbk, (xdrproc_t) xdr_gf1_cli_gsync_set_req); @@ -3171,7 +3148,7 @@ gf_cli3_1_profile_volume_cbk (struct rpc_req *req, struct iovec *iov, } gf_log ("cli", GF_LOG_DEBUG, "Received resp to profile"); - ret = gf_xdr_to_cli_stats_volume_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf1_cli_stats_volume_rsp); if (ret < 0) { gf_log ("", GF_LOG_ERROR, "error"); goto out; @@ -3289,7 +3266,6 @@ gf_cli3_1_profile_volume (call_frame_t *frame, xlator_t *this, void *data) ret = cli_cmd_submit (&req, frame, cli_rpc_prog, GLUSTER_CLI_PROFILE_VOLUME, NULL, - gf_xdr_from_cli_stats_volume_req, this, gf_cli3_1_profile_volume_cbk, (xdrproc_t) xdr_gf1_cli_stats_volume_req); @@ -3331,7 +3307,7 @@ gf_cli3_1_top_volume_cbk (struct rpc_req *req, struct iovec *iov, } gf_log ("cli", GF_LOG_DEBUG, "Received resp to top"); - ret = gf_xdr_to_cli_stats_volume_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf1_cli_stats_volume_rsp); if (ret < 0) { gf_log ("", GF_LOG_ERROR, "Unable to decode response"); goto out; @@ -3505,7 +3481,6 @@ gf_cli3_1_top_volume (call_frame_t *frame, xlator_t *this, void *data) ret = cli_cmd_submit (&req, frame, cli_rpc_prog, GLUSTER_CLI_PROFILE_VOLUME, NULL, - gf_xdr_from_cli_stats_volume_req, this, gf_cli3_1_top_volume_cbk, (xdrproc_t) xdr_gf1_cli_stats_volume_req); @@ -3526,7 +3501,7 @@ gf_cli3_1_getwd_cbk (struct rpc_req *req, struct iovec *iov, goto out; } - ret = gf_xdr_to_cli_getwd_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf1_cli_getwd_rsp); if (ret < 0 || rsp.op_ret == -1) { gf_log ("", GF_LOG_ERROR, "error"); goto out; @@ -3557,7 +3532,6 @@ gf_cli3_1_getwd (call_frame_t *frame, xlator_t *this, void *data) ret = cli_cmd_submit (&req, frame, cli_rpc_prog, GLUSTER_CLI_GETWD, NULL, - gf_xdr_from_cli_getwd_req, this, gf_cli3_1_getwd_cbk, (xdrproc_t) xdr_gf1_cli_getwd_req); @@ -3588,7 +3562,7 @@ gf_cli3_1_status_cbk (struct rpc_req *req, struct iovec *iov, if (req->rpc_status == -1) goto out; - ret = gf_xdr_to_cli_status_volume_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf1_cli_status_volume_rsp); if (ret < 0) { gf_log ("cli", GF_LOG_ERROR, "Volume status response error"); goto out; @@ -3683,7 +3657,6 @@ gf_cli3_1_status_volume (call_frame_t *frame, xlator_t *this, ret = cli_cmd_submit (&req, frame, cli_rpc_prog, GLUSTER_CLI_STATUS_VOLUME, NULL, - gf_xdr_from_cli_status_volume_req, this, gf_cli3_1_status_cbk, (xdrproc_t)xdr_gf1_cli_status_volume_req); diff --git a/cli/src/cli.c b/cli/src/cli.c index eec14d6fad0..51270f8a00a 100644 --- a/cli/src/cli.c +++ b/cli/src/cli.c @@ -74,6 +74,8 @@ #include "call-stub.h" #include <fnmatch.h> +#include "xdr-generic.h" + extern int connected; /* using argp for command line parsing */ static char gf_doc[] = ""; @@ -265,8 +267,7 @@ int cli_submit_request (void *req, call_frame_t *frame, rpc_clnt_prog_t *prog, int procnum, struct iobref *iobref, - cli_serialize_t sfunc, xlator_t *this, - fop_cbk_fn_t cbkfn, xdrproc_t xdrproc) + xlator_t *this, fop_cbk_fn_t cbkfn, xdrproc_t xdrproc) { int ret = -1; int count = 0; @@ -278,30 +279,30 @@ cli_submit_request (void *req, call_frame_t *frame, GF_ASSERT (this); - xdr_size = xdr_sizeof (xdrproc, req); - iobuf = iobuf_get2 (this->ctx->iobuf_pool, xdr_size); - if (!iobuf) { - goto out; - }; + if (req) { + xdr_size = xdr_sizeof (xdrproc, req); + iobuf = iobuf_get2 (this->ctx->iobuf_pool, xdr_size); + if (!iobuf) { + goto out; + }; - if (!iobref) { - iobref = iobref_new (); if (!iobref) { - goto out; - } + iobref = iobref_new (); + if (!iobref) { + goto out; + } - new_iobref = 1; - } + new_iobref = 1; + } - iobref_add (iobref, iobuf); + iobref_add (iobref, iobuf); - iov.iov_base = iobuf->ptr; - iov.iov_len = iobuf_size (iobuf); + iov.iov_base = iobuf->ptr; + iov.iov_len = iobuf_size (iobuf); - /* Create the xdr payload */ - if (req && sfunc) { - ret = sfunc (iov, req); + /* Create the xdr payload */ + ret = xdr_serialize_generic (iov, req, xdrproc); if (ret == -1) { goto out; } diff --git a/cli/src/cli.h b/cli/src/cli.h index 55d0d89f1d0..b8db0bec840 100644 --- a/cli/src/cli.h +++ b/cli/src/cli.h @@ -184,8 +184,7 @@ int cli_submit_request (void *req, call_frame_t *frame, rpc_clnt_prog_t *prog, int procnum, struct iobref *iobref, - cli_serialize_t sfunc, xlator_t *this, - fop_cbk_fn_t cbkfn, xdrproc_t xdrproc); + xlator_t *this, fop_cbk_fn_t cbkfn, xdrproc_t xdrproc); int32_t cli_cmd_volume_create_parse (const char **words, int wordcount, diff --git a/extras/generate-xdr-files.sh b/extras/generate-xdr-files.sh new file mode 100755 index 00000000000..fd1733bc8e2 --- /dev/null +++ b/extras/generate-xdr-files.sh @@ -0,0 +1,100 @@ +#!/bin/sh + +_init () +{ + xfile="$1"; + # TODO: check the validity of .x file + + cfile="${1%.x}.c"; + hfile="${1%.x}.h"; + + tmp_cfile="$1.c"; + + tmp1_hfile="$1.h.tmp"; + tmp1_cfile="$1.c.tmp"; + +} + +append_licence_header () +{ + src_file=$1; + dst_file=$2; + + cat >$dst_file <<EOF +/* + Copyright (c) 2007-2011 Gluster, Inc. <http://www.gluster.com> + This file is part of GlusterFS. + + GlusterFS is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + GlusterFS is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see + <http://www.gnu.org/licenses/>. +*/ + +#include "xdr-common.h" + +EOF + + cat $src_file >> $dst_file; + +} + +main () +{ + if [ $# -ne 1 ]; then + echo "wrong number of arguments given" + echo " $0 <XDR-definition-file>.x" + exit 1; + fi + + + echo -n "writing the XDR routine file ($tmp_cfile) ... "; + rm -f $tmp_cfile; + rpcgen -c -o $tmp_cfile $xfile; + + # get rid of warnings in xdr .c file due to "unused variable 'buf'" + sed -i -e 's:buf;$:buf;\ + buf = NULL;:' $tmp_cfile; + + sed -i '/int i;/d' $tmp_cfile; + + echo "OK"; + + # no need for a temporary file here as there are no changes from glusterfs + echo -n "writing the XDR header file ($hfile) ... "; + rm -f $hfile; + rpcgen -h -o $hfile $xfile; + + # the '#ifdef' part of file should be fixed + sed -i -e 's:\(.*\)-\(.*\)_H_RPCGEN:\1_\2_H_RPCGEN:g' $hfile; + + echo "OK"; + + echo -n "writing licence header to the generated files ... "; + # Write header to temp file and append generated file + append_licence_header $hfile $tmp1_hfile; + append_licence_header $tmp_cfile $tmp1_cfile; + echo "OK" + + # now move the destination file to actual original file + echo -n "updating existing files ... "; + mv $tmp1_hfile $hfile; + mv $tmp1_cfile $cfile; + + # remove unwanted temporary files (if any) + rm -f $tmp_cfile $tmp1_cfile $tmp1_hfile + + echo "OK" + +} + +_init "$@" && main "$@"; diff --git a/glusterfsd/src/glusterfsd-mgmt.c b/glusterfsd/src/glusterfsd-mgmt.c index be93521d0a1..a55ceebde51 100644 --- a/glusterfsd/src/glusterfsd-mgmt.c +++ b/glusterfsd/src/glusterfsd-mgmt.c @@ -37,19 +37,15 @@ #include "rpc-clnt.h" #include "protocol-common.h" #include "glusterfs3.h" -#include "portmap.h" -#include "glusterd1.h" +#include "portmap-xdr.h" +#include "glusterd1-xdr.h" +#include "xdr-generic.h" #include "glusterfsd.h" #include "rpcsvc.h" static char is_mgmt_rpc_reconnect; -typedef ssize_t (*mgmt_serialize_t) (struct iovec outmsg, void *args); -typedef ssize_t (*gf_serialize_t) (struct iovec outmsg, void *args); - - - int glusterfs_mgmt_pmap_signin (glusterfs_ctx_t *ctx); int glusterfs_volfile_fetch (glusterfs_ctx_t *ctx); int glusterfs_process_volfp (glusterfs_ctx_t *ctx, FILE *fp); @@ -69,8 +65,7 @@ mgmt_cbk_spec (void *data) struct iobuf * glusterfs_serialize_reply (rpcsvc_request_t *req, void *arg, - gf_serialize_t sfunc, struct iovec *outmsg, - xdrproc_t xdrproc) + struct iovec *outmsg, xdrproc_t xdrproc) { struct iobuf *iob = NULL; ssize_t retlen = -1; @@ -93,7 +88,7 @@ glusterfs_serialize_reply (rpcsvc_request_t *req, void *arg, /* retlen is used to received the error since size_t is unsigned and we * need -1 for error notification during encoding. */ - retlen = sfunc (*outmsg, arg); + retlen = xdr_serialize_generic (*outmsg, arg, xdrproc); if (retlen == -1) { gf_log (THIS->name, GF_LOG_ERROR, "Failed to encode message"); goto ret; @@ -112,8 +107,7 @@ ret: int glusterfs_submit_reply (rpcsvc_request_t *req, void *arg, struct iovec *payload, int payloadcount, - struct iobref *iobref, gf_serialize_t sfunc, - xdrproc_t xdrproc) + struct iobref *iobref, xdrproc_t xdrproc) { struct iobuf *iob = NULL; int ret = -1; @@ -136,7 +130,7 @@ glusterfs_submit_reply (rpcsvc_request_t *req, void *arg, new_iobref = 1; } - iob = glusterfs_serialize_reply (req, arg, sfunc, &rsp, xdrproc); + iob = glusterfs_serialize_reply (req, arg, &rsp, xdrproc); if (!iob) { gf_log (THIS->name, GF_LOG_ERROR, "Failed to serialize reply"); goto out; @@ -186,7 +180,6 @@ glusterfs_terminate_response_send (rpcsvc_request_t *req, int op_ret) if (ret == 0) ret = glusterfs_submit_reply (req, &rsp, NULL, 0, NULL, - gd_xdr_serialize_mgmt_brick_op_rsp, (xdrproc_t)xdr_gd1_mgmt_brick_op_rsp); if (rsp.output.output_val) @@ -253,7 +246,6 @@ glusterfs_translator_info_response_send (rpcsvc_request_t *req, int ret, (size_t *)&rsp.output.output_len); ret = glusterfs_submit_reply (req, &rsp, NULL, 0, NULL, - gd_xdr_serialize_mgmt_brick_op_rsp, (xdrproc_t)xdr_gd1_mgmt_brick_op_rsp); if (rsp.output.output_val) GF_FREE (rsp.output.output_val); @@ -283,7 +275,8 @@ glusterfs_handle_translator_info_get (rpcsvc_request_t *req) active = ctx->active; any = active->first; - if (!gd_xdr_to_mgmt_brick_op_req (req->msg[0], &xlator_req)) { + if (!xdr_to_generic (req->msg[0], &xlator_req, + (xdrproc_t)xdr_gd1_mgmt_brick_op_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -405,8 +398,7 @@ int mgmt_submit_request (void *req, call_frame_t *frame, glusterfs_ctx_t *ctx, rpc_clnt_prog_t *prog, int procnum, - mgmt_serialize_t sfunc, fop_cbk_fn_t cbkfn, - xdrproc_t xdrproc) + fop_cbk_fn_t cbkfn, xdrproc_t xdrproc) { int ret = -1; int count = 0; @@ -420,22 +412,21 @@ mgmt_submit_request (void *req, call_frame_t *frame, goto out; } - xdr_size = xdr_sizeof (xdrproc, req); + if (req) { + xdr_size = xdr_sizeof (xdrproc, req); - iobuf = iobuf_get2 (ctx->iobuf_pool, xdr_size); - if (!iobuf) { - goto out; - }; - - iobref_add (iobref, iobuf); + iobuf = iobuf_get2 (ctx->iobuf_pool, xdr_size); + if (!iobuf) { + goto out; + }; - iov.iov_base = iobuf->ptr; - iov.iov_len = iobuf_pagesize (iobuf); + iobref_add (iobref, iobuf); + iov.iov_base = iobuf->ptr; + iov.iov_len = iobuf_pagesize (iobuf); - /* Create the xdr payload */ - if (req && sfunc) { - ret = sfunc (iov, req); + /* Create the xdr payload */ + ret = xdr_serialize_generic (iov, req, xdrproc); if (ret == -1) { gf_log (THIS->name, GF_LOG_WARNING, "failed to create XDR payload"); goto out; @@ -628,7 +619,7 @@ mgmt_getspec_cbk (struct rpc_req *req, struct iovec *iov, int count, goto out; } - ret = xdr_to_getspec_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf_getspec_rsp); if (ret < 0) { gf_log (frame->this->name, GF_LOG_ERROR, "XDR decoding error"); ret = -1; @@ -728,8 +719,7 @@ glusterfs_volfile_fetch (glusterfs_ctx_t *ctx) req.flags = 0; ret = mgmt_submit_request (&req, frame, ctx, &clnt_handshake_prog, - GF_HNDSK_GETSPEC, xdr_from_getspec_req, - mgmt_getspec_cbk, + GF_HNDSK_GETSPEC, mgmt_getspec_cbk, (xdrproc_t)xdr_gf_getspec_req); return ret; } @@ -928,7 +918,7 @@ mgmt_pmap_signin2_cbk (struct rpc_req *req, struct iovec *iov, int count, goto out; } - ret = xdr_to_pmap_signin_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_pmap_signin_rsp); if (ret < 0) { gf_log (frame->this->name, GF_LOG_ERROR, "XDR decode error"); rsp.op_ret = -1; @@ -967,7 +957,7 @@ mgmt_pmap_signin_cbk (struct rpc_req *req, struct iovec *iov, int count, goto out; } - ret = xdr_to_pmap_signin_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_pmap_signin_rsp); if (ret < 0) { gf_log (frame->this->name, GF_LOG_ERROR, "XDR decode error"); rsp.op_ret = -1; @@ -994,8 +984,7 @@ mgmt_pmap_signin_cbk (struct rpc_req *req, struct iovec *iov, int count, pmap_req.brick = brick_name; ret = mgmt_submit_request (&pmap_req, frame, ctx, &clnt_pmap_prog, - GF_PMAP_SIGNIN, xdr_from_pmap_signin_req, - mgmt_pmap_signin2_cbk, + GF_PMAP_SIGNIN, mgmt_pmap_signin2_cbk, (xdrproc_t)xdr_pmap_signin_req); if (ret) goto out; @@ -1029,8 +1018,7 @@ glusterfs_mgmt_pmap_signin (glusterfs_ctx_t *ctx) req.brick = cmd_args->brick_name; ret = mgmt_submit_request (&req, frame, ctx, &clnt_pmap_prog, - GF_PMAP_SIGNIN, xdr_from_pmap_signin_req, - mgmt_pmap_signin_cbk, + GF_PMAP_SIGNIN, mgmt_pmap_signin_cbk, (xdrproc_t)xdr_pmap_signin_req); out: @@ -1056,7 +1044,7 @@ mgmt_pmap_signout_cbk (struct rpc_req *req, struct iovec *iov, int count, } ctx = glusterfs_ctx_get (); - ret = xdr_to_pmap_signout_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_pmap_signout_rsp); if (ret < 0) { gf_log (THIS->name, GF_LOG_ERROR, "XDR decoding failed"); rsp.op_ret = -1; @@ -1097,8 +1085,7 @@ glusterfs_mgmt_pmap_signout (glusterfs_ctx_t *ctx) req.brick = cmd_args->brick_name; ret = mgmt_submit_request (&req, frame, ctx, &clnt_pmap_prog, - GF_PMAP_SIGNOUT, xdr_from_pmap_signout_req, - mgmt_pmap_signout_cbk, + GF_PMAP_SIGNOUT, mgmt_pmap_signout_cbk, (xdrproc_t)xdr_pmap_signout_req); out: return ret; diff --git a/rpc/rpc-transport/socket/src/socket.c b/rpc/rpc-transport/socket/src/socket.c index fc402b6a2ec..00adc6def42 100644 --- a/rpc/rpc-transport/socket/src/socket.c +++ b/rpc/rpc-transport/socket/src/socket.c @@ -37,7 +37,6 @@ /* ugly #includes below */ #include "protocol-common.h" #include "glusterfs3-xdr.h" -#include "glusterfs3.h" #include "xdr-nfs3.h" #include "rpcsvc.h" diff --git a/rpc/xdr/src/Makefile.am b/rpc/xdr/src/Makefile.am index d239700903c..cabab3db62d 100644 --- a/rpc/xdr/src/Makefile.am +++ b/rpc/xdr/src/Makefile.am @@ -10,15 +10,15 @@ libgfxdr_la_LIBADD = $(top_builddir)/libglusterfs/src/libglusterfs.la \ $(top_builddir)/rpc/rpc-lib/src/libgfrpc.la libgfxdr_la_SOURCES = xdr-generic.c \ - glusterfs3-xdr.c glusterfs3.c \ - cli1-xdr.c cli1.c \ - glusterd1-xdr.c glusterd1.c \ - portmap-xdr.c portmap.c \ + glusterfs3-xdr.c \ + cli1-xdr.c \ + glusterd1-xdr.c \ + portmap-xdr.c \ xdr-nfs3.c msg-nfs3.c noinst_HEADERS = xdr-generic.h \ glusterfs3-xdr.h glusterfs3.h \ - cli1-xdr.h cli1.h \ - glusterd1-xdr.h glusterd1.h \ - portmap-xdr.h portmap.h \ + cli1-xdr.h \ + glusterd1-xdr.h \ + portmap-xdr.h \ xdr-nfs3.h msg-nfs3.h diff --git a/rpc/xdr/src/cli1-xdr.c b/rpc/xdr/src/cli1-xdr.c index a37e4cd21af..d7d541eb07d 100644 --- a/rpc/xdr/src/cli1-xdr.c +++ b/rpc/xdr/src/cli1-xdr.c @@ -17,18 +17,31 @@ <http://www.gnu.org/licenses/>. */ +#include "xdr-common.h" + /* * Please do not edit this file. * It was generated using rpcgen. */ #include "cli1-xdr.h" -#include "xdr-common.h" -#include "compat.h" + +bool_t +xdr_gf_cli_defrag_type (XDR *xdrs, gf_cli_defrag_type *objp) +{ + register int32_t *buf; + buf = NULL; + + if (!xdr_enum (xdrs, (enum_t *) objp)) + return FALSE; + return TRUE; +} bool_t xdr_gf1_cluster_type (XDR *xdrs, gf1_cluster_type *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_enum (xdrs, (enum_t *) objp)) return FALSE; @@ -38,6 +51,8 @@ xdr_gf1_cluster_type (XDR *xdrs, gf1_cluster_type *objp) bool_t xdr_gf1_cli_replace_op (XDR *xdrs, gf1_cli_replace_op *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_enum (xdrs, (enum_t *) objp)) return FALSE; @@ -47,6 +62,8 @@ xdr_gf1_cli_replace_op (XDR *xdrs, gf1_cli_replace_op *objp) bool_t xdr_gf_quota_type (XDR *xdrs, gf_quota_type *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_enum (xdrs, (enum_t *) objp)) return FALSE; @@ -56,6 +73,8 @@ xdr_gf_quota_type (XDR *xdrs, gf_quota_type *objp) bool_t xdr_gf1_cli_friends_list (XDR *xdrs, gf1_cli_friends_list *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_enum (xdrs, (enum_t *) objp)) return FALSE; @@ -65,6 +84,8 @@ xdr_gf1_cli_friends_list (XDR *xdrs, gf1_cli_friends_list *objp) bool_t xdr_gf1_cli_get_volume (XDR *xdrs, gf1_cli_get_volume *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_enum (xdrs, (enum_t *) objp)) return FALSE; @@ -74,6 +95,8 @@ xdr_gf1_cli_get_volume (XDR *xdrs, gf1_cli_get_volume *objp) bool_t xdr_gf1_cli_sync_volume (XDR *xdrs, gf1_cli_sync_volume *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_enum (xdrs, (enum_t *) objp)) return FALSE; @@ -83,6 +106,8 @@ xdr_gf1_cli_sync_volume (XDR *xdrs, gf1_cli_sync_volume *objp) bool_t xdr_gf1_cli_op_flags (XDR *xdrs, gf1_cli_op_flags *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_enum (xdrs, (enum_t *) objp)) return FALSE; @@ -92,6 +117,8 @@ xdr_gf1_cli_op_flags (XDR *xdrs, gf1_cli_op_flags *objp) bool_t xdr_gf1_cli_gsync_set (XDR *xdrs, gf1_cli_gsync_set *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_enum (xdrs, (enum_t *) objp)) return FALSE; @@ -101,6 +128,8 @@ xdr_gf1_cli_gsync_set (XDR *xdrs, gf1_cli_gsync_set *objp) bool_t xdr_gf1_cli_stats_op (XDR *xdrs, gf1_cli_stats_op *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_enum (xdrs, (enum_t *) objp)) return FALSE; @@ -110,6 +139,8 @@ xdr_gf1_cli_stats_op (XDR *xdrs, gf1_cli_stats_op *objp) bool_t xdr_gf1_cli_top_op (XDR *xdrs, gf1_cli_top_op *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_enum (xdrs, (enum_t *) objp)) return FALSE; @@ -119,6 +150,8 @@ xdr_gf1_cli_top_op (XDR *xdrs, gf1_cli_top_op *objp) bool_t xdr_gf1_cli_probe_req (XDR *xdrs, gf1_cli_probe_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_string (xdrs, &objp->hostname, ~0)) return FALSE; @@ -130,8 +163,9 @@ xdr_gf1_cli_probe_req (XDR *xdrs, gf1_cli_probe_req *objp) bool_t xdr_gf1_cli_probe_rsp (XDR *xdrs, gf1_cli_probe_rsp *objp) { - register int32_t *buf; + buf = NULL; + if (xdrs->x_op == XDR_ENCODE) { buf = XDR_INLINE (xdrs, 3 * BYTES_PER_XDR_UNIT); @@ -185,6 +219,8 @@ xdr_gf1_cli_probe_rsp (XDR *xdrs, gf1_cli_probe_rsp *objp) bool_t xdr_gf1_cli_deprobe_req (XDR *xdrs, gf1_cli_deprobe_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_string (xdrs, &objp->hostname, ~0)) return FALSE; @@ -196,6 +232,8 @@ xdr_gf1_cli_deprobe_req (XDR *xdrs, gf1_cli_deprobe_req *objp) bool_t xdr_gf1_cli_deprobe_rsp (XDR *xdrs, gf1_cli_deprobe_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -209,6 +247,8 @@ xdr_gf1_cli_deprobe_rsp (XDR *xdrs, gf1_cli_deprobe_rsp *objp) bool_t xdr_gf1_cli_peer_list_req (XDR *xdrs, gf1_cli_peer_list_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->flags)) return FALSE; @@ -220,6 +260,8 @@ xdr_gf1_cli_peer_list_req (XDR *xdrs, gf1_cli_peer_list_req *objp) bool_t xdr_gf1_cli_peer_list_rsp (XDR *xdrs, gf1_cli_peer_list_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -233,6 +275,8 @@ xdr_gf1_cli_peer_list_rsp (XDR *xdrs, gf1_cli_peer_list_rsp *objp) bool_t xdr_gf1_cli_get_vol_req (XDR *xdrs, gf1_cli_get_vol_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->flags)) return FALSE; @@ -244,6 +288,8 @@ xdr_gf1_cli_get_vol_req (XDR *xdrs, gf1_cli_get_vol_req *objp) bool_t xdr_gf1_cli_get_vol_rsp (XDR *xdrs, gf1_cli_get_vol_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -257,6 +303,8 @@ xdr_gf1_cli_get_vol_rsp (XDR *xdrs, gf1_cli_get_vol_rsp *objp) bool_t xdr_gf1_cli_create_vol_req (XDR *xdrs, gf1_cli_create_vol_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_string (xdrs, &objp->volname, ~0)) return FALSE; @@ -272,6 +320,8 @@ xdr_gf1_cli_create_vol_req (XDR *xdrs, gf1_cli_create_vol_req *objp) bool_t xdr_gf1_cli_create_vol_rsp (XDR *xdrs, gf1_cli_create_vol_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -287,6 +337,8 @@ xdr_gf1_cli_create_vol_rsp (XDR *xdrs, gf1_cli_create_vol_rsp *objp) bool_t xdr_gf1_cli_delete_vol_req (XDR *xdrs, gf1_cli_delete_vol_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_string (xdrs, &objp->volname, ~0)) return FALSE; @@ -296,6 +348,8 @@ xdr_gf1_cli_delete_vol_req (XDR *xdrs, gf1_cli_delete_vol_req *objp) bool_t xdr_gf1_cli_delete_vol_rsp (XDR *xdrs, gf1_cli_delete_vol_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -311,6 +365,8 @@ xdr_gf1_cli_delete_vol_rsp (XDR *xdrs, gf1_cli_delete_vol_rsp *objp) bool_t xdr_gf1_cli_start_vol_req (XDR *xdrs, gf1_cli_start_vol_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_string (xdrs, &objp->volname, ~0)) return FALSE; @@ -322,6 +378,8 @@ xdr_gf1_cli_start_vol_req (XDR *xdrs, gf1_cli_start_vol_req *objp) bool_t xdr_gf1_cli_start_vol_rsp (XDR *xdrs, gf1_cli_start_vol_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -337,6 +395,8 @@ xdr_gf1_cli_start_vol_rsp (XDR *xdrs, gf1_cli_start_vol_rsp *objp) bool_t xdr_gf1_cli_stop_vol_req (XDR *xdrs, gf1_cli_stop_vol_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_string (xdrs, &objp->volname, ~0)) return FALSE; @@ -348,6 +408,8 @@ xdr_gf1_cli_stop_vol_req (XDR *xdrs, gf1_cli_stop_vol_req *objp) bool_t xdr_gf1_cli_stop_vol_rsp (XDR *xdrs, gf1_cli_stop_vol_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -363,6 +425,8 @@ xdr_gf1_cli_stop_vol_rsp (XDR *xdrs, gf1_cli_stop_vol_rsp *objp) bool_t xdr_gf1_cli_rename_vol_req (XDR *xdrs, gf1_cli_rename_vol_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_string (xdrs, &objp->old_volname, ~0)) return FALSE; @@ -374,6 +438,8 @@ xdr_gf1_cli_rename_vol_req (XDR *xdrs, gf1_cli_rename_vol_req *objp) bool_t xdr_gf1_cli_rename_vol_rsp (XDR *xdrs, gf1_cli_rename_vol_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -387,6 +453,8 @@ xdr_gf1_cli_rename_vol_rsp (XDR *xdrs, gf1_cli_rename_vol_rsp *objp) bool_t xdr_gf1_cli_defrag_vol_req (XDR *xdrs, gf1_cli_defrag_vol_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->cmd)) return FALSE; @@ -398,6 +466,8 @@ xdr_gf1_cli_defrag_vol_req (XDR *xdrs, gf1_cli_defrag_vol_req *objp) bool_t xdr_gf1_cli_defrag_vol_rsp (XDR *xdrs, gf1_cli_defrag_vol_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -417,6 +487,8 @@ xdr_gf1_cli_defrag_vol_rsp (XDR *xdrs, gf1_cli_defrag_vol_rsp *objp) bool_t xdr_gf2_cli_defrag_vol_rsp (XDR *xdrs, gf2_cli_defrag_vol_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -438,6 +510,8 @@ xdr_gf2_cli_defrag_vol_rsp (XDR *xdrs, gf2_cli_defrag_vol_rsp *objp) bool_t xdr_gf1_cli_add_brick_req (XDR *xdrs, gf1_cli_add_brick_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_string (xdrs, &objp->volname, ~0)) return FALSE; @@ -451,6 +525,8 @@ xdr_gf1_cli_add_brick_req (XDR *xdrs, gf1_cli_add_brick_req *objp) bool_t xdr_gf1_cli_add_brick_rsp (XDR *xdrs, gf1_cli_add_brick_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -466,6 +542,8 @@ xdr_gf1_cli_add_brick_rsp (XDR *xdrs, gf1_cli_add_brick_rsp *objp) bool_t xdr_gf1_cli_remove_brick_req (XDR *xdrs, gf1_cli_remove_brick_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_string (xdrs, &objp->volname, ~0)) return FALSE; @@ -479,6 +557,8 @@ xdr_gf1_cli_remove_brick_req (XDR *xdrs, gf1_cli_remove_brick_req *objp) bool_t xdr_gf1_cli_remove_brick_rsp (XDR *xdrs, gf1_cli_remove_brick_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -494,6 +574,8 @@ xdr_gf1_cli_remove_brick_rsp (XDR *xdrs, gf1_cli_remove_brick_rsp *objp) bool_t xdr_gf1_cli_replace_brick_req (XDR *xdrs, gf1_cli_replace_brick_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_string (xdrs, &objp->volname, ~0)) return FALSE; @@ -507,6 +589,8 @@ xdr_gf1_cli_replace_brick_req (XDR *xdrs, gf1_cli_replace_brick_req *objp) bool_t xdr_gf1_cli_replace_brick_rsp (XDR *xdrs, gf1_cli_replace_brick_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -524,6 +608,8 @@ xdr_gf1_cli_replace_brick_rsp (XDR *xdrs, gf1_cli_replace_brick_rsp *objp) bool_t xdr_gf1_cli_reset_vol_req (XDR *xdrs, gf1_cli_reset_vol_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_string (xdrs, &objp->volname, ~0)) return FALSE; @@ -535,6 +621,8 @@ xdr_gf1_cli_reset_vol_req (XDR *xdrs, gf1_cli_reset_vol_req *objp) bool_t xdr_gf1_cli_reset_vol_rsp (XDR *xdrs, gf1_cli_reset_vol_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -550,6 +638,8 @@ xdr_gf1_cli_reset_vol_rsp (XDR *xdrs, gf1_cli_reset_vol_rsp *objp) bool_t xdr_gf1_cli_set_vol_req (XDR *xdrs, gf1_cli_set_vol_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_string (xdrs, &objp->volname, ~0)) return FALSE; @@ -561,6 +651,8 @@ xdr_gf1_cli_set_vol_req (XDR *xdrs, gf1_cli_set_vol_req *objp) bool_t xdr_gf1_cli_set_vol_rsp (XDR *xdrs, gf1_cli_set_vol_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -578,6 +670,8 @@ xdr_gf1_cli_set_vol_rsp (XDR *xdrs, gf1_cli_set_vol_rsp *objp) bool_t xdr_gf1_cli_log_filename_req (XDR *xdrs, gf1_cli_log_filename_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_string (xdrs, &objp->volname, ~0)) return FALSE; @@ -591,6 +685,8 @@ xdr_gf1_cli_log_filename_req (XDR *xdrs, gf1_cli_log_filename_req *objp) bool_t xdr_gf1_cli_log_filename_rsp (XDR *xdrs, gf1_cli_log_filename_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -604,6 +700,8 @@ xdr_gf1_cli_log_filename_rsp (XDR *xdrs, gf1_cli_log_filename_rsp *objp) bool_t xdr_gf1_cli_log_locate_req (XDR *xdrs, gf1_cli_log_locate_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_string (xdrs, &objp->volname, ~0)) return FALSE; @@ -615,6 +713,8 @@ xdr_gf1_cli_log_locate_req (XDR *xdrs, gf1_cli_log_locate_req *objp) bool_t xdr_gf1_cli_sync_volume_req (XDR *xdrs, gf1_cli_sync_volume_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->flags)) return FALSE; @@ -628,6 +728,8 @@ xdr_gf1_cli_sync_volume_req (XDR *xdrs, gf1_cli_sync_volume_req *objp) bool_t xdr_gf1_cli_log_locate_rsp (XDR *xdrs, gf1_cli_log_locate_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -641,6 +743,8 @@ xdr_gf1_cli_log_locate_rsp (XDR *xdrs, gf1_cli_log_locate_rsp *objp) bool_t xdr_gf1_cli_log_rotate_req (XDR *xdrs, gf1_cli_log_rotate_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_string (xdrs, &objp->volname, ~0)) return FALSE; @@ -652,6 +756,8 @@ xdr_gf1_cli_log_rotate_req (XDR *xdrs, gf1_cli_log_rotate_req *objp) bool_t xdr_gf1_cli_log_rotate_rsp (XDR *xdrs, gf1_cli_log_rotate_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -665,6 +771,8 @@ xdr_gf1_cli_log_rotate_rsp (XDR *xdrs, gf1_cli_log_rotate_rsp *objp) bool_t xdr_gf1_cli_sync_volume_rsp (XDR *xdrs, gf1_cli_sync_volume_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -678,6 +786,8 @@ xdr_gf1_cli_sync_volume_rsp (XDR *xdrs, gf1_cli_sync_volume_rsp *objp) bool_t xdr_gf1_cli_fsm_log_req (XDR *xdrs, gf1_cli_fsm_log_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_string (xdrs, &objp->name, ~0)) return FALSE; @@ -687,6 +797,8 @@ xdr_gf1_cli_fsm_log_req (XDR *xdrs, gf1_cli_fsm_log_req *objp) bool_t xdr_gf1_cli_fsm_log_rsp (XDR *xdrs, gf1_cli_fsm_log_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -702,6 +814,8 @@ xdr_gf1_cli_fsm_log_rsp (XDR *xdrs, gf1_cli_fsm_log_rsp *objp) bool_t xdr_gf1_cli_gsync_set_req (XDR *xdrs, gf1_cli_gsync_set_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_bytes (xdrs, (char **)&objp->dict.dict_val, (u_int *) &objp->dict.dict_len, ~0)) return FALSE; @@ -711,6 +825,8 @@ xdr_gf1_cli_gsync_set_req (XDR *xdrs, gf1_cli_gsync_set_req *objp) bool_t xdr_gf1_cli_gsync_set_rsp (XDR *xdrs, gf1_cli_gsync_set_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -728,6 +844,8 @@ xdr_gf1_cli_gsync_set_rsp (XDR *xdrs, gf1_cli_gsync_set_rsp *objp) bool_t xdr_gf1_cli_stats_volume_req (XDR *xdrs, gf1_cli_stats_volume_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_string (xdrs, &objp->volname, ~0)) return FALSE; @@ -741,6 +859,8 @@ xdr_gf1_cli_stats_volume_req (XDR *xdrs, gf1_cli_stats_volume_req *objp) bool_t xdr_gf1_cli_stats_volume_rsp (XDR *xdrs, gf1_cli_stats_volume_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -756,6 +876,8 @@ xdr_gf1_cli_stats_volume_rsp (XDR *xdrs, gf1_cli_stats_volume_rsp *objp) bool_t xdr_gf1_cli_quota_req (XDR *xdrs, gf1_cli_quota_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_string (xdrs, &objp->volname, ~0)) return FALSE; @@ -767,6 +889,8 @@ xdr_gf1_cli_quota_req (XDR *xdrs, gf1_cli_quota_req *objp) bool_t xdr_gf1_cli_quota_rsp (XDR *xdrs, gf1_cli_quota_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -786,6 +910,8 @@ xdr_gf1_cli_quota_rsp (XDR *xdrs, gf1_cli_quota_rsp *objp) bool_t xdr_gf1_cli_getwd_req (XDR *xdrs, gf1_cli_getwd_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->unused)) return FALSE; @@ -795,6 +921,8 @@ xdr_gf1_cli_getwd_req (XDR *xdrs, gf1_cli_getwd_req *objp) bool_t xdr_gf1_cli_getwd_rsp (XDR *xdrs, gf1_cli_getwd_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -808,6 +936,8 @@ xdr_gf1_cli_getwd_rsp (XDR *xdrs, gf1_cli_getwd_rsp *objp) bool_t xdr_gf1_cli_log_level_req (XDR *xdrs, gf1_cli_log_level_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_string (xdrs, &objp->volname, ~0)) return FALSE; @@ -821,6 +951,8 @@ xdr_gf1_cli_log_level_req (XDR *xdrs, gf1_cli_log_level_req *objp) bool_t xdr_gf1_cli_log_level_rsp (XDR *xdrs, gf1_cli_log_level_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -834,6 +966,8 @@ xdr_gf1_cli_log_level_rsp (XDR *xdrs, gf1_cli_log_level_rsp *objp) bool_t xdr_gf1_cli_status_volume_req (XDR *xdrs, gf1_cli_status_volume_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_string (xdrs, &objp->volname, ~0)) return FALSE; @@ -845,6 +979,8 @@ xdr_gf1_cli_status_volume_req (XDR *xdrs, gf1_cli_status_volume_req *objp) bool_t xdr_gf1_cli_status_volume_rsp (XDR *xdrs, gf1_cli_status_volume_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; diff --git a/rpc/xdr/src/cli1-xdr.h b/rpc/xdr/src/cli1-xdr.h index 4863dfa3e91..085b9f28565 100644 --- a/rpc/xdr/src/cli1-xdr.h +++ b/rpc/xdr/src/cli1-xdr.h @@ -16,6 +16,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include "xdr-common.h" + /* * Please do not edit this file. * It was generated using rpcgen. @@ -26,13 +29,22 @@ #include <rpc/rpc.h> -#include "xdr-common.h" #ifdef __cplusplus extern "C" { #endif +enum gf_cli_defrag_type { + GF_DEFRAG_CMD_START = 1, + GF_DEFRAG_CMD_STOP = 1 + 1, + GF_DEFRAG_CMD_STATUS = 1 + 2, + GF_DEFRAG_CMD_START_LAYOUT_FIX = 1 + 3, + GF_DEFRAG_CMD_START_MIGRATE_DATA = 1 + 4, + GF_DEFRAG_CMD_START_MIGRATE_DATA_FORCE = 1 + 5, +}; +typedef enum gf_cli_defrag_type gf_cli_defrag_type; + enum gf1_cluster_type { GF_CLUSTER_TYPE_NONE = 0, GF_CLUSTER_TYPE_STRIPE = 0 + 1, @@ -552,6 +564,7 @@ typedef struct gf1_cli_status_volume_rsp gf1_cli_status_volume_rsp; /* the xdr functions */ #if defined(__STDC__) || defined(__cplusplus) +extern bool_t xdr_gf_cli_defrag_type (XDR *, gf_cli_defrag_type*); extern bool_t xdr_gf1_cluster_type (XDR *, gf1_cluster_type*); extern bool_t xdr_gf1_cli_replace_op (XDR *, gf1_cli_replace_op*); extern bool_t xdr_gf_quota_type (XDR *, gf_quota_type*); @@ -617,6 +630,7 @@ extern bool_t xdr_gf1_cli_status_volume_req (XDR *, gf1_cli_status_volume_req*) extern bool_t xdr_gf1_cli_status_volume_rsp (XDR *, gf1_cli_status_volume_rsp*); #else /* K&R C */ +extern bool_t xdr_gf_cli_defrag_type (); extern bool_t xdr_gf1_cluster_type (); extern bool_t xdr_gf1_cli_replace_op (); extern bool_t xdr_gf_quota_type (); @@ -687,4 +701,4 @@ extern bool_t xdr_gf1_cli_status_volume_rsp (); } #endif -#endif /* !_CLI1-XDR_H_RPCGEN */ +#endif /* !_CLI1_XDR_H_RPCGEN */ diff --git a/rpc/xdr/src/cli1-xdr.x b/rpc/xdr/src/cli1-xdr.x index db15b822a8f..70d221cbb3b 100644 --- a/rpc/xdr/src/cli1-xdr.x +++ b/rpc/xdr/src/cli1-xdr.x @@ -1,3 +1,12 @@ + enum gf_cli_defrag_type { + GF_DEFRAG_CMD_START = 1, + GF_DEFRAG_CMD_STOP, + GF_DEFRAG_CMD_STATUS, + GF_DEFRAG_CMD_START_LAYOUT_FIX, + GF_DEFRAG_CMD_START_MIGRATE_DATA, + GF_DEFRAG_CMD_START_MIGRATE_DATA_FORCE +} ; + enum gf1_cluster_type { GF_CLUSTER_TYPE_NONE = 0, GF_CLUSTER_TYPE_STRIPE, diff --git a/rpc/xdr/src/cli1.c b/rpc/xdr/src/cli1.c deleted file mode 100644 index b69aa612027..00000000000 --- a/rpc/xdr/src/cli1.c +++ /dev/null @@ -1,814 +0,0 @@ -/* - Copyright (c) 2007-2011 Gluster, Inc. <http://www.gluster.com> - This file is part of GlusterFS. - - GlusterFS is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - GlusterFS is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see - <http://www.gnu.org/licenses/>. -*/ - - -#include "cli1.h" -#include "xdr-generic.h" - -ssize_t -gf_xdr_serialize_cli_probe_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gf1_cli_probe_rsp); - -} - -ssize_t -gf_xdr_to_cli_probe_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_probe_req); -} - -ssize_t -gf_xdr_to_cli_probe_rsp (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_probe_rsp); -} - -ssize_t -gf_xdr_from_cli_probe_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gf1_cli_probe_req); -} - -ssize_t -gf_xdr_serialize_cli_deprobe_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gf1_cli_deprobe_rsp); - -} - -ssize_t -gf_xdr_to_cli_deprobe_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_deprobe_req); -} - -ssize_t -gf_xdr_to_cli_deprobe_rsp (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_deprobe_rsp); -} - -ssize_t -gf_xdr_from_cli_deprobe_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gf1_cli_deprobe_req); -} - -ssize_t -gf_xdr_serialize_cli_peer_list_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gf1_cli_peer_list_rsp); - -} - -ssize_t -gf_xdr_to_cli_peer_list_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_peer_list_req); -} - -ssize_t -gf_xdr_to_cli_peer_list_rsp (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_peer_list_rsp); -} - -ssize_t -gf_xdr_from_cli_peer_list_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gf1_cli_peer_list_req); -} - -ssize_t -gf_xdr_serialize_cli_get_vol_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gf1_cli_get_vol_rsp); - -} - -ssize_t -gf_xdr_to_cli_get_vol_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_get_vol_req); -} - -ssize_t -gf_xdr_to_cli_get_vol_rsp (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_get_vol_rsp); -} - -ssize_t -gf_xdr_from_cli_get_vol_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gf1_cli_get_vol_req); -} -ssize_t -gf_xdr_serialize_cli_create_vol_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gf1_cli_create_vol_rsp); - -} - -ssize_t -gf_xdr_to_cli_create_vol_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_create_vol_req); -} - -ssize_t -gf_xdr_to_cli_create_vol_rsp (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_create_vol_rsp); -} - -ssize_t -gf_xdr_from_cli_create_vol_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gf1_cli_create_vol_req); -} - - -ssize_t -gf_xdr_serialize_cli_delete_vol_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gf1_cli_delete_vol_rsp); - -} - -ssize_t -gf_xdr_to_cli_delete_vol_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_delete_vol_req); -} - - -ssize_t -gf_xdr_to_cli_delete_vol_rsp (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_delete_vol_rsp); -} - -ssize_t -gf_xdr_from_cli_delete_vol_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gf1_cli_delete_vol_req); -} - -ssize_t -gf_xdr_serialize_cli_start_vol_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gf1_cli_start_vol_rsp); - -} - -ssize_t -gf_xdr_to_cli_start_vol_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_start_vol_req); -} - -ssize_t -gf_xdr_to_cli_start_vol_rsp (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_start_vol_rsp); -} - -ssize_t -gf_xdr_from_cli_start_vol_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gf1_cli_start_vol_req); -} - - -ssize_t -gf_xdr_serialize_cli_stop_vol_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gf1_cli_stop_vol_rsp); - -} - -ssize_t -gf_xdr_to_cli_stop_vol_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_stop_vol_req); -} - -ssize_t -gf_xdr_to_cli_stop_vol_rsp (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_stop_vol_rsp); -} - -ssize_t -gf_xdr_from_cli_stop_vol_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gf1_cli_stop_vol_req); -} - - -ssize_t -gf_xdr_serialize_cli_rename_vol_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gf1_cli_rename_vol_rsp); - -} - -ssize_t -gf_xdr_to_cli_rename_vol_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_rename_vol_req); -} - -ssize_t -gf_xdr_to_cli_rename_vol_rsp (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_rename_vol_rsp); -} - -ssize_t -gf_xdr_from_cli_rename_vol_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gf1_cli_rename_vol_req); -} - - -ssize_t -gf_xdr_serialize_cli_defrag_vol_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gf1_cli_defrag_vol_rsp); - -} - -ssize_t -gf_xdr_to_cli_defrag_vol_rsp (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_defrag_vol_rsp); -} - -ssize_t -gf_xdr_serialize_cli_defrag_vol_rsp_v2 (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gf2_cli_defrag_vol_rsp); - -} - -ssize_t -gf_xdr_to_cli_defrag_vol_rsp_v2 (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf2_cli_defrag_vol_rsp); -} - -ssize_t -gf_xdr_to_cli_defrag_vol_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_defrag_vol_req); -} - -ssize_t -gf_xdr_from_cli_defrag_vol_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gf1_cli_defrag_vol_req); -} - - - -ssize_t -gf_xdr_serialize_cli_add_brick_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gf1_cli_add_brick_rsp); - -} - -ssize_t -gf_xdr_to_cli_add_brick_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_add_brick_req); -} - -ssize_t -gf_xdr_to_cli_add_brick_rsp (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_add_brick_rsp); -} - -ssize_t -gf_xdr_from_cli_add_brick_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gf1_cli_add_brick_req); -} - - -ssize_t -gf_xdr_serialize_cli_remove_brick_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gf1_cli_remove_brick_rsp); - -} - -ssize_t -gf_xdr_to_cli_remove_brick_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_remove_brick_req); -} - - -ssize_t -gf_xdr_to_cli_remove_brick_rsp (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_remove_brick_rsp); -} - -ssize_t -gf_xdr_from_cli_remove_brick_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gf1_cli_remove_brick_req); -} - - -ssize_t -gf_xdr_serialize_cli_replace_brick_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gf1_cli_replace_brick_rsp); - -} - -ssize_t -gf_xdr_to_cli_replace_brick_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_replace_brick_req); -} - -ssize_t -gf_xdr_to_cli_replace_brick_rsp (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_replace_brick_rsp); -} - -ssize_t -gf_xdr_from_cli_replace_brick_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gf1_cli_replace_brick_req); -} - -ssize_t -gf_xdr_serialize_cli_reset_vol_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gf1_cli_reset_vol_rsp); - -} - -ssize_t -gf_xdr_to_cli_reset_vol_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_reset_vol_req); -} - -ssize_t -gf_xdr_to_cli_reset_vol_rsp (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_reset_vol_rsp); -} - - -ssize_t -gf_xdr_from_cli_reset_vol_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gf1_cli_reset_vol_req); -} - -ssize_t -gf_xdr_serialize_cli_gsync_set_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gf1_cli_gsync_set_rsp); - -} - -ssize_t -gf_xdr_to_cli_gsync_set_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_gsync_set_req); -} - -ssize_t -gf_xdr_to_cli_gsync_set_rsp (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_gsync_set_rsp); -} - - -ssize_t -gf_xdr_from_cli_gsync_set_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gf1_cli_gsync_set_req); -} - -ssize_t -gf_xdr_serialize_cli_quota_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gf1_cli_quota_rsp); - -} - -ssize_t -gf_xdr_to_cli_quota_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_quota_req); -} - -ssize_t -gf_xdr_to_cli_quota_rsp (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_quota_rsp); -} - - -ssize_t -gf_xdr_from_cli_quota_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gf1_cli_quota_req); -} - -ssize_t -gf_xdr_serialize_cli_set_vol_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gf1_cli_set_vol_rsp); - -} - -ssize_t -gf_xdr_to_cli_set_vol_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_set_vol_req); -} - -ssize_t -gf_xdr_to_cli_set_vol_rsp (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_set_vol_rsp); -} - -ssize_t -gf_xdr_from_cli_set_vol_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gf1_cli_set_vol_req); -} - -/* log */ -ssize_t -gf_xdr_serialize_cli_log_filename_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gf1_cli_log_filename_rsp); - -} - -ssize_t -gf_xdr_to_cli_log_filename_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_log_filename_req); -} - -ssize_t -gf_xdr_to_cli_log_filename_rsp (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_log_filename_rsp); -} - -ssize_t -gf_xdr_from_cli_log_filename_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gf1_cli_log_filename_req); -} - -ssize_t -gf_xdr_serialize_cli_log_locate_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gf1_cli_log_locate_rsp); - -} - -ssize_t -gf_xdr_to_cli_log_locate_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_log_locate_req); -} - -ssize_t -gf_xdr_to_cli_log_locate_rsp (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_log_locate_rsp); -} - -ssize_t -gf_xdr_from_cli_log_locate_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gf1_cli_log_locate_req); -} - -ssize_t -gf_xdr_serialize_cli_log_rotate_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gf1_cli_log_rotate_rsp); - -} - -ssize_t -gf_xdr_to_cli_log_rotate_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_log_rotate_req); -} - -ssize_t -gf_xdr_to_cli_log_rotate_rsp (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_log_rotate_rsp); -} - -ssize_t -gf_xdr_from_cli_log_rotate_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gf1_cli_log_rotate_req); -} - -ssize_t -gf_xdr_to_cli_sync_volume_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_sync_volume_req); -} - -ssize_t -gf_xdr_from_cli_sync_volume_req (struct iovec outmsg, void *args) -{ - return xdr_serialize_generic (outmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_sync_volume_req); -} - -ssize_t -gf_xdr_to_cli_sync_volume_rsp (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_sync_volume_rsp); -} - -ssize_t -gf_xdr_from_cli_sync_volume_rsp (struct iovec outmsg, void *args) -{ - return xdr_serialize_generic (outmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_sync_volume_rsp); -} - -ssize_t -gf_xdr_to_cli_fsm_log_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_fsm_log_req); -} - -ssize_t -gf_xdr_from_cli_fsm_log_req (struct iovec outmsg, void *args) -{ - return xdr_serialize_generic (outmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_fsm_log_req); -} - -ssize_t -gf_xdr_to_cli_fsm_log_rsp (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_fsm_log_rsp); -} - -ssize_t -gf_xdr_from_cli_fsm_log_rsp (struct iovec outmsg, void *args) -{ - return xdr_serialize_generic (outmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_fsm_log_rsp); -} - -ssize_t -gf_xdr_to_cli_stats_volume_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_stats_volume_req); -} - -ssize_t -gf_xdr_from_cli_stats_volume_req (struct iovec outmsg, void *args) -{ - return xdr_serialize_generic (outmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_stats_volume_req); -} - -ssize_t -gf_xdr_to_cli_stats_volume_rsp (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_stats_volume_rsp); -} - -ssize_t -gf_xdr_from_cli_stats_volume_rsp (struct iovec outmsg, void *args) -{ - return xdr_serialize_generic (outmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_stats_volume_rsp); -} - -ssize_t -gf_xdr_to_cli_getwd_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_getwd_req); -} - -ssize_t -gf_xdr_from_cli_getwd_req (struct iovec outmsg, void *args) -{ - return xdr_serialize_generic (outmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_getwd_req); -} - -ssize_t -gf_xdr_to_cli_getwd_rsp (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_getwd_rsp); -} - -ssize_t -gf_xdr_from_cli_getwd_rsp (struct iovec outmsg, void *args) -{ - return xdr_serialize_generic (outmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_getwd_rsp); -} - -ssize_t -gf_xdr_serialize_cli_log_level_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gf1_cli_log_level_rsp); - -} - -ssize_t -gf_xdr_to_cli_log_level_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_log_level_req); -} - -ssize_t -gf_xdr_from_cli_log_level_req (struct iovec outmsg, void *args) -{ - return xdr_serialize_generic (outmsg, (void*)args, - (xdrproc_t)xdr_gf1_cli_log_level_req); -} - -ssize_t -gf_xdr_to_cli_log_level_rsp (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_log_level_rsp); -} - -ssize_t -gf_xdr_from_cli_log_level_rsp (struct iovec outmsg, void *args) -{ - return xdr_serialize_generic (outmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_log_level_rsp); -} - -ssize_t -gf_xdr_serialize_cli_status_volume_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gf1_cli_status_volume_rsp); - -} - -ssize_t -gf_xdr_to_cli_status_volume_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_status_volume_req); -} - -ssize_t -gf_xdr_from_cli_status_volume_req (struct iovec outmsg, void *args) -{ - return xdr_serialize_generic (outmsg, (void*)args, - (xdrproc_t)xdr_gf1_cli_status_volume_req); -} - -ssize_t -gf_xdr_to_cli_status_volume_rsp (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_status_volume_rsp); -} - -ssize_t -gf_xdr_from_cli_status_volume_rsp (struct iovec outmsg, void *args) -{ - return xdr_serialize_generic (outmsg, (void *)args, - (xdrproc_t)xdr_gf1_cli_status_volume_rsp); -} diff --git a/rpc/xdr/src/cli1.h b/rpc/xdr/src/cli1.h deleted file mode 100644 index 9da385cbb21..00000000000 --- a/rpc/xdr/src/cli1.h +++ /dev/null @@ -1,362 +0,0 @@ -/* - Copyright (c) 2007-2011 Gluster, Inc. <http://www.gluster.com> - This file is part of GlusterFS. - - GlusterFS is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - GlusterFS is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see - <http://www.gnu.org/licenses/>. -*/ - - -#ifndef _CLI1_H -#define _CLI1_H - -#include <sys/uio.h> - -#include "cli1-xdr.h" - -enum gf_cli_defrag_type { - GF_DEFRAG_CMD_START = 1, - GF_DEFRAG_CMD_STOP, - GF_DEFRAG_CMD_STATUS, - GF_DEFRAG_CMD_START_LAYOUT_FIX, - GF_DEFRAG_CMD_START_MIGRATE_DATA, - GF_DEFRAG_CMD_START_MIGRATE_DATA_FORCE, -}; - -ssize_t -gf_xdr_serialize_cli_probe_rsp (struct iovec outmsg, void *rsp); - -ssize_t -gf_xdr_to_cli_probe_req (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_to_cli_probe_rsp (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_from_cli_probe_req (struct iovec outmsg, void *req); - -ssize_t -gf_xdr_serialize_cli_deprobe_rsp (struct iovec outmsg, void *rsp); - -ssize_t -gf_xdr_to_cli_deprobe_req (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_to_cli_deprobe_rsp (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_from_cli_deprobe_req (struct iovec outmsg, void *req); - -ssize_t -gf_xdr_serialize_cli_peer_list_rsp (struct iovec outmsg, void *rsp); - -ssize_t -gf_xdr_to_cli_peer_list_req (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_to_cli_peer_list_rsp (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_from_cli_peer_list_req (struct iovec outmsg, void *req); - -ssize_t -gf_xdr_serialize_cli_create_vol_rsp (struct iovec outmsg, void *rsp); - -ssize_t -gf_xdr_to_cli_create_vol_req (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_to_cli_create_vol_rsp (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_from_cli_create_vol_req (struct iovec outmsg, void *req); - -ssize_t -gf_xdr_serialize_cli_delete_vol_rsp (struct iovec outmsg, void *rsp); - -ssize_t -gf_xdr_to_cli_delete_vol_req (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_to_cli_delete_vol_rsp (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_from_cli_delete_vol_req (struct iovec outmsg, void *req); - -ssize_t -gf_xdr_serialize_cli_start_vol_rsp (struct iovec outmsg, void *rsp); - -ssize_t -gf_xdr_to_cli_start_vol_req (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_to_cli_start_vol_rsp (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_from_cli_start_vol_req (struct iovec outmsg, void *req); - -ssize_t -gf_xdr_serialize_cli_stop_vol_rsp (struct iovec outmsg, void *rsp); - -ssize_t -gf_xdr_to_cli_stop_vol_req (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_to_cli_stop_vol_rsp (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_from_cli_stop_vol_req (struct iovec outmsg, void *req); - -ssize_t -gf_xdr_serialize_cli_rename_vol_rsp (struct iovec outmsg, void *rsp); - -ssize_t -gf_xdr_to_cli_rename_vol_req (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_to_cli_rename_vol_rsp (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_from_cli_rename_vol_req (struct iovec outmsg, void *req); - -ssize_t -gf_xdr_serialize_cli_defrag_vol_rsp (struct iovec outmsg, void *rsp); - -ssize_t -gf_xdr_to_cli_defrag_vol_req (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_from_cli_defrag_vol_req (struct iovec outmsg, void *req); - -ssize_t -gf_xdr_to_cli_defrag_vol_rsp (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_serialize_cli_defrag_vol_rsp_v2 (struct iovec outmsg, void *rsp); - -ssize_t -gf_xdr_to_cli_defrag_vol_rsp_v2 (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_serialize_cli_add_brick_rsp (struct iovec outmsg, void *rsp); - -ssize_t -gf_xdr_to_cli_add_brick_req (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_to_cli_add_brick_rsp (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_from_cli_add_brick_req (struct iovec outmsg, void *req); - -ssize_t -gf_xdr_serialize_cli_remove_brick_rsp (struct iovec outmsg, void *rsp); - -ssize_t -gf_xdr_to_cli_remove_brick_req (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_to_cli_remove_brick_rsp (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_from_cli_remove_brick_req (struct iovec outmsg, void *req); - -ssize_t -gf_xdr_serialize_cli_replace_brick_rsp (struct iovec outmsg, void *rsp); - -ssize_t -gf_xdr_to_cli_replace_brick_req (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_to_cli_replace_brick_rsp (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_from_cli_replace_brick_req (struct iovec outmsg, void *req); - -ssize_t -gf_xdr_serialize_cli_reset_vol_rsp (struct iovec outmsg, void *rsp); - -ssize_t -gf_xdr_to_cli_reset_vol_req (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_to_cli_reset_vol_rsp (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_from_cli_reset_vol_req (struct iovec outmsg, void *req); - -ssize_t -gf_xdr_serialize_cli_gsync_set_rsp (struct iovec outmsg, void *rsp); - -ssize_t -gf_xdr_to_cli_gsync_set_req (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_to_cli_gsync_set_rsp (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_from_cli_gsync_set_req (struct iovec outmsg, void *req); - -ssize_t -gf_xdr_serialize_cli_quota_rsp (struct iovec outmsg, void *rsp); - -ssize_t -gf_xdr_to_cli_quota_req (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_to_cli_quota_rsp (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_from_cli_quota_req (struct iovec outmsg, void *req); - -ssize_t -gf_xdr_serialize_cli_set_vol_rsp (struct iovec outmsg, void *rsp); - -ssize_t -gf_xdr_to_cli_set_vol_req (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_to_cli_set_vol_rsp (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_from_cli_set_vol_req (struct iovec outmsg, void *req); - -ssize_t -gf_xdr_serialize_cli_get_vol_rsp (struct iovec outmsg, void *rsp); - -ssize_t -gf_xdr_to_cli_get_vol_req (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_to_cli_get_vol_rsp (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_from_cli_get_vol_req (struct iovec outmsg, void *req); - -ssize_t -gf_xdr_serialize_cli_log_filename_rsp (struct iovec outmsg, void *rsp); - -ssize_t -gf_xdr_to_cli_log_filename_req (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_to_cli_log_filename_rsp (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_from_cli_log_filename_req (struct iovec outmsg, void *req); - - -ssize_t -gf_xdr_serialize_cli_log_locate_rsp (struct iovec outmsg, void *rsp); - -ssize_t -gf_xdr_to_cli_log_locate_req (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_to_cli_log_locate_rsp (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_from_cli_log_locate_req (struct iovec outmsg, void *req); - -ssize_t -gf_xdr_serialize_cli_log_rotate_rsp (struct iovec outmsg, void *rsp); - -ssize_t -gf_xdr_to_cli_log_rotate_req (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_to_cli_log_rotate_rsp (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_from_cli_log_rotate_req (struct iovec outmsg, void *req); - -ssize_t -gf_xdr_to_cli_sync_volume_req (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_from_cli_sync_volume_req (struct iovec outmsg, void *args); - -ssize_t -gf_xdr_to_cli_sync_volume_rsp (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_from_cli_sync_volume_rsp (struct iovec outmsg, void *args); - -ssize_t -gf_xdr_to_cli_fsm_log_req (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_from_cli_fsm_log_req (struct iovec outmsg, void *args); - -ssize_t -gf_xdr_to_cli_fsm_log_rsp (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_from_cli_fsm_log_rsp (struct iovec outmsg, void *args); - -ssize_t -gf_xdr_to_cli_stats_volume_req (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_from_cli_stats_volume_req (struct iovec outmsg, void *args); - -ssize_t -gf_xdr_to_cli_stats_volume_rsp (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_from_cli_stats_volume_rsp (struct iovec outmsg, void *args); - -ssize_t -gf_xdr_serialize_cli_log_level_rsp (struct iovec outmsg, void *rsp); - -ssize_t -gf_xdr_to_cli_log_level_req (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_to_cli_log_level_rsp (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_from_cli_log_level_req (struct iovec outmsg, void *req); - -ssize_t -gf_xdr_serialize_cli_log_level_rsp (struct iovec outmsg, void *rsp); - -ssize_t -gf_xdr_to_cli_getwd_req (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_from_cli_getwd_req (struct iovec outmsg, void *args); - -ssize_t -gf_xdr_to_cli_getwd_rsp (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_from_cli_getwd_rsp (struct iovec outmsg, void *args); - -ssize_t -gf_xdr_serialize_cli_status_volume_rsp (struct iovec outmsg, void *rsp); - -ssize_t -gf_xdr_to_cli_status_volume_req (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_to_cli_status_volume_rsp (struct iovec inmsg, void *args); - -ssize_t -gf_xdr_from_cli_status_volume_req (struct iovec outmsg, void *req); - -ssize_t -gf_xdr_serialize_cli_status_volume_rsp (struct iovec outmsg, void *rsp); - -#endif /* !_CLI1_H */ diff --git a/rpc/xdr/src/glusterd1-xdr.c b/rpc/xdr/src/glusterd1-xdr.c index c0fc0029be4..97f84b29437 100644 --- a/rpc/xdr/src/glusterd1-xdr.c +++ b/rpc/xdr/src/glusterd1-xdr.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2010-2011 Gluster, Inc. <http://www.gluster.com> + Copyright (c) 2007-2011 Gluster, Inc. <http://www.gluster.com> This file is part of GlusterFS. GlusterFS is free software; you can redistribute it and/or modify @@ -17,17 +17,20 @@ <http://www.gnu.org/licenses/>. */ +#include "xdr-common.h" + /* * Please do not edit this file. * It was generated using rpcgen. */ #include "glusterd1-xdr.h" -#include "compat.h" bool_t xdr_glusterd_volume_status (XDR *xdrs, glusterd_volume_status *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_enum (xdrs, (enum_t *) objp)) return FALSE; @@ -37,6 +40,8 @@ xdr_glusterd_volume_status (XDR *xdrs, glusterd_volume_status *objp) bool_t xdr_gd1_mgmt_probe_req (XDR *xdrs, gd1_mgmt_probe_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_vector (xdrs, (char *)objp->uuid, 16, sizeof (u_char), (xdrproc_t) xdr_u_char)) @@ -51,6 +56,8 @@ xdr_gd1_mgmt_probe_req (XDR *xdrs, gd1_mgmt_probe_req *objp) bool_t xdr_gd1_mgmt_probe_rsp (XDR *xdrs, gd1_mgmt_probe_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_vector (xdrs, (char *)objp->uuid, 16, sizeof (u_char), (xdrproc_t) xdr_u_char)) @@ -69,6 +76,8 @@ xdr_gd1_mgmt_probe_rsp (XDR *xdrs, gd1_mgmt_probe_rsp *objp) bool_t xdr_gd1_mgmt_friend_req (XDR *xdrs, gd1_mgmt_friend_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_vector (xdrs, (char *)objp->uuid, 16, sizeof (u_char), (xdrproc_t) xdr_u_char)) @@ -85,6 +94,8 @@ xdr_gd1_mgmt_friend_req (XDR *xdrs, gd1_mgmt_friend_req *objp) bool_t xdr_gd1_mgmt_friend_rsp (XDR *xdrs, gd1_mgmt_friend_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_vector (xdrs, (char *)objp->uuid, 16, sizeof (u_char), (xdrproc_t) xdr_u_char)) @@ -103,6 +114,8 @@ xdr_gd1_mgmt_friend_rsp (XDR *xdrs, gd1_mgmt_friend_rsp *objp) bool_t xdr_gd1_mgmt_unfriend_req (XDR *xdrs, gd1_mgmt_unfriend_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_vector (xdrs, (char *)objp->uuid, 16, sizeof (u_char), (xdrproc_t) xdr_u_char)) @@ -117,6 +130,8 @@ xdr_gd1_mgmt_unfriend_req (XDR *xdrs, gd1_mgmt_unfriend_req *objp) bool_t xdr_gd1_mgmt_unfriend_rsp (XDR *xdrs, gd1_mgmt_unfriend_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_vector (xdrs, (char *)objp->uuid, 16, sizeof (u_char), (xdrproc_t) xdr_u_char)) @@ -135,6 +150,8 @@ xdr_gd1_mgmt_unfriend_rsp (XDR *xdrs, gd1_mgmt_unfriend_rsp *objp) bool_t xdr_gd1_mgmt_cluster_lock_req (XDR *xdrs, gd1_mgmt_cluster_lock_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_vector (xdrs, (char *)objp->uuid, 16, sizeof (u_char), (xdrproc_t) xdr_u_char)) @@ -145,6 +162,8 @@ xdr_gd1_mgmt_cluster_lock_req (XDR *xdrs, gd1_mgmt_cluster_lock_req *objp) bool_t xdr_gd1_mgmt_cluster_lock_rsp (XDR *xdrs, gd1_mgmt_cluster_lock_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_vector (xdrs, (char *)objp->uuid, 16, sizeof (u_char), (xdrproc_t) xdr_u_char)) @@ -159,6 +178,8 @@ xdr_gd1_mgmt_cluster_lock_rsp (XDR *xdrs, gd1_mgmt_cluster_lock_rsp *objp) bool_t xdr_gd1_mgmt_cluster_unlock_req (XDR *xdrs, gd1_mgmt_cluster_unlock_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_vector (xdrs, (char *)objp->uuid, 16, sizeof (u_char), (xdrproc_t) xdr_u_char)) @@ -169,6 +190,8 @@ xdr_gd1_mgmt_cluster_unlock_req (XDR *xdrs, gd1_mgmt_cluster_unlock_req *objp) bool_t xdr_gd1_mgmt_cluster_unlock_rsp (XDR *xdrs, gd1_mgmt_cluster_unlock_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_vector (xdrs, (char *)objp->uuid, 16, sizeof (u_char), (xdrproc_t) xdr_u_char)) @@ -183,6 +206,8 @@ xdr_gd1_mgmt_cluster_unlock_rsp (XDR *xdrs, gd1_mgmt_cluster_unlock_rsp *objp) bool_t xdr_gd1_mgmt_stage_op_req (XDR *xdrs, gd1_mgmt_stage_op_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_vector (xdrs, (char *)objp->uuid, 16, sizeof (u_char), (xdrproc_t) xdr_u_char)) @@ -197,8 +222,9 @@ xdr_gd1_mgmt_stage_op_req (XDR *xdrs, gd1_mgmt_stage_op_req *objp) bool_t xdr_gd1_mgmt_stage_op_rsp (XDR *xdrs, gd1_mgmt_stage_op_rsp *objp) { + register int32_t *buf; + buf = NULL; - register int32_t *buf; if (xdrs->x_op == XDR_ENCODE) { if (!xdr_vector (xdrs, (char *)objp->uuid, 16, @@ -267,6 +293,8 @@ xdr_gd1_mgmt_stage_op_rsp (XDR *xdrs, gd1_mgmt_stage_op_rsp *objp) bool_t xdr_gd1_mgmt_commit_op_req (XDR *xdrs, gd1_mgmt_commit_op_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_vector (xdrs, (char *)objp->uuid, 16, sizeof (u_char), (xdrproc_t) xdr_u_char)) @@ -282,6 +310,7 @@ bool_t xdr_gd1_mgmt_commit_op_rsp (XDR *xdrs, gd1_mgmt_commit_op_rsp *objp) { register int32_t *buf; + buf = NULL; if (xdrs->x_op == XDR_ENCODE) { @@ -351,6 +380,8 @@ xdr_gd1_mgmt_commit_op_rsp (XDR *xdrs, gd1_mgmt_commit_op_rsp *objp) bool_t xdr_gd1_mgmt_friend_update (XDR *xdrs, gd1_mgmt_friend_update *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_vector (xdrs, (char *)objp->uuid, 16, sizeof (u_char), (xdrproc_t) xdr_u_char)) @@ -365,6 +396,8 @@ xdr_gd1_mgmt_friend_update (XDR *xdrs, gd1_mgmt_friend_update *objp) bool_t xdr_gd1_mgmt_friend_update_rsp (XDR *xdrs, gd1_mgmt_friend_update_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_vector (xdrs, (char *)objp->uuid, 16, sizeof (u_char), (xdrproc_t) xdr_u_char)) @@ -381,6 +414,8 @@ xdr_gd1_mgmt_friend_update_rsp (XDR *xdrs, gd1_mgmt_friend_update_rsp *objp) bool_t xdr_gd1_mgmt_brick_op_req (XDR *xdrs, gd1_mgmt_brick_op_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_string (xdrs, &objp->name, ~0)) return FALSE; @@ -394,6 +429,8 @@ xdr_gd1_mgmt_brick_op_req (XDR *xdrs, gd1_mgmt_brick_op_req *objp) bool_t xdr_gd1_mgmt_brick_op_rsp (XDR *xdrs, gd1_mgmt_brick_op_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; diff --git a/rpc/xdr/src/glusterd1-xdr.h b/rpc/xdr/src/glusterd1-xdr.h index 12c625b8d62..bf8761e83fa 100644 --- a/rpc/xdr/src/glusterd1-xdr.h +++ b/rpc/xdr/src/glusterd1-xdr.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2010-2011 Gluster, Inc. <http://www.gluster.com> + Copyright (c) 2007-2011 Gluster, Inc. <http://www.gluster.com> This file is part of GlusterFS. GlusterFS is free software; you can redistribute it and/or modify @@ -17,6 +17,7 @@ <http://www.gnu.org/licenses/>. */ +#include "xdr-common.h" /* * Please do not edit this file. @@ -252,4 +253,4 @@ extern bool_t xdr_gd1_mgmt_brick_op_rsp (); } #endif -#endif /* !_GLUSTERD1-XDR_H_RPCGEN */ +#endif /* !_GLUSTERD1_XDR_H_RPCGEN */ diff --git a/rpc/xdr/src/glusterd1.c b/rpc/xdr/src/glusterd1.c deleted file mode 100644 index 22b5c838602..00000000000 --- a/rpc/xdr/src/glusterd1.c +++ /dev/null @@ -1,262 +0,0 @@ -/* - Copyright (c) 2007-2011 Gluster, Inc. <http://www.gluster.com> - This file is part of GlusterFS. - - GlusterFS is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - GlusterFS is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see - <http://www.gnu.org/licenses/>. -*/ - - -#include "glusterd1.h" - - -ssize_t -gd_xdr_serialize_mgmt_probe_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gd1_mgmt_probe_rsp); - -} - -ssize_t -gd_xdr_serialize_mgmt_friend_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gd1_mgmt_friend_rsp); - -} - -ssize_t -gd_xdr_serialize_mgmt_cluster_lock_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gd1_mgmt_cluster_lock_rsp); - -} - -ssize_t -gd_xdr_serialize_mgmt_cluster_unlock_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gd1_mgmt_cluster_unlock_rsp); - -} - -ssize_t -gd_xdr_serialize_mgmt_stage_op_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gd1_mgmt_stage_op_rsp); - -} - -ssize_t -gd_xdr_serialize_mgmt_commit_op_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gd1_mgmt_commit_op_rsp); - -} - -ssize_t -gd_xdr_serialize_mgmt_friend_update_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gd1_mgmt_friend_update_rsp); - -} -/* Decode */ - - -ssize_t -gd_xdr_to_mgmt_probe_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gd1_mgmt_probe_req); -} - -ssize_t -gd_xdr_to_mgmt_friend_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gd1_mgmt_friend_req); -} - -ssize_t -gd_xdr_to_mgmt_friend_update (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gd1_mgmt_friend_update); -} - -ssize_t -gd_xdr_to_mgmt_cluster_lock_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gd1_mgmt_cluster_lock_req); -} - -ssize_t -gd_xdr_to_mgmt_cluster_unlock_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gd1_mgmt_cluster_unlock_req); -} - -ssize_t -gd_xdr_to_mgmt_stage_op_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gd1_mgmt_stage_op_req); -} - - -ssize_t -gd_xdr_to_mgmt_commit_op_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gd1_mgmt_commit_op_req); -} - -ssize_t -gd_xdr_to_mgmt_probe_rsp (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gd1_mgmt_probe_rsp); -} - -ssize_t -gd_xdr_to_mgmt_friend_rsp (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gd1_mgmt_friend_rsp); -} - -ssize_t -gd_xdr_to_mgmt_cluster_lock_rsp (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gd1_mgmt_cluster_lock_rsp); -} - -ssize_t -gd_xdr_to_mgmt_cluster_unlock_rsp (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gd1_mgmt_cluster_unlock_rsp); -} - -ssize_t -gd_xdr_to_mgmt_stage_op_rsp (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gd1_mgmt_stage_op_rsp); -} - -ssize_t -gd_xdr_to_mgmt_commit_op_rsp (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gd1_mgmt_commit_op_rsp); -} - -ssize_t -gd_xdr_to_mgmt_friend_update_rsp (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gd1_mgmt_friend_update_rsp); -} - -ssize_t -gd_xdr_from_mgmt_probe_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gd1_mgmt_probe_req); - -} - -ssize_t -gd_xdr_from_mgmt_friend_update (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gd1_mgmt_friend_update); - -} - -ssize_t -gd_xdr_from_mgmt_friend_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gd1_mgmt_friend_req); - -} - -ssize_t -gd_xdr_from_mgmt_cluster_lock_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gd1_mgmt_cluster_lock_req); - -} - -ssize_t -gd_xdr_from_mgmt_cluster_unlock_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gd1_mgmt_cluster_unlock_req); - -} - -ssize_t -gd_xdr_from_mgmt_stage_op_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gd1_mgmt_stage_op_req); -} - - -ssize_t -gd_xdr_from_mgmt_commit_op_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gd1_mgmt_commit_op_req); -} - -ssize_t -gd_xdr_to_mgmt_brick_op_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gd1_mgmt_brick_op_req); -} - -ssize_t -gd_xdr_from_mgmt_brick_op_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gd1_mgmt_brick_op_req); -} - -ssize_t -gd_xdr_to_mgmt_brick_op_rsp (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gd1_mgmt_brick_op_rsp); -} - -ssize_t -gd_xdr_serialize_mgmt_brick_op_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gd1_mgmt_brick_op_rsp); -} diff --git a/rpc/xdr/src/glusterd1.h b/rpc/xdr/src/glusterd1.h deleted file mode 100644 index 1bc5b0c3adb..00000000000 --- a/rpc/xdr/src/glusterd1.h +++ /dev/null @@ -1,125 +0,0 @@ -/* - Copyright (c) 2007-2011 Gluster, Inc. <http://www.gluster.com> - This file is part of GlusterFS. - - GlusterFS is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - GlusterFS is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see - <http://www.gnu.org/licenses/>. -*/ - - -#ifndef _GLUSTERD1_H -#define _GLUSTERD1_H - -#include <sys/uio.h> - -#include "xdr-generic.h" -#include "glusterd1-xdr.h" - -ssize_t -gd_xdr_to_mgmt_probe_req (struct iovec inmsg, void *args); - -ssize_t -gd_xdr_to_mgmt_probe_rsp (struct iovec inmsg, void *args); - -ssize_t -gd_xdr_serialize_mgmt_probe_rsp (struct iovec outmsg, void *rsp); - -ssize_t -gd_xdr_from_mgmt_probe_req (struct iovec outmsg, void *req); - -ssize_t -gd_xdr_to_mgmt_friend_req (struct iovec inmsg, void *args); - -ssize_t -gd_xdr_to_mgmt_friend_rsp (struct iovec inmsg, void *args); - -ssize_t -gd_xdr_serialize_mgmt_friend_rsp (struct iovec outmsg, void *rsp); - -ssize_t -gd_xdr_from_mgmt_friend_req (struct iovec outmsg, void *req); - -ssize_t -gd_xdr_to_mgmt_cluster_lock_req (struct iovec inmsg, void *args); - -ssize_t -gd_xdr_to_mgmt_cluster_lock_rsp (struct iovec inmsg, void *args); - -ssize_t -gd_xdr_serialize_mgmt_cluster_lock_rsp (struct iovec outmsg, void *rsp); - -ssize_t -gd_xdr_from_mgmt_cluster_lock_req (struct iovec outmsg, void *req); - -ssize_t -gd_xdr_to_mgmt_cluster_unlock_req (struct iovec inmsg, void *args); - -ssize_t -gd_xdr_to_mgmt_cluster_unlock_rsp (struct iovec inmsg, void *args); - -ssize_t -gd_xdr_serialize_mgmt_cluster_unlock_rsp (struct iovec outmsg, void *rsp); - -ssize_t -gd_xdr_from_mgmt_cluster_unlock_req (struct iovec outmsg, void *req); - -ssize_t -gd_xdr_to_mgmt_stage_op_req (struct iovec inmsg, void *args); - -ssize_t -gd_xdr_to_mgmt_stage_op_rsp (struct iovec inmsg, void *args); - -ssize_t -gd_xdr_serialize_mgmt_stage_op_rsp (struct iovec outmsg, void *rsp); - -ssize_t -gd_xdr_from_mgmt_stage_op_req (struct iovec outmsg, void *req); - -ssize_t -gd_xdr_to_mgmt_commit_op_req (struct iovec inmsg, void *args); - -ssize_t -gd_xdr_to_mgmt_commit_op_rsp (struct iovec inmsg, void *args); - -ssize_t -gd_xdr_serialize_mgmt_commit_op_rsp (struct iovec outmsg, void *rsp); - -ssize_t -gd_xdr_from_mgmt_commit_op_req (struct iovec outmsg, void *req); - -ssize_t -gd_xdr_to_mgmt_friend_update (struct iovec outmsg, void *req); - -ssize_t -gd_xdr_from_mgmt_friend_update (struct iovec outmsg, void *req); - -ssize_t -gd_xdr_serialize_mgmt_friend_update_rsp (struct iovec outmsg, void *rsp); - -ssize_t -gd_xdr_to_mgmt_friend_update_rsp (struct iovec inmsg, void *args); - -ssize_t -gd_xdr_to_mgmt_brick_op_req (struct iovec inmsg, void *args); - -ssize_t -gd_xdr_from_mgmt_brick_op_req (struct iovec outmsg, void *req); - -ssize_t -gd_xdr_to_mgmt_brick_op_rsp (struct iovec inmsg, void *args); - -ssize_t -gd_xdr_serialize_mgmt_brick_op_rsp (struct iovec outmsg, void *rsp); - -#endif /* !_MSG_GD_XDR_H */ diff --git a/rpc/xdr/src/glusterfs3-xdr.c b/rpc/xdr/src/glusterfs3-xdr.c index cc43f22cf95..83a2bf9e07d 100644 --- a/rpc/xdr/src/glusterfs3-xdr.c +++ b/rpc/xdr/src/glusterfs3-xdr.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2010-2011 Gluster, Inc. <http://www.gluster.com> + Copyright (c) 2007-2011 Gluster, Inc. <http://www.gluster.com> This file is part of GlusterFS. GlusterFS is free software; you can redistribute it and/or modify @@ -17,6 +17,7 @@ <http://www.gnu.org/licenses/>. */ +#include "xdr-common.h" /* * Please do not edit this file. @@ -24,11 +25,12 @@ */ #include "glusterfs3-xdr.h" -#include "compat.h" bool_t xdr_gf_statfs (XDR *xdrs, gf_statfs *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_u_quad_t (xdrs, &objp->bsize)) return FALSE; @@ -58,6 +60,8 @@ xdr_gf_statfs (XDR *xdrs, gf_statfs *objp) bool_t xdr_gf_proto_flock (XDR *xdrs, gf_proto_flock *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_u_int (xdrs, &objp->type)) return FALSE; @@ -78,6 +82,8 @@ bool_t xdr_gf_iatt (XDR *xdrs, gf_iatt *objp) { register int32_t *buf; + buf = NULL; + if (xdrs->x_op == XDR_ENCODE) { if (!xdr_opaque (xdrs, objp->ia_gfid, 16)) @@ -136,7 +142,7 @@ xdr_gf_iatt (XDR *xdrs, gf_iatt *objp) return TRUE; } else if (xdrs->x_op == XDR_DECODE) { if (!xdr_opaque (xdrs, objp->ia_gfid, 16)) - return FALSE; + return FALSE; if (!xdr_u_quad_t (xdrs, &objp->ia_ino)) return FALSE; if (!xdr_u_quad_t (xdrs, &objp->ia_dev)) @@ -191,7 +197,7 @@ xdr_gf_iatt (XDR *xdrs, gf_iatt *objp) return TRUE; } - if (!xdr_opaque (xdrs, objp->ia_gfid, 16)) + if (!xdr_opaque (xdrs, objp->ia_gfid, 16)) return FALSE; if (!xdr_u_quad_t (xdrs, &objp->ia_ino)) return FALSE; @@ -231,6 +237,8 @@ xdr_gf_iatt (XDR *xdrs, gf_iatt *objp) bool_t xdr_gfs3_stat_req (XDR *xdrs, gfs3_stat_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_opaque (xdrs, objp->gfid, 16)) return FALSE; @@ -242,6 +250,8 @@ xdr_gfs3_stat_req (XDR *xdrs, gfs3_stat_req *objp) bool_t xdr_gfs3_stat_rsp (XDR *xdrs, gfs3_stat_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -255,9 +265,11 @@ xdr_gfs3_stat_rsp (XDR *xdrs, gfs3_stat_rsp *objp) bool_t xdr_gfs3_readlink_req (XDR *xdrs, gfs3_readlink_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_opaque (xdrs, objp->gfid, 16)) - return FALSE; + return FALSE; if (!xdr_u_int (xdrs, &objp->size)) return FALSE; if (!xdr_string (xdrs, &objp->path, ~0)) @@ -268,6 +280,8 @@ xdr_gfs3_readlink_req (XDR *xdrs, gfs3_readlink_req *objp) bool_t xdr_gfs3_readlink_rsp (XDR *xdrs, gfs3_readlink_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -283,9 +297,11 @@ xdr_gfs3_readlink_rsp (XDR *xdrs, gfs3_readlink_rsp *objp) bool_t xdr_gfs3_mknod_req (XDR *xdrs, gfs3_mknod_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_opaque (xdrs, objp->pargfid, 16)) - return FALSE; + return FALSE; if (!xdr_u_quad_t (xdrs, &objp->dev)) return FALSE; if (!xdr_u_int (xdrs, &objp->mode)) @@ -294,8 +310,7 @@ xdr_gfs3_mknod_req (XDR *xdrs, gfs3_mknod_req *objp) return FALSE; if (!xdr_string (xdrs, &objp->bname, ~0)) return FALSE; - if (!xdr_bytes (xdrs, (char **)&objp->dict.dict_val, - (u_int *) &objp->dict.dict_len, ~0)) + if (!xdr_bytes (xdrs, (char **)&objp->dict.dict_val, (u_int *) &objp->dict.dict_len, ~0)) return FALSE; return TRUE; } @@ -303,6 +318,8 @@ xdr_gfs3_mknod_req (XDR *xdrs, gfs3_mknod_req *objp) bool_t xdr_gfs3_mknod_rsp (XDR *xdrs, gfs3_mknod_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -320,17 +337,18 @@ xdr_gfs3_mknod_rsp (XDR *xdrs, gfs3_mknod_rsp *objp) bool_t xdr_gfs3_mkdir_req (XDR *xdrs, gfs3_mkdir_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_opaque (xdrs, objp->pargfid, 16)) - return FALSE; + return FALSE; if (!xdr_u_int (xdrs, &objp->mode)) return FALSE; if (!xdr_string (xdrs, &objp->path, ~0)) return FALSE; if (!xdr_string (xdrs, &objp->bname, ~0)) return FALSE; - if (!xdr_bytes (xdrs, (char **)&objp->dict.dict_val, - (u_int *) &objp->dict.dict_len, ~0)) + if (!xdr_bytes (xdrs, (char **)&objp->dict.dict_val, (u_int *) &objp->dict.dict_len, ~0)) return FALSE; return TRUE; } @@ -338,6 +356,8 @@ xdr_gfs3_mkdir_req (XDR *xdrs, gfs3_mkdir_req *objp) bool_t xdr_gfs3_mkdir_rsp (XDR *xdrs, gfs3_mkdir_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -355,9 +375,11 @@ xdr_gfs3_mkdir_rsp (XDR *xdrs, gfs3_mkdir_rsp *objp) bool_t xdr_gfs3_unlink_req (XDR *xdrs, gfs3_unlink_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_opaque (xdrs, objp->pargfid, 16)) - return FALSE; + return FALSE; if (!xdr_string (xdrs, &objp->path, ~0)) return FALSE; if (!xdr_string (xdrs, &objp->bname, ~0)) @@ -368,6 +390,8 @@ xdr_gfs3_unlink_req (XDR *xdrs, gfs3_unlink_req *objp) bool_t xdr_gfs3_unlink_rsp (XDR *xdrs, gfs3_unlink_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -383,11 +407,13 @@ xdr_gfs3_unlink_rsp (XDR *xdrs, gfs3_unlink_rsp *objp) bool_t xdr_gfs3_rmdir_req (XDR *xdrs, gfs3_rmdir_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_opaque (xdrs, objp->pargfid, 16)) - return FALSE; - if (!xdr_int (xdrs, &objp->flags)) - return FALSE; + return FALSE; + if (!xdr_int (xdrs, &objp->flags)) + return FALSE; if (!xdr_string (xdrs, &objp->path, ~0)) return FALSE; if (!xdr_string (xdrs, &objp->bname, ~0)) @@ -398,6 +424,8 @@ xdr_gfs3_rmdir_req (XDR *xdrs, gfs3_rmdir_req *objp) bool_t xdr_gfs3_rmdir_rsp (XDR *xdrs, gfs3_rmdir_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -413,17 +441,18 @@ xdr_gfs3_rmdir_rsp (XDR *xdrs, gfs3_rmdir_rsp *objp) bool_t xdr_gfs3_symlink_req (XDR *xdrs, gfs3_symlink_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_opaque (xdrs, objp->pargfid, 16)) - return FALSE; + return FALSE; if (!xdr_string (xdrs, &objp->path, ~0)) return FALSE; if (!xdr_string (xdrs, &objp->bname, ~0)) return FALSE; if (!xdr_string (xdrs, &objp->linkname, ~0)) return FALSE; - if (!xdr_bytes (xdrs, (char **)&objp->dict.dict_val, - (u_int *) &objp->dict.dict_len, ~0)) + if (!xdr_bytes (xdrs, (char **)&objp->dict.dict_val, (u_int *) &objp->dict.dict_len, ~0)) return FALSE; return TRUE; } @@ -431,6 +460,8 @@ xdr_gfs3_symlink_req (XDR *xdrs, gfs3_symlink_req *objp) bool_t xdr_gfs3_symlink_rsp (XDR *xdrs, gfs3_symlink_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -448,11 +479,13 @@ xdr_gfs3_symlink_rsp (XDR *xdrs, gfs3_symlink_rsp *objp) bool_t xdr_gfs3_rename_req (XDR *xdrs, gfs3_rename_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_opaque (xdrs, objp->oldgfid, 16)) - return FALSE; + return FALSE; if (!xdr_opaque (xdrs, objp->newgfid, 16)) - return FALSE; + return FALSE; if (!xdr_string (xdrs, &objp->oldpath, ~0)) return FALSE; if (!xdr_string (xdrs, &objp->oldbname, ~0)) @@ -467,6 +500,8 @@ xdr_gfs3_rename_req (XDR *xdrs, gfs3_rename_req *objp) bool_t xdr_gfs3_rename_rsp (XDR *xdrs, gfs3_rename_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -488,11 +523,13 @@ xdr_gfs3_rename_rsp (XDR *xdrs, gfs3_rename_rsp *objp) bool_t xdr_gfs3_link_req (XDR *xdrs, gfs3_link_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_opaque (xdrs, objp->oldgfid, 16)) - return FALSE; + return FALSE; if (!xdr_opaque (xdrs, objp->newgfid, 16)) - return FALSE; + return FALSE; if (!xdr_string (xdrs, &objp->oldpath, ~0)) return FALSE; if (!xdr_string (xdrs, &objp->newpath, ~0)) @@ -505,6 +542,8 @@ xdr_gfs3_link_req (XDR *xdrs, gfs3_link_req *objp) bool_t xdr_gfs3_link_rsp (XDR *xdrs, gfs3_link_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -522,6 +561,8 @@ xdr_gfs3_link_rsp (XDR *xdrs, gfs3_link_rsp *objp) bool_t xdr_gfs3_truncate_req (XDR *xdrs, gfs3_truncate_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_opaque (xdrs, objp->gfid, 16)) return FALSE; @@ -535,6 +576,8 @@ xdr_gfs3_truncate_req (XDR *xdrs, gfs3_truncate_req *objp) bool_t xdr_gfs3_truncate_rsp (XDR *xdrs, gfs3_truncate_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -550,6 +593,8 @@ xdr_gfs3_truncate_rsp (XDR *xdrs, gfs3_truncate_rsp *objp) bool_t xdr_gfs3_open_req (XDR *xdrs, gfs3_open_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_opaque (xdrs, objp->gfid, 16)) return FALSE; @@ -565,6 +610,8 @@ xdr_gfs3_open_req (XDR *xdrs, gfs3_open_req *objp) bool_t xdr_gfs3_open_rsp (XDR *xdrs, gfs3_open_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -578,6 +625,8 @@ xdr_gfs3_open_rsp (XDR *xdrs, gfs3_open_rsp *objp) bool_t xdr_gfs3_read_req (XDR *xdrs, gfs3_read_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_opaque (xdrs, objp->gfid, 16)) return FALSE; @@ -593,6 +642,8 @@ xdr_gfs3_read_req (XDR *xdrs, gfs3_read_req *objp) bool_t xdr_gfs3_read_rsp (XDR *xdrs, gfs3_read_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -602,26 +653,26 @@ xdr_gfs3_read_rsp (XDR *xdrs, gfs3_read_rsp *objp) return FALSE; if (!xdr_u_int (xdrs, &objp->size)) return FALSE; - - return TRUE; + return TRUE; } bool_t xdr_gfs3_lookup_req (XDR *xdrs, gfs3_lookup_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_opaque (xdrs, objp->gfid, 16)) return FALSE; if (!xdr_opaque (xdrs, objp->pargfid, 16)) - return FALSE; + return FALSE; if (!xdr_u_int (xdrs, &objp->flags)) return FALSE; if (!xdr_string (xdrs, &objp->path, ~0)) return FALSE; if (!xdr_string (xdrs, &objp->bname, ~0)) return FALSE; - if (!xdr_bytes (xdrs, (char **)&objp->dict.dict_val, - (u_int *) &objp->dict.dict_len, ~0)) + if (!xdr_bytes (xdrs, (char **)&objp->dict.dict_val, (u_int *) &objp->dict.dict_len, ~0)) return FALSE; return TRUE; } @@ -629,6 +680,8 @@ xdr_gfs3_lookup_req (XDR *xdrs, gfs3_lookup_req *objp) bool_t xdr_gfs3_lookup_rsp (XDR *xdrs, gfs3_lookup_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -638,8 +691,7 @@ xdr_gfs3_lookup_rsp (XDR *xdrs, gfs3_lookup_rsp *objp) return FALSE; if (!xdr_gf_iatt (xdrs, &objp->postparent)) return FALSE; - if (!xdr_bytes (xdrs, (char **)&objp->dict.dict_val, - (u_int *) &objp->dict.dict_len, ~0)) + if (!xdr_bytes (xdrs, (char **)&objp->dict.dict_val, (u_int *) &objp->dict.dict_len, ~0)) return FALSE; return TRUE; } @@ -647,6 +699,8 @@ xdr_gfs3_lookup_rsp (XDR *xdrs, gfs3_lookup_rsp *objp) bool_t xdr_gfs3_write_req (XDR *xdrs, gfs3_write_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_opaque (xdrs, objp->gfid, 16)) return FALSE; @@ -662,6 +716,8 @@ xdr_gfs3_write_req (XDR *xdrs, gfs3_write_req *objp) bool_t xdr_gfs3_write_rsp (XDR *xdrs, gfs3_write_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -677,6 +733,8 @@ xdr_gfs3_write_rsp (XDR *xdrs, gfs3_write_rsp *objp) bool_t xdr_gfs3_statfs_req (XDR *xdrs, gfs3_statfs_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_opaque (xdrs, objp->gfid, 16)) return FALSE; @@ -688,6 +746,8 @@ xdr_gfs3_statfs_req (XDR *xdrs, gfs3_statfs_req *objp) bool_t xdr_gfs3_statfs_rsp (XDR *xdrs, gfs3_statfs_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -701,6 +761,8 @@ xdr_gfs3_statfs_rsp (XDR *xdrs, gfs3_statfs_rsp *objp) bool_t xdr_gfs3_lk_req (XDR *xdrs, gfs3_lk_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_opaque (xdrs, objp->gfid, 16)) return FALSE; @@ -718,6 +780,8 @@ xdr_gfs3_lk_req (XDR *xdrs, gfs3_lk_req *objp) bool_t xdr_gfs3_lk_rsp (XDR *xdrs, gfs3_lk_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -731,6 +795,8 @@ xdr_gfs3_lk_rsp (XDR *xdrs, gfs3_lk_rsp *objp) bool_t xdr_gfs3_inodelk_req (XDR *xdrs, gfs3_inodelk_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_opaque (xdrs, objp->gfid, 16)) return FALSE; @@ -750,6 +816,8 @@ xdr_gfs3_inodelk_req (XDR *xdrs, gfs3_inodelk_req *objp) bool_t xdr_gfs3_finodelk_req (XDR *xdrs, gfs3_finodelk_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_opaque (xdrs, objp->gfid, 16)) return FALSE; @@ -769,6 +837,8 @@ xdr_gfs3_finodelk_req (XDR *xdrs, gfs3_finodelk_req *objp) bool_t xdr_gfs3_flush_req (XDR *xdrs, gfs3_flush_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_opaque (xdrs, objp->gfid, 16)) return FALSE; @@ -780,6 +850,8 @@ xdr_gfs3_flush_req (XDR *xdrs, gfs3_flush_req *objp) bool_t xdr_gfs3_fsync_req (XDR *xdrs, gfs3_fsync_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_opaque (xdrs, objp->gfid, 16)) return FALSE; @@ -793,6 +865,8 @@ xdr_gfs3_fsync_req (XDR *xdrs, gfs3_fsync_req *objp) bool_t xdr_gfs3_fsync_rsp (XDR *xdrs, gfs3_fsync_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -808,6 +882,8 @@ xdr_gfs3_fsync_rsp (XDR *xdrs, gfs3_fsync_rsp *objp) bool_t xdr_gfs3_setxattr_req (XDR *xdrs, gfs3_setxattr_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_opaque (xdrs, objp->gfid, 16)) return FALSE; @@ -823,6 +899,8 @@ xdr_gfs3_setxattr_req (XDR *xdrs, gfs3_setxattr_req *objp) bool_t xdr_gfs3_fsetxattr_req (XDR *xdrs, gfs3_fsetxattr_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_opaque (xdrs, objp->gfid, 16)) return FALSE; @@ -838,6 +916,8 @@ xdr_gfs3_fsetxattr_req (XDR *xdrs, gfs3_fsetxattr_req *objp) bool_t xdr_gfs3_xattrop_req (XDR *xdrs, gfs3_xattrop_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_opaque (xdrs, objp->gfid, 16)) return FALSE; @@ -853,6 +933,8 @@ xdr_gfs3_xattrop_req (XDR *xdrs, gfs3_xattrop_req *objp) bool_t xdr_gfs3_xattrop_rsp (XDR *xdrs, gfs3_xattrop_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -866,6 +948,8 @@ xdr_gfs3_xattrop_rsp (XDR *xdrs, gfs3_xattrop_rsp *objp) bool_t xdr_gfs3_fxattrop_req (XDR *xdrs, gfs3_fxattrop_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_opaque (xdrs, objp->gfid, 16)) return FALSE; @@ -881,6 +965,8 @@ xdr_gfs3_fxattrop_req (XDR *xdrs, gfs3_fxattrop_req *objp) bool_t xdr_gfs3_fxattrop_rsp (XDR *xdrs, gfs3_fxattrop_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -894,6 +980,8 @@ xdr_gfs3_fxattrop_rsp (XDR *xdrs, gfs3_fxattrop_rsp *objp) bool_t xdr_gfs3_getxattr_req (XDR *xdrs, gfs3_getxattr_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_opaque (xdrs, objp->gfid, 16)) return FALSE; @@ -909,6 +997,8 @@ xdr_gfs3_getxattr_req (XDR *xdrs, gfs3_getxattr_req *objp) bool_t xdr_gfs3_getxattr_rsp (XDR *xdrs, gfs3_getxattr_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -922,6 +1012,8 @@ xdr_gfs3_getxattr_rsp (XDR *xdrs, gfs3_getxattr_rsp *objp) bool_t xdr_gfs3_fgetxattr_req (XDR *xdrs, gfs3_fgetxattr_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_opaque (xdrs, objp->gfid, 16)) return FALSE; @@ -937,6 +1029,8 @@ xdr_gfs3_fgetxattr_req (XDR *xdrs, gfs3_fgetxattr_req *objp) bool_t xdr_gfs3_fgetxattr_rsp (XDR *xdrs, gfs3_fgetxattr_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -950,6 +1044,8 @@ xdr_gfs3_fgetxattr_rsp (XDR *xdrs, gfs3_fgetxattr_rsp *objp) bool_t xdr_gfs3_removexattr_req (XDR *xdrs, gfs3_removexattr_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_opaque (xdrs, objp->gfid, 16)) return FALSE; @@ -963,6 +1059,8 @@ xdr_gfs3_removexattr_req (XDR *xdrs, gfs3_removexattr_req *objp) bool_t xdr_gfs3_opendir_req (XDR *xdrs, gfs3_opendir_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_opaque (xdrs, objp->gfid, 16)) return FALSE; @@ -974,6 +1072,8 @@ xdr_gfs3_opendir_req (XDR *xdrs, gfs3_opendir_req *objp) bool_t xdr_gfs3_opendir_rsp (XDR *xdrs, gfs3_opendir_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -987,6 +1087,8 @@ xdr_gfs3_opendir_rsp (XDR *xdrs, gfs3_opendir_rsp *objp) bool_t xdr_gfs3_fsyncdir_req (XDR *xdrs, gfs3_fsyncdir_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_opaque (xdrs, objp->gfid, 16)) return FALSE; @@ -1000,6 +1102,8 @@ xdr_gfs3_fsyncdir_req (XDR *xdrs, gfs3_fsyncdir_req *objp) bool_t xdr_gfs3_readdir_req (XDR *xdrs, gfs3_readdir_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_opaque (xdrs, objp->gfid, 16)) return FALSE; @@ -1015,6 +1119,8 @@ xdr_gfs3_readdir_req (XDR *xdrs, gfs3_readdir_req *objp) bool_t xdr_gfs3_readdirp_req (XDR *xdrs, gfs3_readdirp_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_opaque (xdrs, objp->gfid, 16)) return FALSE; @@ -1030,6 +1136,8 @@ xdr_gfs3_readdirp_req (XDR *xdrs, gfs3_readdirp_req *objp) bool_t xdr_gf_setvolume_req (XDR *xdrs, gf_setvolume_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_bytes (xdrs, (char **)&objp->dict.dict_val, (u_int *) &objp->dict.dict_len, ~0)) return FALSE; @@ -1039,6 +1147,8 @@ xdr_gf_setvolume_req (XDR *xdrs, gf_setvolume_req *objp) bool_t xdr_gf_setvolume_rsp (XDR *xdrs, gf_setvolume_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -1052,6 +1162,8 @@ xdr_gf_setvolume_rsp (XDR *xdrs, gf_setvolume_rsp *objp) bool_t xdr_gfs3_access_req (XDR *xdrs, gfs3_access_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_opaque (xdrs, objp->gfid, 16)) return FALSE; @@ -1065,9 +1177,11 @@ xdr_gfs3_access_req (XDR *xdrs, gfs3_access_req *objp) bool_t xdr_gfs3_create_req (XDR *xdrs, gfs3_create_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_opaque (xdrs, objp->pargfid, 16)) - return FALSE; + return FALSE; if (!xdr_u_int (xdrs, &objp->flags)) return FALSE; if (!xdr_u_int (xdrs, &objp->mode)) @@ -1076,8 +1190,7 @@ xdr_gfs3_create_req (XDR *xdrs, gfs3_create_req *objp) return FALSE; if (!xdr_string (xdrs, &objp->bname, ~0)) return FALSE; - if (!xdr_bytes (xdrs, (char **)&objp->dict.dict_val, - (u_int *) &objp->dict.dict_len, ~0)) + if (!xdr_bytes (xdrs, (char **)&objp->dict.dict_val, (u_int *) &objp->dict.dict_len, ~0)) return FALSE; return TRUE; } @@ -1085,6 +1198,8 @@ xdr_gfs3_create_req (XDR *xdrs, gfs3_create_req *objp) bool_t xdr_gfs3_create_rsp (XDR *xdrs, gfs3_create_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -1104,6 +1219,8 @@ xdr_gfs3_create_rsp (XDR *xdrs, gfs3_create_rsp *objp) bool_t xdr_gfs3_ftruncate_req (XDR *xdrs, gfs3_ftruncate_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_opaque (xdrs, objp->gfid, 16)) return FALSE; @@ -1117,6 +1234,8 @@ xdr_gfs3_ftruncate_req (XDR *xdrs, gfs3_ftruncate_req *objp) bool_t xdr_gfs3_ftruncate_rsp (XDR *xdrs, gfs3_ftruncate_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -1132,6 +1251,8 @@ xdr_gfs3_ftruncate_rsp (XDR *xdrs, gfs3_ftruncate_rsp *objp) bool_t xdr_gfs3_fstat_req (XDR *xdrs, gfs3_fstat_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_opaque (xdrs, objp->gfid, 16)) return FALSE; @@ -1143,6 +1264,8 @@ xdr_gfs3_fstat_req (XDR *xdrs, gfs3_fstat_req *objp) bool_t xdr_gfs3_fstat_rsp (XDR *xdrs, gfs3_fstat_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -1156,6 +1279,8 @@ xdr_gfs3_fstat_rsp (XDR *xdrs, gfs3_fstat_rsp *objp) bool_t xdr_gfs3_entrylk_req (XDR *xdrs, gfs3_entrylk_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_opaque (xdrs, objp->gfid, 16)) return FALSE; @@ -1177,6 +1302,8 @@ xdr_gfs3_entrylk_req (XDR *xdrs, gfs3_entrylk_req *objp) bool_t xdr_gfs3_fentrylk_req (XDR *xdrs, gfs3_fentrylk_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_opaque (xdrs, objp->gfid, 16)) return FALSE; @@ -1195,10 +1322,11 @@ xdr_gfs3_fentrylk_req (XDR *xdrs, gfs3_fentrylk_req *objp) return TRUE; } - bool_t xdr_gfs3_setattr_req (XDR *xdrs, gfs3_setattr_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_opaque (xdrs, objp->gfid, 16)) return FALSE; @@ -1214,6 +1342,8 @@ xdr_gfs3_setattr_req (XDR *xdrs, gfs3_setattr_req *objp) bool_t xdr_gfs3_setattr_rsp (XDR *xdrs, gfs3_setattr_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -1229,6 +1359,8 @@ xdr_gfs3_setattr_rsp (XDR *xdrs, gfs3_setattr_rsp *objp) bool_t xdr_gfs3_fsetattr_req (XDR *xdrs, gfs3_fsetattr_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_quad_t (xdrs, &objp->fd)) return FALSE; @@ -1242,6 +1374,8 @@ xdr_gfs3_fsetattr_req (XDR *xdrs, gfs3_fsetattr_req *objp) bool_t xdr_gfs3_fsetattr_rsp (XDR *xdrs, gfs3_fsetattr_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -1257,6 +1391,8 @@ xdr_gfs3_fsetattr_rsp (XDR *xdrs, gfs3_fsetattr_rsp *objp) bool_t xdr_gfs3_rchecksum_req (XDR *xdrs, gfs3_rchecksum_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_quad_t (xdrs, &objp->fd)) return FALSE; @@ -1271,6 +1407,7 @@ bool_t xdr_gfs3_rchecksum_rsp (XDR *xdrs, gfs3_rchecksum_rsp *objp) { register int32_t *buf; + buf = NULL; if (xdrs->x_op == XDR_ENCODE) { @@ -1325,6 +1462,8 @@ xdr_gfs3_rchecksum_rsp (XDR *xdrs, gfs3_rchecksum_rsp *objp) bool_t xdr_gf_getspec_req (XDR *xdrs, gf_getspec_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_u_int (xdrs, &objp->flags)) return FALSE; @@ -1336,6 +1475,8 @@ xdr_gf_getspec_req (XDR *xdrs, gf_getspec_req *objp) bool_t xdr_gf_getspec_rsp (XDR *xdrs, gf_getspec_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -1349,6 +1490,8 @@ xdr_gf_getspec_rsp (XDR *xdrs, gf_getspec_rsp *objp) bool_t xdr_gf_log_req (XDR *xdrs, gf_log_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_bytes (xdrs, (char **)&objp->msg.msg_val, (u_int *) &objp->msg.msg_len, ~0)) return FALSE; @@ -1358,6 +1501,8 @@ xdr_gf_log_req (XDR *xdrs, gf_log_req *objp) bool_t xdr_gf_notify_req (XDR *xdrs, gf_notify_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_u_int (xdrs, &objp->flags)) return FALSE; @@ -1370,6 +1515,8 @@ bool_t xdr_gf_notify_rsp (XDR *xdrs, gf_notify_rsp *objp) { register int32_t *buf; + buf = NULL; + if (xdrs->x_op == XDR_ENCODE) { buf = XDR_INLINE (xdrs, 3 * BYTES_PER_XDR_UNIT); @@ -1423,6 +1570,8 @@ xdr_gf_notify_rsp (XDR *xdrs, gf_notify_rsp *objp) bool_t xdr_gfs3_releasedir_req (XDR *xdrs, gfs3_releasedir_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_opaque (xdrs, objp->gfid, 16)) return FALSE; @@ -1434,6 +1583,8 @@ xdr_gfs3_releasedir_req (XDR *xdrs, gfs3_releasedir_req *objp) bool_t xdr_gfs3_release_req (XDR *xdrs, gfs3_release_req *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_opaque (xdrs, objp->gfid, 16)) return FALSE; @@ -1445,6 +1596,8 @@ xdr_gfs3_release_req (XDR *xdrs, gfs3_release_req *objp) bool_t xdr_gf_common_rsp (XDR *xdrs, gf_common_rsp *objp) { + register int32_t *buf; + buf = NULL; if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; @@ -1453,10 +1606,12 @@ xdr_gf_common_rsp (XDR *xdrs, gf_common_rsp *objp) return TRUE; } - bool_t xdr_gfs3_dirlist (XDR *xdrs, gfs3_dirlist *objp) { + register int32_t *buf; + buf = NULL; + if (!xdr_u_quad_t (xdrs, &objp->d_ino)) return FALSE; if (!xdr_u_quad_t (xdrs, &objp->d_off)) @@ -1475,6 +1630,9 @@ xdr_gfs3_dirlist (XDR *xdrs, gfs3_dirlist *objp) bool_t xdr_gfs3_readdir_rsp (XDR *xdrs, gfs3_readdir_rsp *objp) { + register int32_t *buf; + buf = NULL; + if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; if (!xdr_int (xdrs, &objp->op_errno)) @@ -1487,10 +1645,13 @@ xdr_gfs3_readdir_rsp (XDR *xdrs, gfs3_readdir_rsp *objp) bool_t xdr_gfs3_dirplist (XDR *xdrs, gfs3_dirplist *objp) { + register int32_t *buf; + buf = NULL; + if (!xdr_u_quad_t (xdrs, &objp->d_ino)) return FALSE; if (!xdr_u_quad_t (xdrs, &objp->d_off)) - return FALSE; + return FALSE; if (!xdr_u_int (xdrs, &objp->d_len)) return FALSE; if (!xdr_u_int (xdrs, &objp->d_type)) @@ -1507,11 +1668,14 @@ xdr_gfs3_dirplist (XDR *xdrs, gfs3_dirplist *objp) bool_t xdr_gfs3_readdirp_rsp (XDR *xdrs, gfs3_readdirp_rsp *objp) { + register int32_t *buf; + buf = NULL; + if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; if (!xdr_int (xdrs, &objp->op_errno)) return FALSE; - if (!xdr_pointer (xdrs, (char **)&objp->reply, sizeof (struct gfs3_dirplist), (xdrproc_t) xdr_gfs3_dirplist)) + if (!xdr_pointer (xdrs, (char **)&objp->reply, sizeof (gfs3_dirplist), (xdrproc_t) xdr_gfs3_dirplist)) return FALSE; return TRUE; } diff --git a/rpc/xdr/src/glusterfs3-xdr.h b/rpc/xdr/src/glusterfs3-xdr.h index 00720e1382d..54512bbc24c 100644 --- a/rpc/xdr/src/glusterfs3-xdr.h +++ b/rpc/xdr/src/glusterfs3-xdr.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2010-2011 Gluster, Inc. <http://www.gluster.com> + Copyright (c) 2007-2011 Gluster, Inc. <http://www.gluster.com> This file is part of GlusterFS. GlusterFS is free software; you can redistribute it and/or modify @@ -17,19 +17,18 @@ <http://www.gnu.org/licenses/>. */ +#include "xdr-common.h" /* - * Most content of this file is generated using rpcgen. There are very few - * additions done to this file (changes can be seen by doing - * 'rpcgen glusterfs3.x' and taking a diff of this file with rpcgen - * generated file. + * Please do not edit this file. + * It was generated using rpcgen. */ -#ifndef _GLUSTERFS3_H_RPCGEN -#define _GLUSTERFS3_H_RPCGEN +#ifndef _GLUSTERFS3_XDR_H_RPCGEN +#define _GLUSTERFS3_XDR_H_RPCGEN + +#include <rpc/rpc.h> -//#include <rpc/rpc.h> -#include "xdr-common.h" #ifdef __cplusplus extern "C" { @@ -82,7 +81,6 @@ struct gf_iatt { }; typedef struct gf_iatt gf_iatt; -/* Gluster FS Payload structures */ struct gfs3_stat_req { char gfid[16]; char *path; @@ -962,4 +960,4 @@ extern bool_t xdr_gfs3_readdirp_rsp (); } #endif -#endif /* !_GLUSTERFS3_H_RPCGEN */ +#endif /* !_GLUSTERFS3_XDR_H_RPCGEN */ diff --git a/rpc/xdr/src/glusterfs3.c b/rpc/xdr/src/glusterfs3.c deleted file mode 100644 index fe9fff53aa3..00000000000 --- a/rpc/xdr/src/glusterfs3.c +++ /dev/null @@ -1,1137 +0,0 @@ -/* - Copyright (c) 2007-2011 Gluster, Inc. <http://www.gluster.com> - This file is part of GlusterFS. - - GlusterFS is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - GlusterFS is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see - <http://www.gnu.org/licenses/>. -*/ - - -#include "glusterfs3.h" -#include "xdr-generic.h" - - -/* Encode */ - -ssize_t -xdr_serialize_getspec_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gf_getspec_rsp); - -} - -ssize_t -xdr_serialize_lookup_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_lookup_rsp); - -} - -ssize_t -xdr_serialize_common_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gf_common_rsp); - -} - -ssize_t -xdr_serialize_setvolume_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gf_setvolume_rsp); - -} -ssize_t -xdr_serialize_statfs_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_statfs_rsp); - -} -ssize_t -xdr_serialize_stat_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_stat_rsp); - -} -ssize_t -xdr_serialize_fstat_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_fstat_rsp); - -} -ssize_t -xdr_serialize_open_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_open_rsp); - -} -ssize_t -xdr_serialize_read_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_read_rsp); - -} -ssize_t -xdr_serialize_write_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_write_rsp); - -} -ssize_t -xdr_serialize_rename_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_rename_rsp); - -} -ssize_t -xdr_serialize_fsync_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_fsync_rsp); - -} -ssize_t -xdr_serialize_rmdir_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_rmdir_rsp); -} -ssize_t -xdr_serialize_unlink_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_unlink_rsp); -} -ssize_t -xdr_serialize_writev_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_write_rsp); -} -ssize_t -xdr_serialize_readv_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_read_rsp); -} -ssize_t -xdr_serialize_readdir_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_readdir_rsp); -} -ssize_t -xdr_serialize_readdirp_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_readdirp_rsp); -} -ssize_t -xdr_serialize_rchecksum_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_rchecksum_rsp); -} -ssize_t -xdr_serialize_setattr_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_setattr_rsp); -} -ssize_t -xdr_serialize_fsetattr_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_fsetattr_rsp); -} - -ssize_t -xdr_serialize_readlink_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_readlink_rsp); - -} -ssize_t -xdr_serialize_symlink_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_symlink_rsp); - -} -ssize_t -xdr_serialize_create_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_create_rsp); - -} -ssize_t -xdr_serialize_link_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_link_rsp); - -} -ssize_t -xdr_serialize_mkdir_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_mkdir_rsp); - -} -ssize_t -xdr_serialize_mknod_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_mknod_rsp); - -} -ssize_t -xdr_serialize_getxattr_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_getxattr_rsp); - -} -ssize_t -xdr_serialize_fgetxattr_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_fgetxattr_rsp); - -} -ssize_t -xdr_serialize_xattrop_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_xattrop_rsp); - -} -ssize_t -xdr_serialize_fxattrop_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_fxattrop_rsp); -} - -ssize_t -xdr_serialize_truncate_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_truncate_rsp); -} - -ssize_t -xdr_serialize_lk_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_lk_rsp); -} - -ssize_t -xdr_serialize_opendir_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_opendir_rsp); -} - -ssize_t -xdr_serialize_ftruncate_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_serialize_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_ftruncate_rsp); -} - - -ssize_t -xdr_to_lookup_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gfs3_lookup_req); -} - -ssize_t -xdr_to_getspec_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf_getspec_req); - -} - -ssize_t -xdr_to_setvolume_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gf_setvolume_req); - -} - -ssize_t -xdr_to_statfs_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gfs3_statfs_req); - -} - -ssize_t -xdr_to_fsync_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gfs3_fsync_req); - -} - -ssize_t -xdr_to_flush_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gfs3_flush_req); - -} - -ssize_t -xdr_to_xattrop_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gfs3_xattrop_req); - -} - -ssize_t -xdr_to_fxattrop_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gfs3_fxattrop_req); - -} - -ssize_t -xdr_to_getxattr_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gfs3_getxattr_req); - -} -ssize_t -xdr_to_fgetxattr_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gfs3_fgetxattr_req); - -} -ssize_t -xdr_to_open_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gfs3_open_req); - -} -ssize_t -xdr_to_create_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gfs3_create_req); - -} -ssize_t -xdr_to_symlink_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gfs3_symlink_req); -} -ssize_t -xdr_to_link_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gfs3_link_req); -} -ssize_t -xdr_to_readlink_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gfs3_readlink_req); -} -ssize_t -xdr_to_rename_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gfs3_rename_req); -} -ssize_t -xdr_to_mkdir_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gfs3_mkdir_req); -} -ssize_t -xdr_to_mknod_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gfs3_mknod_req); -} -ssize_t -xdr_to_readv_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gfs3_read_req); -} -ssize_t -xdr_to_writev_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gfs3_write_req); -} - -ssize_t -xdr_to_readdir_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gfs3_readdir_req); -} - -ssize_t -xdr_to_opendir_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gfs3_opendir_req); -} - -ssize_t -xdr_to_rmdir_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gfs3_rmdir_req); -} - -ssize_t -xdr_to_fsetxattr_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gfs3_fsetxattr_req); -} -ssize_t -xdr_to_setattr_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gfs3_setattr_req); -} -ssize_t -xdr_to_fsetattr_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gfs3_fsetattr_req); -} - -ssize_t -xdr_to_finodelk_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gfs3_finodelk_req); -} - -ssize_t -xdr_to_inodelk_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gfs3_inodelk_req); -} - -ssize_t -xdr_to_ftruncate_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gfs3_ftruncate_req); -} - -ssize_t -xdr_to_fsyncdir_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gfs3_fsyncdir_req); -} - -ssize_t -xdr_to_fstat_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gfs3_fstat_req); -} -ssize_t -xdr_to_rchecksum_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gfs3_rchecksum_req); -} -ssize_t -xdr_to_removexattr_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gfs3_removexattr_req); -} -ssize_t -xdr_to_setxattr_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gfs3_setxattr_req); -} - -ssize_t -xdr_to_fentrylk_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gfs3_fentrylk_req); -} - -ssize_t -xdr_to_entrylk_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gfs3_entrylk_req); -} - -ssize_t -xdr_to_lk_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gfs3_lk_req); -} - -ssize_t -xdr_to_stat_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gfs3_stat_req); -} - -ssize_t -xdr_to_release_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gfs3_release_req); -} - -ssize_t -xdr_to_readdirp_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gfs3_readdirp_req); -} -ssize_t -xdr_to_truncate_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gfs3_truncate_req); -} -ssize_t -xdr_to_access_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gfs3_access_req); -} -ssize_t -xdr_to_unlink_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_gfs3_unlink_req); -} - -ssize_t -xdr_from_lookup_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gfs3_lookup_req); - -} - -ssize_t -xdr_from_stat_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gfs3_stat_req); - -} - -ssize_t -xdr_from_fstat_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gfs3_fstat_req); - -} - -ssize_t -xdr_from_mkdir_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gfs3_mkdir_req); - -} - -ssize_t -xdr_from_mknod_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gfs3_mknod_req); - -} - -ssize_t -xdr_from_symlink_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gfs3_symlink_req); - -} - -ssize_t -xdr_from_readlink_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gfs3_readlink_req); - -} - -ssize_t -xdr_from_rename_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gfs3_rename_req); - -} - -ssize_t -xdr_from_link_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gfs3_link_req); - -} - -ssize_t -xdr_from_create_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gfs3_create_req); - -} - -ssize_t -xdr_from_open_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gfs3_open_req); - -} - -ssize_t -xdr_from_opendir_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gfs3_opendir_req); - -} - -ssize_t -xdr_from_readdir_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gfs3_readdir_req); - -} - -ssize_t -xdr_from_readdirp_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gfs3_readdirp_req); - -} - -ssize_t -xdr_from_fsyncdir_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gfs3_fsyncdir_req); - -} -ssize_t -xdr_from_releasedir_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gfs3_releasedir_req); - -} -ssize_t -xdr_from_release_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gfs3_release_req); - -} -ssize_t -xdr_from_lk_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gfs3_lk_req); - -} -ssize_t -xdr_from_entrylk_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gfs3_entrylk_req); - -} -ssize_t -xdr_from_fentrylk_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gfs3_fentrylk_req); - -} -ssize_t -xdr_from_inodelk_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gfs3_inodelk_req); - -} -ssize_t -xdr_from_finodelk_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gfs3_finodelk_req); - -} -ssize_t -xdr_from_setxattr_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gfs3_setxattr_req); - -} -ssize_t -xdr_from_fsetxattr_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gfs3_fsetxattr_req); - -} -ssize_t -xdr_from_getxattr_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gfs3_getxattr_req); - -} -ssize_t -xdr_from_fgetxattr_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gfs3_fgetxattr_req); - -} -ssize_t -xdr_from_removexattr_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gfs3_removexattr_req); - -} -ssize_t -xdr_from_xattrop_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gfs3_xattrop_req); - -} -ssize_t -xdr_from_fxattrop_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gfs3_fxattrop_req); - -} -ssize_t -xdr_from_access_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gfs3_access_req); - -} -ssize_t -xdr_from_setattr_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gfs3_setattr_req); - -} -ssize_t -xdr_from_truncate_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gfs3_truncate_req); - -} -ssize_t -xdr_from_ftruncate_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gfs3_ftruncate_req); - -} -ssize_t -xdr_from_fsetattr_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gfs3_fsetattr_req); - -} -ssize_t -xdr_from_readv_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gfs3_read_req); - -} -ssize_t -xdr_from_writev_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gfs3_write_req); - -} -ssize_t -xdr_from_fsync_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gfs3_fsync_req); - -} -ssize_t -xdr_from_flush_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gfs3_flush_req); - -} -ssize_t -xdr_from_statfs_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gfs3_statfs_req); - -} -ssize_t -xdr_from_rchecksum_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gfs3_rchecksum_req); - -} -ssize_t -xdr_from_getspec_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gf_getspec_req); - -} -ssize_t -xdr_from_setvolume_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gf_setvolume_req); - -} -ssize_t -xdr_from_rmdir_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gfs3_rmdir_req); - -} -ssize_t -xdr_from_unlink_req (struct iovec outmsg, void *req) -{ - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gfs3_unlink_req); - -} - -/* Client decode */ - -ssize_t -xdr_to_lookup_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_to_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_lookup_rsp); - -} - -ssize_t -xdr_to_stat_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_to_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_stat_rsp); - -} - -ssize_t -xdr_to_fstat_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_to_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_fstat_rsp); - -} - -ssize_t -xdr_to_mkdir_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_to_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_mkdir_rsp); - -} - -ssize_t -xdr_to_mknod_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_to_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_mknod_rsp); - -} - -ssize_t -xdr_to_symlink_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_to_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_symlink_rsp); - -} - -ssize_t -xdr_to_readlink_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_to_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_readlink_rsp); - -} - -ssize_t -xdr_to_rename_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_to_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_rename_rsp); - -} - -ssize_t -xdr_to_link_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_to_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_link_rsp); - -} - -ssize_t -xdr_to_create_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_to_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_create_rsp); - -} - -ssize_t -xdr_to_open_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_to_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_open_rsp); - -} - -ssize_t -xdr_to_opendir_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_to_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_opendir_rsp); - -} - -ssize_t -xdr_to_readdir_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_to_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_readdir_rsp); - -} - -ssize_t -xdr_to_readdirp_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_to_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_readdirp_rsp); - -} -ssize_t -xdr_to_lk_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_to_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_lk_rsp); - -} -ssize_t -xdr_to_getxattr_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_to_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_getxattr_rsp); - -} -ssize_t -xdr_to_fgetxattr_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_to_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_fgetxattr_rsp); - -} -ssize_t -xdr_to_xattrop_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_to_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_xattrop_rsp); - -} -ssize_t -xdr_to_fxattrop_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_to_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_fxattrop_rsp); - -} -ssize_t -xdr_to_setattr_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_to_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_setattr_rsp); - -} -ssize_t -xdr_to_truncate_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_to_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_truncate_rsp); - -} -ssize_t -xdr_to_ftruncate_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_to_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_ftruncate_rsp); - -} -ssize_t -xdr_to_fsetattr_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_to_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_fsetattr_rsp); - -} -ssize_t -xdr_to_readv_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_to_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_read_rsp); - -} -ssize_t -xdr_to_writev_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_to_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_write_rsp); - -} -ssize_t -xdr_to_fsync_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_to_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_fsync_rsp); - -} -ssize_t -xdr_to_statfs_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_to_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_statfs_rsp); - -} -ssize_t -xdr_to_rchecksum_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_to_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_rchecksum_rsp); - -} -ssize_t -xdr_to_getspec_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_to_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gf_getspec_rsp); - -} -ssize_t -xdr_to_setvolume_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_to_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gf_setvolume_rsp); - -} -ssize_t -xdr_to_rmdir_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_to_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_rmdir_rsp); - -} -ssize_t -xdr_to_unlink_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_to_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gfs3_unlink_rsp); - -} -ssize_t -xdr_to_common_rsp (struct iovec outmsg, void *rsp) -{ - return xdr_to_generic (outmsg, (void *)rsp, - (xdrproc_t)xdr_gf_common_rsp); - -} - -ssize_t -xdr_to_mgmt_probe_query_req (struct iovec outmsg, void *req) -{ - - return xdr_serialize_generic (outmsg, (void *)req, - (xdrproc_t)xdr_gfs3_setattr_req); -} diff --git a/rpc/xdr/src/glusterfs3.h b/rpc/xdr/src/glusterfs3.h index d7fd2abd73f..ba64a0b4508 100644 --- a/rpc/xdr/src/glusterfs3.h +++ b/rpc/xdr/src/glusterfs3.h @@ -23,6 +23,7 @@ #include <sys/uio.h> +#include "xdr-generic.h" #include "glusterfs3-xdr.h" #include "iatt.h" @@ -266,486 +267,4 @@ gf_stat_from_iatt (struct gf_iatt *gf_stat, struct iatt *iatt) gf_stat->ia_ctime_nsec = iatt->ia_ctime_nsec ; } -/* FOPS */ -ssize_t -xdr_serialize_lookup_rsp (struct iovec outmsg, void *resp); - -ssize_t -xdr_serialize_getspec_rsp (struct iovec outmsg, void *rsp); - -ssize_t -xdr_serialize_common_rsp (struct iovec outmsg, void *rsp); - -ssize_t -xdr_serialize_setvolume_rsp (struct iovec outmsg, void *rsp); - -ssize_t -xdr_serialize_open_rsp (struct iovec outmsg, void *rsp); - -ssize_t -xdr_serialize_create_rsp (struct iovec outmsg, void *rsp); - -ssize_t -xdr_serialize_mknod_rsp (struct iovec outmsg, void *rsp); - -ssize_t -xdr_serialize_mkdir_rsp (struct iovec outmsg, void *rsp); - -ssize_t -xdr_serialize_symlink_rsp (struct iovec outmsg, void *rsp); - -ssize_t -xdr_serialize_link_rsp (struct iovec outmsg, void *rsp); - -ssize_t -xdr_serialize_rename_rsp (struct iovec outmsg, void *rsp); - -ssize_t -xdr_serialize_writev_rsp (struct iovec outmsg, void *rsp); - -ssize_t -xdr_serialize_readv_rsp (struct iovec outmsg, void *rsp); - -ssize_t -xdr_serialize_readdir_rsp (struct iovec outmsg, void *rsp); - -ssize_t -xdr_serialize_readdirp_rsp (struct iovec outmsg, void *rsp); - -ssize_t -xdr_serialize_opendir_rsp (struct iovec outmsg, void *rsp); - -ssize_t -xdr_serialize_setattr_rsp (struct iovec outmsg, void *rsp); - -ssize_t -xdr_serialize_fsetattr_rsp (struct iovec outmsg, void *rsp); - -ssize_t -xdr_serialize_truncate_rsp (struct iovec outmsg, void *rsp); - -ssize_t -xdr_serialize_ftruncate_rsp (struct iovec outmsg, void *rsp); - -ssize_t -xdr_serialize_statfs_rsp (struct iovec outmsg, void *rsp); - - -ssize_t -xdr_serialize_lk_rsp (struct iovec outmsg, void *rsp); - -ssize_t -xdr_serialize_xattrop_rsp (struct iovec outmsg, void *rsp); - -ssize_t -xdr_serialize_fxattrop_rsp (struct iovec outmsg, void *rsp); - -ssize_t -xdr_serialize_getxattr_rsp (struct iovec outmsg, void *rsp); - - -ssize_t -xdr_serialize_fgetxattr_rsp (struct iovec outmsg, void *rsp); - -ssize_t -xdr_serialize_unlink_rsp (struct iovec outmsg, void *rsp); - -ssize_t -xdr_serialize_rmdir_rsp (struct iovec outmsg, void *rsp); - -ssize_t -xdr_serialize_rchecksum_rsp (struct iovec outmsg, void *rsp); - - -ssize_t -xdr_serialize_fstat_rsp (struct iovec outmsg, void *rsp); - -ssize_t -xdr_serialize_fsync_rsp (struct iovec outmsg, void *rsp); - -ssize_t -xdr_serialize_readlink_rsp (struct iovec outmsg, void *rsp); - -ssize_t -xdr_serialize_stat_rsp (struct iovec outmsg, void *rsp); - - -ssize_t -xdr_to_lookup_req (struct iovec inmsg, void *args); - -ssize_t -xdr_to_getspec_req (struct iovec inmsg, void *args); - -ssize_t -xdr_to_setvolume_req (struct iovec inmsg, void *args); - -ssize_t -xdr_to_statfs_req (struct iovec inmsg, void *args); - - -ssize_t -xdr_to_stat_req (struct iovec inmsg, void *args); - -ssize_t -xdr_to_getattr_req (struct iovec inmsg, void *args); - -ssize_t -xdr_to_fstat_req (struct iovec inmsg, void *args); - -ssize_t -xdr_to_setattr_req (struct iovec inmsg, void *args); - -ssize_t -xdr_to_fsetattr_req (struct iovec inmsg, void *args); - -ssize_t -xdr_to_readv_req (struct iovec inmsg, void *args); - -ssize_t -xdr_to_writev_req (struct iovec inmsg, void *args); - -ssize_t -xdr_to_fsetattr_req (struct iovec inmsg, void *args); - -ssize_t -xdr_to_readlink_req (struct iovec inmsg, void *args); - -ssize_t -xdr_to_create_req (struct iovec inmsg, void *args); - -ssize_t -xdr_to_open_req (struct iovec inmsg, void *args); - -ssize_t -xdr_to_release_req (struct iovec inmsg, void *args); - -ssize_t -xdr_to_xattrop_req (struct iovec inmsg, void *args); - -ssize_t -xdr_to_fxattrop_req (struct iovec inmsg, void *args); - -ssize_t -xdr_to_setxattr_req (struct iovec inmsg, void *args); - -ssize_t -xdr_to_fsetxattr_req (struct iovec inmsg, void *args); - -ssize_t -xdr_to_flush_req (struct iovec inmsg, void *args); - -ssize_t -xdr_to_unlink_req (struct iovec inmsg, void *args); - -ssize_t -xdr_to_fsync_req (struct iovec inmsg, void *args); - -ssize_t -xdr_to_ftruncate_req (struct iovec inmsg, void *args); - -ssize_t -xdr_to_truncate_req (struct iovec inmsg, void *args); - -ssize_t -xdr_to_getxattr_req (struct iovec inmsg, void *args); - -ssize_t -xdr_to_fgetxattr_req (struct iovec inmsg, void *args); - -ssize_t -xdr_to_removexattr_req (struct iovec inmsg, void *args); - -ssize_t -xdr_to_entrylk_req (struct iovec inmsg, void *args); - -ssize_t -xdr_to_fentrylk_req (struct iovec inmsg, void *args); - -ssize_t -xdr_to_inodelk_req (struct iovec inmsg, void *args); - -ssize_t -xdr_to_finodelk_req (struct iovec inmsg, void *args); - -ssize_t -xdr_to_lk_req (struct iovec inmsg, void *args); - -ssize_t -xdr_to_access_req (struct iovec inmsg, void *args); - -ssize_t -xdr_to_opendir_req (struct iovec inmsg, void *args); - -ssize_t -xdr_to_readdirp_req (struct iovec inmsg, void *args); - -ssize_t -xdr_to_readdir_req (struct iovec inmsg, void *args); - -ssize_t -xdr_to_fsyncdir_req (struct iovec inmsg, void *args); - -ssize_t -xdr_to_mknod_req (struct iovec inmsg, void *args); - -ssize_t -xdr_to_mkdir_req (struct iovec inmsg, void *args); - -ssize_t -xdr_to_symlink_req (struct iovec inmsg, void *args); - -ssize_t -xdr_to_rmdir_req (struct iovec inmsg, void *args); - -ssize_t -xdr_to_rchecksum_req (struct iovec inmsg, void *args); - -ssize_t -xdr_to_rename_req (struct iovec inmsg, void *args); - -ssize_t -xdr_to_link_req (struct iovec inmsg, void *args); - -ssize_t -xdr_from_lookup_req (struct iovec outmsg, void *args); - -ssize_t -xdr_from_getspec_req (struct iovec outmsg, void *args); - -ssize_t -xdr_from_stat_req (struct iovec outmsg, void *args); - -ssize_t -xdr_from_access_req (struct iovec outmsg, void *args); - -ssize_t -xdr_from_truncate_req (struct iovec outmsg, void *args); - -ssize_t -xdr_from_ftruncate_req (struct iovec outmsg, void *args); - -ssize_t -xdr_from_readlink_req (struct iovec outmsg, void *args); - -ssize_t -xdr_from_writev_req (struct iovec outmsg, void *args); - -ssize_t -xdr_from_readv_req (struct iovec outmsg, void *args); - -ssize_t -xdr_from_flush_req (struct iovec outmsg, void *args); - -ssize_t -xdr_from_fstat_req (struct iovec outmsg, void *args); - -ssize_t -xdr_from_fsync_req (struct iovec outmsg, void *args); - -ssize_t -xdr_from_open_req (struct iovec outmsg, void *args); - -ssize_t -xdr_from_unlink_req (struct iovec outmsg, void *args); - -ssize_t -xdr_from_rmdir_req (struct iovec outmsg, void *args); - -ssize_t -xdr_from_fsyncdir_req (struct iovec outmsg, void *args); - - -ssize_t -xdr_from_fsetxattr_req (struct iovec outmsg, void *args); - -ssize_t -xdr_from_setxattr_req (struct iovec outmsg, void *args); - -ssize_t -xdr_from_getxattr_req (struct iovec outmsg, void *args); - -ssize_t -xdr_from_fgetxattr_req (struct iovec outmsg, void *args); - -ssize_t -xdr_from_statfs_req (struct iovec outmsg, void *args); - -ssize_t -xdr_from_opendir_req (struct iovec outmsg, void *args); - -ssize_t -xdr_from_lk_req (struct iovec outmsg, void *args); - -ssize_t -xdr_from_inodelk_req (struct iovec outmsg, void *args); - -ssize_t -xdr_from_finodelk_req (struct iovec outmsg, void *args); - -ssize_t -xdr_from_entrylk_req (struct iovec outmsg, void *args); - -ssize_t -xdr_from_fentrylk_req (struct iovec outmsg, void *args); - -ssize_t -xdr_from_removexattr_req (struct iovec outmsg, void *args); - -ssize_t -xdr_from_xattrop_req (struct iovec outmsg, void *args); - -ssize_t -xdr_from_fxattrop_req (struct iovec outmsg, void *args); - -ssize_t -xdr_from_rchecksum_req (struct iovec outmsg, void *args); - -ssize_t -xdr_from_readdir_req (struct iovec outmsg, void *args); - -ssize_t -xdr_from_readdirp_req (struct iovec outmsg, void *args); - -ssize_t -xdr_from_setattr_req (struct iovec outmsg, void *args); - -ssize_t -xdr_from_fsetattr_req (struct iovec outmsg, void *args); - -ssize_t -xdr_from_symlink_req (struct iovec outmsg, void *args); - -ssize_t -xdr_from_rename_req (struct iovec outmsg, void *args); - - -ssize_t -xdr_from_link_req (struct iovec outmsg, void *args); - -ssize_t -xdr_from_rename_req (struct iovec outmsg, void *args); - -ssize_t -xdr_from_create_req (struct iovec outmsg, void *args); - -ssize_t -xdr_from_mkdir_req (struct iovec outmsg, void *args); - -ssize_t -xdr_from_mknod_req (struct iovec outmsg, void *args); - -ssize_t -xdr_from_releasedir_req (struct iovec outmsg, void *args); - -ssize_t -xdr_from_release_req (struct iovec outmsg, void *args); - -ssize_t -xdr_from_setvolume_req (struct iovec outmsg, void *args); - -ssize_t -xdr_to_setvolume_rsp (struct iovec inmsg, void *args); - - - -ssize_t -xdr_to_statfs_rsp (struct iovec inmsg, void *args); - - -ssize_t -xdr_to_stat_rsp (struct iovec inmsg, void *args); - -ssize_t -xdr_to_fstat_rsp (struct iovec inmsg, void *args); - -ssize_t -xdr_to_rename_rsp (struct iovec inmsg, void *args); - -ssize_t -xdr_to_readlink_rsp (struct iovec inmsg, void *args); - - -ssize_t -xdr_to_link_rsp (struct iovec inmsg, void *args); - - -ssize_t -xdr_to_access_rsp (struct iovec inmsg, void *args); - - -ssize_t -xdr_to_truncate_rsp (struct iovec inmsg, void *args); - - -ssize_t -xdr_to_ftruncate_rsp (struct iovec inmsg, void *args); - - -ssize_t -xdr_to_unlink_rsp (struct iovec inmsg, void *args); - - -ssize_t -xdr_to_rmdir_rsp (struct iovec inmsg, void *args); - - -ssize_t -xdr_to_open_rsp (struct iovec inmsg, void *args); - - -ssize_t -xdr_to_create_rsp (struct iovec inmsg, void *args); - - -ssize_t -xdr_to_mkdir_rsp (struct iovec inmsg, void *args); - - -ssize_t -xdr_to_mknod_rsp (struct iovec inmsg, void *args); - -ssize_t -xdr_to_setattr_rsp (struct iovec inmsg, void *args); - -ssize_t -xdr_to_fsetattr_rsp (struct iovec inmsg, void *args); - -ssize_t -xdr_to_common_rsp (struct iovec inmsg, void *args); - -ssize_t -xdr_to_getxattr_rsp (struct iovec inmsg, void *args); - -ssize_t -xdr_to_fxattrop_rsp (struct iovec inmsg, void *args); - -ssize_t -xdr_to_xattrop_rsp (struct iovec inmsg, void *args); - -ssize_t -xdr_to_symlink_rsp (struct iovec inmsg, void *args); - -ssize_t -xdr_to_fgetxattr_rsp (struct iovec inmsg, void *args); - -ssize_t -xdr_to_rchecksum_rsp (struct iovec inmsg, void *args); - -ssize_t -xdr_to_lk_rsp (struct iovec inmsg, void *args); - -ssize_t -xdr_to_readdirp_rsp (struct iovec inmsg, void *args); - -ssize_t -xdr_to_readdir_rsp (struct iovec inmsg, void *args); -ssize_t -xdr_to_opendir_rsp (struct iovec inmsg, void *args); -ssize_t -xdr_to_lookup_rsp (struct iovec inmsg, void *args); -ssize_t -xdr_to_readv_rsp (struct iovec inmsg, void *args); -ssize_t -xdr_to_getspec_rsp (struct iovec inmsg, void *args); - #endif /* !_GLUSTERFS3_H */ diff --git a/rpc/xdr/src/portmap-xdr.c b/rpc/xdr/src/portmap-xdr.c index 436e974a871..993a718c85b 100644 --- a/rpc/xdr/src/portmap-xdr.c +++ b/rpc/xdr/src/portmap-xdr.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2010-2011 Gluster, Inc. <http://www.gluster.com> + Copyright (c) 2007-2011 Gluster, Inc. <http://www.gluster.com> This file is part of GlusterFS. GlusterFS is free software; you can redistribute it and/or modify @@ -17,6 +17,7 @@ <http://www.gnu.org/licenses/>. */ +#include "xdr-common.h" /* * Please do not edit this file. @@ -24,11 +25,13 @@ */ #include "portmap-xdr.h" -#include "compat.h" bool_t xdr_pmap_port_by_brick_req (XDR *xdrs, pmap_port_by_brick_req *objp) { + register int32_t *buf; + buf = NULL; + if (!xdr_string (xdrs, &objp->brick, ~0)) return FALSE; return TRUE; @@ -38,6 +41,7 @@ bool_t xdr_pmap_port_by_brick_rsp (XDR *xdrs, pmap_port_by_brick_rsp *objp) { register int32_t *buf; + buf = NULL; if (xdrs->x_op == XDR_ENCODE) { @@ -92,6 +96,9 @@ xdr_pmap_port_by_brick_rsp (XDR *xdrs, pmap_port_by_brick_rsp *objp) bool_t xdr_pmap_brick_by_port_req (XDR *xdrs, pmap_brick_by_port_req *objp) { + register int32_t *buf; + buf = NULL; + if (!xdr_int (xdrs, &objp->port)) return FALSE; return TRUE; @@ -101,6 +108,7 @@ bool_t xdr_pmap_brick_by_port_rsp (XDR *xdrs, pmap_brick_by_port_rsp *objp) { register int32_t *buf; + buf = NULL; if (xdrs->x_op == XDR_ENCODE) { @@ -155,6 +163,9 @@ xdr_pmap_brick_by_port_rsp (XDR *xdrs, pmap_brick_by_port_rsp *objp) bool_t xdr_pmap_signup_req (XDR *xdrs, pmap_signup_req *objp) { + register int32_t *buf; + buf = NULL; + if (!xdr_string (xdrs, &objp->brick, ~0)) return FALSE; if (!xdr_int (xdrs, &objp->port)) @@ -165,6 +176,9 @@ xdr_pmap_signup_req (XDR *xdrs, pmap_signup_req *objp) bool_t xdr_pmap_signup_rsp (XDR *xdrs, pmap_signup_rsp *objp) { + register int32_t *buf; + buf = NULL; + if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; if (!xdr_int (xdrs, &objp->op_errno)) @@ -175,6 +189,9 @@ xdr_pmap_signup_rsp (XDR *xdrs, pmap_signup_rsp *objp) bool_t xdr_pmap_signin_req (XDR *xdrs, pmap_signin_req *objp) { + register int32_t *buf; + buf = NULL; + if (!xdr_string (xdrs, &objp->brick, ~0)) return FALSE; if (!xdr_int (xdrs, &objp->port)) @@ -185,6 +202,9 @@ xdr_pmap_signin_req (XDR *xdrs, pmap_signin_req *objp) bool_t xdr_pmap_signin_rsp (XDR *xdrs, pmap_signin_rsp *objp) { + register int32_t *buf; + buf = NULL; + if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; if (!xdr_int (xdrs, &objp->op_errno)) @@ -195,6 +215,9 @@ xdr_pmap_signin_rsp (XDR *xdrs, pmap_signin_rsp *objp) bool_t xdr_pmap_signout_req (XDR *xdrs, pmap_signout_req *objp) { + register int32_t *buf; + buf = NULL; + if (!xdr_string (xdrs, &objp->brick, ~0)) return FALSE; if (!xdr_int (xdrs, &objp->port)) @@ -205,6 +228,9 @@ xdr_pmap_signout_req (XDR *xdrs, pmap_signout_req *objp) bool_t xdr_pmap_signout_rsp (XDR *xdrs, pmap_signout_rsp *objp) { + register int32_t *buf; + buf = NULL; + if (!xdr_int (xdrs, &objp->op_ret)) return FALSE; if (!xdr_int (xdrs, &objp->op_errno)) diff --git a/rpc/xdr/src/portmap-xdr.h b/rpc/xdr/src/portmap-xdr.h index de8a5bc8d8e..9c2892e93a4 100644 --- a/rpc/xdr/src/portmap-xdr.h +++ b/rpc/xdr/src/portmap-xdr.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2010-2011 Gluster, Inc. <http://www.gluster.com> + Copyright (c) 2007-2011 Gluster, Inc. <http://www.gluster.com> This file is part of GlusterFS. GlusterFS is free software; you can redistribute it and/or modify @@ -17,17 +17,17 @@ <http://www.gnu.org/licenses/>. */ +#include "xdr-common.h" /* * Please do not edit this file. * It was generated using rpcgen. */ -#ifndef _PORTMAP_H_RPCGEN -#define _PORTMAP_H_RPCGEN +#ifndef _PORTMAP_XDR_H_RPCGEN +#define _PORTMAP_XDR_H_RPCGEN #include <rpc/rpc.h> -#include <rpc/types.h> #ifdef __cplusplus @@ -129,4 +129,4 @@ extern bool_t xdr_pmap_signout_rsp (); } #endif -#endif /* !_PORTMAP_H_RPCGEN */ +#endif /* !_PORTMAP_XDR_H_RPCGEN */ diff --git a/rpc/xdr/src/portmap.c b/rpc/xdr/src/portmap.c deleted file mode 100644 index f1c1b789e03..00000000000 --- a/rpc/xdr/src/portmap.c +++ /dev/null @@ -1,189 +0,0 @@ -/* - Copyright (c) 2010-2011 Gluster, Inc. <http://www.gluster.com> - This file is part of GlusterFS. - - GlusterFS is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - GlusterFS is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see - <http://www.gnu.org/licenses/>. -*/ - - -#include "portmap.h" - - -ssize_t -xdr_to_pmap_port_by_brick_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_pmap_port_by_brick_req); -} - - -ssize_t -xdr_to_pmap_port_by_brick_rsp (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_pmap_port_by_brick_rsp); -} - - -ssize_t -xdr_from_pmap_port_by_brick_req (struct iovec inmsg, void *args) -{ - return xdr_serialize_generic (inmsg, (void *)args, - (xdrproc_t)xdr_pmap_port_by_brick_req); -} - - -ssize_t -xdr_from_pmap_port_by_brick_rsp (struct iovec inmsg, void *args) -{ - return xdr_serialize_generic (inmsg, (void *)args, - (xdrproc_t)xdr_pmap_port_by_brick_rsp); -} - - - -ssize_t -xdr_to_pmap_brick_by_port_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_pmap_brick_by_port_req); -} - - -ssize_t -xdr_to_pmap_brick_by_port_rsp (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_pmap_brick_by_port_rsp); -} - - -ssize_t -xdr_from_pmap_brick_by_port_req (struct iovec inmsg, void *args) -{ - return xdr_serialize_generic (inmsg, (void *)args, - (xdrproc_t)xdr_pmap_brick_by_port_req); -} - - -ssize_t -xdr_from_pmap_brick_by_port_rsp (struct iovec inmsg, void *args) -{ - return xdr_serialize_generic (inmsg, (void *)args, - (xdrproc_t)xdr_pmap_brick_by_port_rsp); -} - - - - -ssize_t -xdr_to_pmap_signup_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_pmap_signup_req); -} - - -ssize_t -xdr_to_pmap_signup_rsp (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_pmap_signup_rsp); -} - - -ssize_t -xdr_from_pmap_signup_req (struct iovec inmsg, void *args) -{ - return xdr_serialize_generic (inmsg, (void *)args, - (xdrproc_t)xdr_pmap_signup_req); -} - - -ssize_t -xdr_from_pmap_signup_rsp (struct iovec inmsg, void *args) -{ - return xdr_serialize_generic (inmsg, (void *)args, - (xdrproc_t)xdr_pmap_signup_rsp); -} - - - - -ssize_t -xdr_to_pmap_signin_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_pmap_signin_req); -} - - -ssize_t -xdr_to_pmap_signin_rsp (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_pmap_signin_rsp); -} - - -ssize_t -xdr_from_pmap_signin_req (struct iovec inmsg, void *args) -{ - return xdr_serialize_generic (inmsg, (void *)args, - (xdrproc_t)xdr_pmap_signin_req); -} - - -ssize_t -xdr_from_pmap_signin_rsp (struct iovec inmsg, void *args) -{ - return xdr_serialize_generic (inmsg, (void *)args, - (xdrproc_t)xdr_pmap_signin_rsp); -} - - - - -ssize_t -xdr_to_pmap_signout_req (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_pmap_signout_req); -} - - -ssize_t -xdr_to_pmap_signout_rsp (struct iovec inmsg, void *args) -{ - return xdr_to_generic (inmsg, (void *)args, - (xdrproc_t)xdr_pmap_signout_rsp); -} - - -ssize_t -xdr_from_pmap_signout_req (struct iovec inmsg, void *args) -{ - return xdr_serialize_generic (inmsg, (void *)args, - (xdrproc_t)xdr_pmap_signout_req); -} - - -ssize_t -xdr_from_pmap_signout_rsp (struct iovec inmsg, void *args) -{ - return xdr_serialize_generic (inmsg, (void *)args, - (xdrproc_t)xdr_pmap_signout_rsp); -} - diff --git a/rpc/xdr/src/portmap.h b/rpc/xdr/src/portmap.h deleted file mode 100644 index 9fa237d20c3..00000000000 --- a/rpc/xdr/src/portmap.h +++ /dev/null @@ -1,95 +0,0 @@ -/* - Copyright (c) 2010-2011 Gluster, Inc. <http://www.gluster.com> - This file is part of GlusterFS. - - GlusterFS is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - GlusterFS is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see - <http://www.gnu.org/licenses/>. -*/ - - -#ifndef _PORTMAP_H -#define _PORTMAP_H - -#include <sys/uio.h> - -#include "xdr-generic.h" -#include "portmap-xdr.h" - - -ssize_t -xdr_to_pmap_port_by_brick_req (struct iovec inmsg, void *args); - -ssize_t -xdr_to_pmap_port_by_brick_rsp (struct iovec inmsg, void *args); - -ssize_t -xdr_from_pmap_port_by_brick_req (struct iovec outmsg, void *args); - -ssize_t -xdr_from_pmap_port_by_brick_rsp (struct iovec outmsg, void *args); - - -ssize_t -xdr_to_pmap_brick_by_port_req (struct iovec inmsg, void *args); - -ssize_t -xdr_to_pmap_brick_by_port_rsp (struct iovec inmsg, void *args); - -ssize_t -xdr_from_pmap_brick_by_port_req (struct iovec outmsg, void *args); - -ssize_t -xdr_from_pmap_brick_by_port_rsp (struct iovec outmsg, void *args); - - -ssize_t -xdr_from_pmap_signup_req (struct iovec msg, void *args); - -ssize_t -xdr_from_pmap_signup_rsp (struct iovec msg, void *args); - -ssize_t -xdr_to_pmap_signup_req (struct iovec msg, void *args); - -ssize_t -xdr_to_pmap_signup_rsp (struct iovec msg, void *args); - - -ssize_t -xdr_from_pmap_signin_req (struct iovec msg, void *args); - -ssize_t -xdr_from_pmap_signin_rsp (struct iovec msg, void *args); - -ssize_t -xdr_to_pmap_signin_req (struct iovec msg, void *args); - -ssize_t -xdr_to_pmap_signin_rsp (struct iovec msg, void *args); - - -ssize_t -xdr_from_pmap_signout_req (struct iovec msg, void *args); - -ssize_t -xdr_from_pmap_signout_rsp (struct iovec msg, void *args); - -ssize_t -xdr_to_pmap_signout_req (struct iovec msg, void *args); - -ssize_t -xdr_to_pmap_signout_rsp (struct iovec msg, void *args); - - -#endif /* !_PORTMAP_H */ diff --git a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c index d05dd49a14a..5fbdfc11660 100644 --- a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c @@ -23,7 +23,8 @@ #endif #include "common-utils.h" -#include "cli1.h" +#include "cli1-xdr.h" +#include "xdr-generic.h" #include "glusterd.h" #include "glusterd-op-sm.h" #include "glusterd-store.h" @@ -65,7 +66,8 @@ glusterd_handle_add_brick (rpcsvc_request_t *req) INIT_LIST_HEAD (&tmpvolinfo.bricks); - if (!gf_xdr_to_cli_add_brick_req (req->msg[0], &cli_req)) { + if (!xdr_to_generic (req->msg[0], &cli_req, + (xdrproc_t)xdr_gf1_cli_add_brick_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; snprintf (err_str, sizeof (err_str), "Garbage args received"); @@ -221,7 +223,6 @@ out: rsp.op_errstr = err_str; cli_rsp = &rsp; glusterd_submit_reply(req, cli_rsp, NULL, 0, NULL, - gf_xdr_serialize_cli_add_brick_rsp, (xdrproc_t)xdr_gf1_cli_add_brick_rsp); ret = 0; //sent error to cli, prevent second reply } @@ -265,7 +266,8 @@ glusterd_handle_remove_brick (rpcsvc_request_t *req) GF_ASSERT (req); - if (!gf_xdr_to_cli_remove_brick_req (req->msg[0], &cli_req)) { + if (!xdr_to_generic (req->msg[0], &cli_req, + (xdrproc_t)xdr_gf1_cli_remove_brick_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -417,7 +419,6 @@ out: rsp.op_errstr = err_str; cli_rsp = &rsp; glusterd_submit_reply(req, cli_rsp, NULL, 0, NULL, - gf_xdr_serialize_cli_remove_brick_rsp, (xdrproc_t)xdr_gf1_cli_remove_brick_rsp); ret = 0; //sent error to cli, prevent second reply diff --git a/xlators/mgmt/glusterd/src/glusterd-geo-rep.c b/xlators/mgmt/glusterd/src/glusterd-geo-rep.c index 49654220bf6..9630546b42a 100644 --- a/xlators/mgmt/glusterd/src/glusterd-geo-rep.c +++ b/xlators/mgmt/glusterd/src/glusterd-geo-rep.c @@ -23,7 +23,8 @@ #endif #include "common-utils.h" -#include "cli1.h" +#include "cli1-xdr.h" +#include "xdr-generic.h" #include "glusterd.h" #include "glusterd-op-sm.h" #include "glusterd-store.h" @@ -61,7 +62,8 @@ glusterd_handle_gsync_set (rpcsvc_request_t *req) priv = THIS->private; - if (!gf_xdr_to_cli_gsync_set_req (req->msg[0], &cli_req)) { + if (!xdr_to_generic (req->msg[0], &cli_req, + (xdrproc_t)xdr_gf1_cli_gsync_set_req)) { req->rpc_err = GARBAGE_ARGS; goto out; } diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c index 08ba9bc465d..881e842142a 100644 --- a/xlators/mgmt/glusterd/src/glusterd-handler.c +++ b/xlators/mgmt/glusterd/src/glusterd-handler.c @@ -43,10 +43,10 @@ #include "glusterd-utils.h" #include "glusterd-store.h" -#include "glusterd1.h" -#include "cli1.h" -#include "rpc-clnt.h" #include "glusterd1-xdr.h" +#include "cli1-xdr.h" +#include "xdr-generic.h" +#include "rpc-clnt.h" #include "glusterd-volgen.h" #include <sys/resource.h> @@ -459,7 +459,7 @@ glusterd_handle_cluster_lock (rpcsvc_request_t *req) GF_ASSERT (req); - if (!gd_xdr_to_mgmt_cluster_lock_req (req->msg[0], &lock_req)) { + if (!xdr_to_generic (req->msg[0], &lock_req, (xdrproc_t)xdr_gd1_mgmt_cluster_lock_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -565,7 +565,7 @@ glusterd_handle_stage_op (rpcsvc_request_t *req) gd1_mgmt_stage_op_req op_req = {{0},}; GF_ASSERT (req); - if (!gd_xdr_to_mgmt_stage_op_req (req->msg[0], &op_req)) { + if (!xdr_to_generic (req->msg[0], &op_req, (xdrproc_t)xdr_gd1_mgmt_stage_op_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -596,7 +596,7 @@ glusterd_handle_commit_op (rpcsvc_request_t *req) GF_ASSERT (req); - if (!gd_xdr_to_mgmt_commit_op_req (req->msg[0], &op_req)) { + if (!xdr_to_generic (req->msg[0], &op_req, (xdrproc_t)xdr_gd1_mgmt_commit_op_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -631,7 +631,7 @@ glusterd_handle_cli_probe (rpcsvc_request_t *req) gf_boolean_t run_fsm = _gf_true; GF_ASSERT (req); - if (!gf_xdr_to_cli_probe_req (req->msg[0], &cli_req)) { + if (!xdr_to_generic (req->msg[0], &cli_req, (xdrproc_t)xdr_gf1_cli_probe_req)) { //failed to decode msg; gf_log ("", GF_LOG_ERROR, "xdr decoding error"); req->rpc_err = GARBAGE_ARGS; @@ -698,7 +698,7 @@ glusterd_handle_cli_deprobe (rpcsvc_request_t *req) GF_ASSERT (priv); GF_ASSERT (req); - if (!gf_xdr_to_cli_probe_req (req->msg[0], &cli_req)) { + if (!xdr_to_generic (req->msg[0], &cli_req, (xdrproc_t)xdr_gf1_cli_probe_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -762,7 +762,7 @@ glusterd_handle_cli_list_friends (rpcsvc_request_t *req) GF_ASSERT (req); - if (!gf_xdr_to_cli_peer_list_req (req->msg[0], &cli_req)) { + if (!xdr_to_generic (req->msg[0], &cli_req, (xdrproc_t)xdr_gf1_cli_peer_list_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -808,7 +808,7 @@ glusterd_handle_cli_get_volume (rpcsvc_request_t *req) GF_ASSERT (req); - if (!gf_xdr_to_cli_get_vol_req (req->msg[0], &cli_req)) { + if (!xdr_to_generic (req->msg[0], &cli_req, (xdrproc_t)xdr_gf1_cli_get_vol_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -867,7 +867,7 @@ glusterd_handle_reset_volume (rpcsvc_request_t *req) GF_ASSERT (req); - if (!gf_xdr_to_cli_set_vol_req (req->msg[0], &cli_req)) { + if (!xdr_to_generic (req->msg[0], &cli_req, (xdrproc_t)xdr_gf1_cli_set_vol_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -924,7 +924,7 @@ glusterd_handle_set_volume (rpcsvc_request_t *req) GF_ASSERT (req); - if (!gf_xdr_to_cli_set_vol_req (req->msg[0], &cli_req)) { + if (!xdr_to_generic (req->msg[0], &cli_req, (xdrproc_t)xdr_gf1_cli_set_vol_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -1008,7 +1008,7 @@ glusterd_handle_sync_volume (rpcsvc_request_t *req) GF_ASSERT (req); - if (!gf_xdr_to_cli_sync_volume_req (req->msg[0], &cli_req)) { + if (!xdr_to_generic (req->msg[0], &cli_req, (xdrproc_t)xdr_gf1_cli_sync_volume_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -1082,7 +1082,6 @@ out: if (msg[0] == '\0') snprintf (msg, sizeof (msg), "Operation failed"); glusterd_submit_reply(req, &cli_rsp, NULL, 0, NULL, - gf_xdr_from_cli_sync_volume_rsp, (xdrproc_t)xdr_gf1_cli_sync_volume_rsp); if (free_hostname && cli_req.hostname) free (cli_req.hostname); @@ -1119,7 +1118,6 @@ glusterd_fsm_log_send_resp (rpcsvc_request_t *req, int op_ret, (size_t *)&rsp.fsm_log.fsm_log_len); ret = glusterd_submit_reply (req, &rsp, NULL, 0, NULL, - gf_xdr_from_cli_fsm_log_rsp, (xdrproc_t)xdr_gf1_cli_fsm_log_rsp); if (rsp.fsm_log.fsm_log_val) GF_FREE (rsp.fsm_log.fsm_log_val); @@ -1143,7 +1141,7 @@ glusterd_handle_fsm_log (rpcsvc_request_t *req) GF_ASSERT (req); - if (!gf_xdr_to_cli_fsm_log_req (req->msg[0], &cli_req)) { + if (!xdr_to_generic (req->msg[0], &cli_req, (xdrproc_t)xdr_gf1_cli_fsm_log_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; snprintf (msg, sizeof (msg), "Garbage request"); @@ -1197,7 +1195,6 @@ glusterd_op_lock_send_resp (rpcsvc_request_t *req, int32_t status) rsp.op_ret = status; ret = glusterd_submit_reply (req, &rsp, NULL, 0, NULL, - gd_xdr_serialize_mgmt_cluster_lock_rsp, (xdrproc_t)xdr_gd1_mgmt_cluster_lock_rsp); gf_log ("glusterd", GF_LOG_INFO, @@ -1218,7 +1215,6 @@ glusterd_op_unlock_send_resp (rpcsvc_request_t *req, int32_t status) glusterd_get_uuid (&rsp.uuid); ret = glusterd_submit_reply (req, &rsp, NULL, 0, NULL, - gd_xdr_serialize_mgmt_cluster_unlock_rsp, (xdrproc_t)xdr_gd1_mgmt_cluster_unlock_rsp); gf_log ("glusterd", GF_LOG_INFO, @@ -1236,7 +1232,8 @@ glusterd_handle_cluster_unlock (rpcsvc_request_t *req) GF_ASSERT (req); - if (!gd_xdr_to_mgmt_cluster_unlock_req (req->msg[0], &unlock_req)) { + if (!xdr_to_generic (req->msg[0], &unlock_req, + (xdrproc_t)xdr_gd1_mgmt_cluster_unlock_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -1291,7 +1288,6 @@ glusterd_op_stage_send_resp (rpcsvc_request_t *req, } ret = glusterd_submit_reply (req, &rsp, NULL, 0, NULL, - gd_xdr_serialize_mgmt_stage_op_rsp, (xdrproc_t)xdr_gd1_mgmt_stage_op_rsp); gf_log ("glusterd", GF_LOG_INFO, @@ -1333,7 +1329,6 @@ glusterd_op_commit_send_resp (rpcsvc_request_t *req, ret = glusterd_submit_reply (req, &rsp, NULL, 0, NULL, - gd_xdr_serialize_mgmt_commit_op_rsp, (xdrproc_t)xdr_gd1_mgmt_commit_op_rsp); gf_log ("glusterd", GF_LOG_INFO, @@ -1353,7 +1348,7 @@ glusterd_handle_incoming_friend_req (rpcsvc_request_t *req) gf_boolean_t run_fsm = _gf_true; GF_ASSERT (req); - if (!gd_xdr_to_mgmt_friend_req (req->msg[0], &friend_req)) { + if (!xdr_to_generic (req->msg[0], &friend_req, (xdrproc_t)xdr_gd1_mgmt_friend_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -1391,7 +1386,7 @@ glusterd_handle_incoming_unfriend_req (rpcsvc_request_t *req) char remote_hostname[UNIX_PATH_MAX + 1] = {0,}; GF_ASSERT (req); - if (!gd_xdr_to_mgmt_friend_req (req->msg[0], &friend_req)) { + if (!xdr_to_generic (req->msg[0], &friend_req, (xdrproc_t)xdr_gd1_mgmt_friend_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -1494,7 +1489,7 @@ glusterd_handle_friend_update (rpcsvc_request_t *req) priv = this->private; GF_ASSERT (priv); - if (!gd_xdr_to_mgmt_friend_update (req->msg[0], &friend_req)) { + if (!xdr_to_generic (req->msg[0], &friend_req, (xdrproc_t)xdr_gd1_mgmt_friend_update)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -1581,7 +1576,6 @@ glusterd_handle_friend_update (rpcsvc_request_t *req) out: uuid_copy (rsp.uuid, priv->uuid); ret = glusterd_submit_reply (req, &rsp, NULL, 0, NULL, - gd_xdr_serialize_mgmt_friend_update_rsp, (xdrproc_t)xdr_gd1_mgmt_friend_update_rsp); if (dict) { if (!dict->extra_stdfree && friend_req.friends.friends_val) @@ -1613,13 +1607,12 @@ glusterd_handle_probe_query (rpcsvc_request_t *req) GF_ASSERT (req); - if (!gd_xdr_to_mgmt_probe_req (req->msg[0], &probe_req)) { + if (!xdr_to_generic (req->msg[0], &probe_req, (xdrproc_t)xdr_gd1_mgmt_probe_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; } - this = THIS; conf = this->private; @@ -1660,7 +1653,6 @@ glusterd_handle_probe_query (rpcsvc_request_t *req) rsp.hostname = probe_req.hostname; ret = glusterd_submit_reply (req, &rsp, NULL, 0, NULL, - gd_xdr_serialize_mgmt_probe_rsp, (xdrproc_t)xdr_gd1_mgmt_probe_rsp); gf_log ("glusterd", GF_LOG_INFO, "Responded to %s, op_ret: %d, " @@ -1690,7 +1682,7 @@ glusterd_handle_cli_profile_volume (rpcsvc_request_t *req) GF_ASSERT (req); - if (!gf_xdr_to_cli_stats_volume_req (req->msg[0], &cli_req)) { + if (!xdr_to_generic (req->msg[0], &cli_req, (xdrproc_t)xdr_gf1_cli_stats_volume_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -1772,7 +1764,6 @@ glusterd_handle_getwd (rpcsvc_request_t *req) rsp.wd = priv->workdir; ret = glusterd_submit_reply (req, &rsp, NULL, 0, NULL, - gf_xdr_from_cli_getwd_rsp, (xdrproc_t)xdr_gf1_cli_getwd_rsp); glusterd_friend_sm (); @@ -2085,7 +2076,6 @@ glusterd_xfer_friend_remove_resp (rpcsvc_request_t *req, char *hostname, int por rsp.hostname = hostname; rsp.port = port; ret = glusterd_submit_reply (req, &rsp, NULL, 0, NULL, - gd_xdr_serialize_mgmt_friend_rsp, (xdrproc_t)xdr_gd1_mgmt_friend_rsp); gf_log ("glusterd", GF_LOG_INFO, @@ -2117,7 +2107,6 @@ glusterd_xfer_friend_add_resp (rpcsvc_request_t *req, char *hostname, int port, rsp.port = port; ret = glusterd_submit_reply (req, &rsp, NULL, 0, NULL, - gd_xdr_serialize_mgmt_friend_rsp, (xdrproc_t)xdr_gd1_mgmt_friend_rsp); gf_log ("glusterd", GF_LOG_INFO, @@ -2142,7 +2131,6 @@ glusterd_xfer_cli_probe_resp (rpcsvc_request_t *req, int32_t op_ret, rsp.port = port; ret = glusterd_submit_reply (req, &rsp, NULL, 0, NULL, - gf_xdr_serialize_cli_probe_rsp, (xdrproc_t)xdr_gf1_cli_probe_rsp); gf_log ("glusterd", GF_LOG_INFO, "Responded to CLI, ret: %d",ret); @@ -2164,7 +2152,6 @@ glusterd_xfer_cli_deprobe_resp (rpcsvc_request_t *req, int32_t op_ret, rsp.hostname = hostname; ret = glusterd_submit_reply (req, &rsp, NULL, 0, NULL, - gf_xdr_serialize_cli_deprobe_rsp, (xdrproc_t)xdr_gf1_cli_deprobe_rsp); gf_log ("glusterd", GF_LOG_INFO, "Responded to CLI, ret: %d",ret); @@ -2227,7 +2214,6 @@ out: rsp.op_ret = ret; ret = glusterd_submit_reply (req, &rsp, NULL, 0, NULL, - gf_xdr_serialize_cli_peer_list_rsp, (xdrproc_t)xdr_gf1_cli_peer_list_rsp); if (rsp.friends.friends_val) GF_FREE (rsp.friends.friends_val); @@ -2331,7 +2317,6 @@ out: rsp.op_ret = ret; ret = glusterd_submit_reply (req, &rsp, NULL, 0, NULL, - gf_xdr_serialize_cli_peer_list_rsp, (xdrproc_t)xdr_gf1_cli_peer_list_rsp); if (volumes) @@ -2352,7 +2337,8 @@ glusterd_handle_status_volume (rpcsvc_request_t *req) GF_ASSERT (req); - if (!gf_xdr_to_cli_status_volume_req (req->msg[0], &cli_req)) { + if (!xdr_to_generic (req->msg[0], &cli_req, + (xdrproc_t)xdr_gf1_cli_status_volume_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; diff --git a/xlators/mgmt/glusterd/src/glusterd-handshake.c b/xlators/mgmt/glusterd/src/glusterd-handshake.c index e78ccbfdc40..25b1e669570 100644 --- a/xlators/mgmt/glusterd/src/glusterd-handshake.c +++ b/xlators/mgmt/glusterd/src/glusterd-handshake.c @@ -101,23 +101,6 @@ out: return ret; } -static int -xdr_to_glusterfs_req (rpcsvc_request_t *req, void *arg, gfs_serialize_t sfunc) -{ - int ret = -1; - - if (!req) - return -1; - - ret = sfunc (req->msg[0], arg); - - if (ret > 0) - ret = 0; - - return ret; -} - - int server_getspec (rpcsvc_request_t *req) { @@ -134,7 +117,7 @@ server_getspec (rpcsvc_request_t *req) gf_getspec_rsp rsp = {0,}; - if (xdr_to_glusterfs_req (req, &args, xdr_to_getspec_req)) { + if (!xdr_to_generic (req->msg[0], &args, (xdrproc_t)xdr_gf_getspec_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto fail; @@ -191,7 +174,6 @@ fail: rsp.spec = ""; glusterd_submit_reply (req, &rsp, NULL, 0, NULL, - (gd_serialize_t)xdr_serialize_getspec_rsp, (xdrproc_t)xdr_gf_getspec_rsp); if (args.key) free (args.key);//malloced by xdr @@ -346,7 +328,7 @@ glusterd_peer_dump_version_cbk (struct rpc_req *req, struct iovec *iov, goto out; } - ret = xdr_to_dump_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf_dump_rsp); if (ret < 0) { gf_log ("", GF_LOG_ERROR, "failed to decode XDR"); goto out; @@ -421,7 +403,7 @@ glusterd_peer_handshake (xlator_t *this, struct rpc_clnt *rpc, ret = glusterd_submit_request (peerctx->peerinfo->rpc, &req, frame, &glusterd_dump_prog, GF_DUMP_DUMP, - NULL, xdr_from_dump_req, this, + NULL, this, glusterd_peer_dump_version_cbk, (xdrproc_t)xdr_gf_dump_req); out: diff --git a/xlators/mgmt/glusterd/src/glusterd-log-ops.c b/xlators/mgmt/glusterd/src/glusterd-log-ops.c index 01769829105..7274d102418 100644 --- a/xlators/mgmt/glusterd/src/glusterd-log-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-log-ops.c @@ -23,7 +23,8 @@ #endif #include "common-utils.h" -#include "cli1.h" +#include "cli1-xdr.h" +#include "xdr-generic.h" #include "glusterd.h" #include "glusterd-op-sm.h" #include "glusterd-store.h" @@ -42,7 +43,8 @@ glusterd_handle_log_filename (rpcsvc_request_t *req) GF_ASSERT (req); - if (!gf_xdr_to_cli_log_filename_req (req->msg[0], &cli_req)) { + if (!xdr_to_generic (req->msg[0], &cli_req, + (xdrproc_t)xdr_gf1_cli_log_filename_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -99,7 +101,8 @@ glusterd_handle_log_locate (rpcsvc_request_t *req) priv = THIS->private; - if (!gf_xdr_to_cli_log_locate_req (req->msg[0], &cli_req)) { + if (!xdr_to_generic (req->msg[0], &cli_req, + (xdrproc_t)xdr_gf1_cli_log_locate_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -172,7 +175,6 @@ out: rsp.path = "Operation failed"; ret = glusterd_submit_reply (req, &rsp, NULL, 0, NULL, - gf_xdr_serialize_cli_log_locate_rsp, (xdrproc_t)xdr_gf1_cli_log_locate_rsp); if (cli_req.brick) @@ -197,7 +199,8 @@ glusterd_handle_log_level (rpcsvc_request_t *req) GF_ASSERT(req); - if (!gf_xdr_to_cli_log_level_req(req->msg[0], &cli_req)) { + if (!xdr_to_generic (req->msg[0], &cli_req, + (xdrproc_t)xdr_gf1_cli_log_level_req)) { gf_log ("glusterd", GF_LOG_ERROR, "Failed to decode rpc message"); req->rpc_err = GARBAGE_ARGS; goto out; @@ -248,7 +251,8 @@ glusterd_handle_log_rotate (rpcsvc_request_t *req) GF_ASSERT (req); - if (!gf_xdr_to_cli_log_rotate_req (req->msg[0], &cli_req)) { + if (!xdr_to_generic (req->msg[0], &cli_req, + (xdrproc_t)xdr_gf1_cli_log_rotate_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c index a460582a0b7..7fe68ded0b3 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c @@ -47,7 +47,7 @@ #include "glusterd-store.h" #include "glusterd-volgen.h" #include "syscall.h" -#include "cli1.h" +#include "cli1-xdr.h" #include "common-utils.h" #include "run.h" diff --git a/xlators/mgmt/glusterd/src/glusterd-pmap.c b/xlators/mgmt/glusterd/src/glusterd-pmap.c index 2658cf40a22..871539a50c6 100644 --- a/xlators/mgmt/glusterd/src/glusterd-pmap.c +++ b/xlators/mgmt/glusterd/src/glusterd-pmap.c @@ -30,7 +30,8 @@ #include "glusterd.h" #include "glusterd-utils.h" -#include "portmap.h" +#include "portmap-xdr.h" +#include "xdr-generic.h" #include "protocol-common.h" #include "rpcsvc.h" @@ -290,27 +291,6 @@ out: return 0; } - -typedef ssize_t (*gfs_serialize_t) (struct iovec outmsg, void *data); - - -static int -xdr_to_glusterfs_req (rpcsvc_request_t *req, void *arg, gfs_serialize_t sfunc) -{ - int ret = -1; - - if (!req) - return -1; - - ret = sfunc (req->msg[0], arg); - - if (ret > 0) - ret = 0; - - return ret; -} - - int gluster_pmap_portbybrick (rpcsvc_request_t *req) { @@ -319,7 +299,8 @@ gluster_pmap_portbybrick (rpcsvc_request_t *req) char *brick = NULL; int port = 0; - if (xdr_to_glusterfs_req (req, &args, xdr_to_pmap_port_by_brick_req)) { + if (!xdr_to_generic (req->msg[0], &args, + (xdrproc_t)xdr_pmap_port_by_brick_req)) { req->rpc_err = GARBAGE_ARGS; goto fail; } @@ -335,7 +316,6 @@ gluster_pmap_portbybrick (rpcsvc_request_t *req) fail: glusterd_submit_reply (req, &rsp, NULL, 0, NULL, - (gd_serialize_t)xdr_from_pmap_port_by_brick_rsp, (xdrproc_t)xdr_pmap_port_by_brick_rsp); if (args.brick) free (args.brick);//malloced by xdr @@ -350,7 +330,8 @@ gluster_pmap_brickbyport (rpcsvc_request_t *req) pmap_brick_by_port_req args = {0,}; pmap_brick_by_port_rsp rsp = {0,}; - if (xdr_to_glusterfs_req (req, &args, xdr_to_pmap_brick_by_port_req)) { + if (!xdr_to_generic (req->msg[0], &args, + (xdrproc_t)xdr_pmap_brick_by_port_req)) { req->rpc_err = GARBAGE_ARGS; goto fail; } @@ -363,7 +344,6 @@ gluster_pmap_brickbyport (rpcsvc_request_t *req) fail: glusterd_submit_reply (req, &rsp, NULL, 0, NULL, - (gd_serialize_t)xdr_from_pmap_brick_by_port_rsp, (xdrproc_t)xdr_pmap_brick_by_port_rsp); return 0; @@ -385,7 +365,8 @@ gluster_pmap_signup (rpcsvc_request_t *req) pmap_signup_rsp rsp = {0,}; - if (xdr_to_glusterfs_req (req, &args, xdr_to_pmap_signup_req)) { + if (!xdr_to_generic (req->msg[0], &args, + (xdrproc_t)xdr_pmap_signup_req)) { req->rpc_err = GARBAGE_ARGS; goto fail; } @@ -395,7 +376,6 @@ gluster_pmap_signup (rpcsvc_request_t *req) fail: glusterd_submit_reply (req, &rsp, NULL, 0, NULL, - (gd_serialize_t)xdr_from_pmap_signup_rsp, (xdrproc_t)xdr_pmap_signup_rsp); if (args.brick) free (args.brick);//malloced by xdr @@ -411,7 +391,8 @@ gluster_pmap_signin (rpcsvc_request_t *req) glusterd_brickinfo_t *brickinfo = NULL; int ret = -1; - if (xdr_to_glusterfs_req (req, &args, xdr_to_pmap_signin_req)) { + if (!xdr_to_generic (req->msg[0], &args, + (xdrproc_t)xdr_pmap_signin_req)) { req->rpc_err = GARBAGE_ARGS; goto fail; } @@ -423,7 +404,6 @@ gluster_pmap_signin (rpcsvc_request_t *req) &brickinfo); fail: glusterd_submit_reply (req, &rsp, NULL, 0, NULL, - (gd_serialize_t)xdr_from_pmap_signin_rsp, (xdrproc_t)xdr_pmap_signin_rsp); if (args.brick) free (args.brick);//malloced by xdr @@ -444,7 +424,8 @@ gluster_pmap_signout (rpcsvc_request_t *req) int ret = -1; glusterd_brickinfo_t *brickinfo = NULL; - if (xdr_to_glusterfs_req (req, &args, xdr_to_pmap_signout_req)) { + if (!xdr_to_generic (req->msg[0], &args, + (xdrproc_t)xdr_pmap_signout_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto fail; @@ -457,7 +438,6 @@ gluster_pmap_signout (rpcsvc_request_t *req) &brickinfo); fail: glusterd_submit_reply (req, &rsp, NULL, 0, NULL, - (gd_serialize_t)xdr_from_pmap_signout_rsp, (xdrproc_t)xdr_pmap_signout_rsp); if (args.brick) free (args.brick);//malloced by xdr diff --git a/xlators/mgmt/glusterd/src/glusterd-quota.c b/xlators/mgmt/glusterd/src/glusterd-quota.c index 809b56efe23..c81a94501e3 100644 --- a/xlators/mgmt/glusterd/src/glusterd-quota.c +++ b/xlators/mgmt/glusterd/src/glusterd-quota.c @@ -23,7 +23,8 @@ #endif #include "common-utils.h" -#include "cli1.h" +#include "cli1-xdr.h" +#include "xdr-generic.h" #include "glusterd.h" #include "glusterd-op-sm.h" #include "glusterd-store.h" @@ -46,7 +47,8 @@ glusterd_handle_quota (rpcsvc_request_t *req) GF_ASSERT (req); - if (!gf_xdr_to_cli_quota_req (req->msg[0], &cli_req)) { + if (!xdr_to_generic (req->msg[0], &cli_req, + (xdrproc_t)xdr_gf1_cli_quota_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; diff --git a/xlators/mgmt/glusterd/src/glusterd-rebalance.c b/xlators/mgmt/glusterd/src/glusterd-rebalance.c index d09a83642e3..68cbab54b62 100644 --- a/xlators/mgmt/glusterd/src/glusterd-rebalance.c +++ b/xlators/mgmt/glusterd/src/glusterd-rebalance.c @@ -43,8 +43,8 @@ #include "run.h" #include "syscall.h" -#include "cli1.h" - +#include "cli1-xdr.h" +#include "xdr-generic.h" int gf_glusterd_rebalance_move_data (glusterd_volinfo_t *volinfo, const char *dir) @@ -574,7 +574,8 @@ glusterd_handle_defrag_volume_v2 (rpcsvc_request_t *req) GF_ASSERT (req); priv = THIS->private; - if (!gf_xdr_to_cli_defrag_vol_req (req->msg[0], &cli_req)) { + if (!xdr_to_generic (req->msg[0], &cli_req, + (xdrproc_t)xdr_gf1_cli_defrag_vol_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -615,7 +616,6 @@ glusterd_handle_defrag_volume_v2 (rpcsvc_request_t *req) out: ret = glusterd_submit_reply (req, &rsp, NULL, 0, NULL, - gf_xdr_serialize_cli_defrag_vol_rsp_v2, (xdrproc_t)xdr_gf2_cli_defrag_vol_rsp); if (cli_req.volname) free (cli_req.volname);//malloced by xdr @@ -638,7 +638,8 @@ glusterd_handle_defrag_volume (rpcsvc_request_t *req) priv = THIS->private; - if (!gf_xdr_to_cli_defrag_vol_req (req->msg[0], &cli_req)) { + if (!xdr_to_generic (req->msg[0], &cli_req, + (xdrproc_t)xdr_gf1_cli_defrag_vol_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -686,7 +687,6 @@ glusterd_handle_defrag_volume (rpcsvc_request_t *req) out: ret = glusterd_submit_reply (req, &rsp, NULL, 0, NULL, - gf_xdr_serialize_cli_defrag_vol_rsp, (xdrproc_t)xdr_gf1_cli_defrag_vol_rsp); if (cli_req.volname) free (cli_req.volname);//malloced by xdr diff --git a/xlators/mgmt/glusterd/src/glusterd-replace-brick.c b/xlators/mgmt/glusterd/src/glusterd-replace-brick.c index 16fd0bb82f8..f8f0e8a844d 100644 --- a/xlators/mgmt/glusterd/src/glusterd-replace-brick.c +++ b/xlators/mgmt/glusterd/src/glusterd-replace-brick.c @@ -23,7 +23,8 @@ #endif #include "common-utils.h" -#include "cli1.h" +#include "cli1-xdr.h" +#include "xdr-generic.h" #include "glusterd.h" #include "glusterd-op-sm.h" #include "glusterd-store.h" @@ -48,7 +49,8 @@ glusterd_handle_replace_brick (rpcsvc_request_t *req) GF_ASSERT (req); - if (!gf_xdr_to_cli_replace_brick_req (req->msg[0], &cli_req)) { + if (!xdr_to_generic (req->msg[0], &cli_req, + (xdrproc_t)xdr_gf1_cli_replace_brick_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; diff --git a/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c b/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c index 0ba0aad6339..06dff923bf8 100644 --- a/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c @@ -25,8 +25,9 @@ #include "rpc-clnt.h" #include "glusterd1-xdr.h" -#include "glusterd1.h" -#include "cli1.h" +#include "cli1-xdr.h" + +#include "xdr-generic.h" #include "compat-errno.h" #include "glusterd-op-sm.h" @@ -52,7 +53,6 @@ glusterd_op_send_cli_response (glusterd_op_t op, int32_t op_ret, void *op_ctx, char *op_errstr) { int32_t ret = -1; - gd_serialize_t sfunc = NULL; void *cli_rsp = NULL; dict_t *ctx = NULL; char *free_ptr = NULL; @@ -77,7 +77,6 @@ glusterd_op_send_cli_response (glusterd_op_t op, int32_t op_ret, else rsp.op_errstr = ""; cli_rsp = &rsp; - sfunc = gf_xdr_serialize_cli_create_vol_rsp; xdrproc = (xdrproc_t)xdr_gf1_cli_create_vol_rsp; break; } @@ -93,7 +92,6 @@ glusterd_op_send_cli_response (glusterd_op_t op, int32_t op_ret, else rsp.op_errstr = ""; cli_rsp = &rsp; - sfunc = gf_xdr_serialize_cli_start_vol_rsp; xdrproc = (xdrproc_t) xdr_gf1_cli_start_vol_rsp; break; } @@ -109,7 +107,6 @@ glusterd_op_send_cli_response (glusterd_op_t op, int32_t op_ret, else rsp.op_errstr = ""; cli_rsp = &rsp; - sfunc = gf_xdr_serialize_cli_stop_vol_rsp; xdrproc = (xdrproc_t) xdr_gf1_cli_stop_vol_rsp; break; } @@ -125,7 +122,6 @@ glusterd_op_send_cli_response (glusterd_op_t op, int32_t op_ret, else rsp.op_errstr = ""; cli_rsp = &rsp; - sfunc = gf_xdr_serialize_cli_delete_vol_rsp; xdrproc = (xdrproc_t) xdr_gf1_cli_delete_vol_rsp; break; } @@ -137,7 +133,6 @@ glusterd_op_send_cli_response (glusterd_op_t op, int32_t op_ret, rsp.op_errno = op_errno; //rsp.volname = ""; cli_rsp = &rsp; - sfunc = gf_xdr_serialize_cli_defrag_vol_rsp; xdrproc = (xdrproc_t) xdr_gf1_cli_defrag_vol_rsp; break; } @@ -153,7 +148,6 @@ glusterd_op_send_cli_response (glusterd_op_t op, int32_t op_ret, else rsp.op_errstr = ""; cli_rsp = &rsp; - sfunc = gf_xdr_serialize_cli_add_brick_rsp; xdrproc = (xdrproc_t) xdr_gf1_cli_add_brick_rsp; break; } @@ -169,7 +163,6 @@ glusterd_op_send_cli_response (glusterd_op_t op, int32_t op_ret, rsp.op_errno = op_errno; rsp.volname = ""; cli_rsp = &rsp; - sfunc = gf_xdr_serialize_cli_remove_brick_rsp; xdrproc = (xdrproc_t) xdr_gf1_cli_remove_brick_rsp; break; } @@ -189,7 +182,6 @@ glusterd_op_send_cli_response (glusterd_op_t op, int32_t op_ret, rsp.op_errstr = ""; rsp.volname = ""; cli_rsp = &rsp; - sfunc = gf_xdr_serialize_cli_replace_brick_rsp; xdrproc = (xdrproc_t) xdr_gf1_cli_replace_brick_rsp; break; } @@ -215,7 +207,6 @@ glusterd_op_send_cli_response (glusterd_op_t op, int32_t op_ret, } cli_rsp = &rsp; - sfunc = gf_xdr_serialize_cli_set_vol_rsp; xdrproc = (xdrproc_t) xdr_gf1_cli_set_vol_rsp; break; } @@ -232,7 +223,6 @@ glusterd_op_send_cli_response (glusterd_op_t op, int32_t op_ret, else rsp.op_errstr = "Error while resetting options"; cli_rsp = &rsp; - sfunc = gf_xdr_serialize_cli_reset_vol_rsp; xdrproc = (xdrproc_t) xdr_gf1_cli_reset_vol_rsp; break; } @@ -247,7 +237,6 @@ glusterd_op_send_cli_response (glusterd_op_t op, int32_t op_ret, else rsp.errstr = ""; cli_rsp = &rsp; - sfunc = gf_xdr_serialize_cli_log_filename_rsp; xdrproc = (xdrproc_t) xdr_gf1_cli_log_filename_rsp; break; } @@ -261,7 +250,6 @@ glusterd_op_send_cli_response (glusterd_op_t op, int32_t op_ret, else rsp.errstr = ""; cli_rsp = &rsp; - sfunc = gf_xdr_serialize_cli_log_rotate_rsp; xdrproc = (xdrproc_t) xdr_gf1_cli_log_rotate_rsp; break; } @@ -275,7 +263,6 @@ glusterd_op_send_cli_response (glusterd_op_t op, int32_t op_ret, else rsp.op_errstr = ""; cli_rsp = &rsp; - sfunc = gf_xdr_from_cli_sync_volume_rsp; xdrproc = (xdrproc_t) xdr_gf1_cli_sync_volume_rsp; break; } @@ -310,7 +297,6 @@ glusterd_op_send_cli_response (glusterd_op_t op, int32_t op_ret, if (op_errstr) rsp.op_errstr = op_errstr; cli_rsp = &rsp; - sfunc = gf_xdr_serialize_cli_gsync_set_rsp; xdrproc = (xdrproc_t) xdr_gf1_cli_gsync_set_rsp; break; } @@ -337,7 +323,6 @@ glusterd_op_send_cli_response (glusterd_op_t op, int32_t op_ret, (size_t*)&rsp.stats_info.stats_info_len); free_ptr = rsp.stats_info.stats_info_val; cli_rsp = &rsp; - sfunc = gf_xdr_from_cli_stats_volume_rsp; xdrproc = (xdrproc_t) xdr_gf1_cli_stats_volume_rsp; break; } @@ -386,7 +371,6 @@ glusterd_op_send_cli_response (glusterd_op_t op, int32_t op_ret, } } cli_rsp = &rsp; - sfunc = gf_xdr_serialize_cli_quota_rsp; xdrproc = (xdrproc_t) xdr_gf1_cli_quota_rsp; break; } @@ -402,7 +386,6 @@ glusterd_op_send_cli_response (glusterd_op_t op, int32_t op_ret, rsp.op_errstr = ""; cli_rsp = &rsp; - sfunc = gf_xdr_serialize_cli_log_level_rsp; xdrproc = (xdrproc_t) xdr_gf1_cli_log_level_rsp; break; } @@ -423,7 +406,6 @@ glusterd_op_send_cli_response (glusterd_op_t op, int32_t op_ret, (size_t*)&rsp.dict.dict_len); free_ptr = rsp.dict.dict_val; cli_rsp = &rsp; - sfunc = gf_xdr_serialize_cli_status_volume_rsp; xdrproc = (xdrproc_t) xdr_gf1_cli_status_volume_rsp; break; } @@ -436,7 +418,7 @@ glusterd_op_send_cli_response (glusterd_op_t op, int32_t op_ret, } ret = glusterd_submit_reply (req, cli_rsp, NULL, 0, NULL, - sfunc, xdrproc); + xdrproc); if (free_ptr) GF_FREE (free_ptr); @@ -461,7 +443,7 @@ glusterd3_1_probe_cbk (struct rpc_req *req, struct iovec *iov, goto out; } - ret = gd_xdr_to_mgmt_probe_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gd1_mgmt_probe_rsp); if (ret < 0) { gf_log ("", GF_LOG_ERROR, "error"); //rsp.op_ret = -1; @@ -548,7 +530,7 @@ glusterd3_1_friend_add_cbk (struct rpc_req * req, struct iovec *iov, goto out; } - ret = gd_xdr_to_mgmt_friend_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gd1_mgmt_friend_rsp); if (ret < 0) { gf_log ("", GF_LOG_ERROR, "error"); rsp.op_ret = -1; @@ -648,7 +630,7 @@ glusterd3_1_friend_remove_cbk (struct rpc_req * req, struct iovec *iov, goto inject; } - ret = gd_xdr_to_mgmt_friend_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gd1_mgmt_friend_rsp); if (ret < 0) { gf_log ("", GF_LOG_ERROR, "error"); rsp.op_ret = -1; @@ -730,7 +712,7 @@ glusterd3_1_friend_update_cbk (struct rpc_req *req, struct iovec *iov, goto out; } -/* ret = gd_xdr_to_mgmt_friend_update_rsp (*iov, &rsp); +/* ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gd1_mgmt_friend_update_rsp); if (ret < 0) { gf_log ("", GF_LOG_ERROR, "error"); rsp.op_ret = -1; @@ -768,7 +750,7 @@ glusterd3_1_cluster_lock_cbk (struct rpc_req *req, struct iovec *iov, goto out; } - ret = gd_xdr_to_mgmt_cluster_lock_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gd1_mgmt_cluster_lock_rsp); if (ret < 0) { gf_log ("", GF_LOG_ERROR, "error"); rsp.op_ret = -1; @@ -827,7 +809,7 @@ glusterd3_1_cluster_unlock_cbk (struct rpc_req *req, struct iovec *iov, goto out; } - ret = gd_xdr_to_mgmt_cluster_unlock_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gd1_mgmt_cluster_unlock_rsp); if (ret < 0) { gf_log ("", GF_LOG_ERROR, "error"); rsp.op_ret = -1; @@ -1078,7 +1060,7 @@ glusterd3_1_stage_op_cbk (struct rpc_req *req, struct iovec *iov, goto out; } - ret = gd_xdr_to_mgmt_stage_op_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gd1_mgmt_stage_op_rsp); if (ret < 0) { gf_log ("", GF_LOG_ERROR, "error"); rsp.op_ret = -1; @@ -1319,7 +1301,7 @@ glusterd3_1_commit_op_cbk (struct rpc_req *req, struct iovec *iov, goto out; } - ret = gd_xdr_to_mgmt_commit_op_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gd1_mgmt_commit_op_rsp); if (ret < 0) { gf_log ("", GF_LOG_ERROR, "error"); rsp.op_ret = -1; @@ -1473,8 +1455,7 @@ glusterd3_1_probe (call_frame_t *frame, xlator_t *this, ret = glusterd_submit_request (peerinfo->rpc, &req, frame, peerinfo->mgmt, GD_MGMT_PROBE_QUERY, - NULL, gd_xdr_from_mgmt_probe_req, - this, glusterd3_1_probe_cbk, + NULL, this, glusterd3_1_probe_cbk, (xdrproc_t)xdr_gd1_mgmt_probe_req); out: @@ -1527,8 +1508,7 @@ glusterd3_1_friend_add (call_frame_t *frame, xlator_t *this, ret = glusterd_submit_request (peerinfo->rpc, &req, frame, peerinfo->mgmt, GD_MGMT_FRIEND_ADD, - NULL, gd_xdr_from_mgmt_friend_req, - this, glusterd3_1_friend_add_cbk, + NULL, this, glusterd3_1_friend_add_cbk, (xdrproc_t)xdr_gd1_mgmt_friend_req); @@ -1569,8 +1549,7 @@ glusterd3_1_friend_remove (call_frame_t *frame, xlator_t *this, req.hostname = peerinfo->hostname; req.port = peerinfo->port; ret = glusterd_submit_request (peerinfo->rpc, &req, frame, peerinfo->mgmt, - GD_MGMT_FRIEND_REMOVE, - NULL, gd_xdr_from_mgmt_friend_req, + GD_MGMT_FRIEND_REMOVE, NULL, this, glusterd3_1_friend_remove_cbk, (xdrproc_t)xdr_gd1_mgmt_friend_req); @@ -1616,8 +1595,7 @@ glusterd3_1_friend_update (call_frame_t *frame, xlator_t *this, dummy_frame = create_frame (this, this->ctx->pool); ret = glusterd_submit_request (peerinfo->rpc, &req, dummy_frame, peerinfo->mgmt, - GD_MGMT_FRIEND_UPDATE, - NULL, gd_xdr_from_mgmt_friend_update, + GD_MGMT_FRIEND_UPDATE, NULL, this, glusterd3_1_friend_update_cbk, (xdrproc_t)xdr_gd1_mgmt_friend_update); @@ -1656,7 +1634,6 @@ glusterd3_1_cluster_lock (call_frame_t *frame, xlator_t *this, ret = glusterd_submit_request (peerinfo->rpc, &req, dummy_frame, peerinfo->mgmt, GD_MGMT_CLUSTER_LOCK, NULL, - gd_xdr_from_mgmt_cluster_lock_req, this, glusterd3_1_cluster_lock_cbk, (xdrproc_t)xdr_gd1_mgmt_cluster_lock_req); out: @@ -1691,7 +1668,6 @@ glusterd3_1_cluster_unlock (call_frame_t *frame, xlator_t *this, ret = glusterd_submit_request (peerinfo->rpc, &req, dummy_frame, peerinfo->mgmt, GD_MGMT_CLUSTER_UNLOCK, NULL, - gd_xdr_from_mgmt_cluster_unlock_req, this, glusterd3_1_cluster_unlock_cbk, (xdrproc_t)xdr_gd1_mgmt_cluster_unlock_req); out: @@ -1751,7 +1727,6 @@ glusterd3_1_stage_op (call_frame_t *frame, xlator_t *this, ret = glusterd_submit_request (peerinfo->rpc, &req, dummy_frame, peerinfo->mgmt, GD_MGMT_STAGE_OP, NULL, - gd_xdr_from_mgmt_stage_op_req, this, glusterd3_1_stage_op_cbk, (xdrproc_t)xdr_gd1_mgmt_stage_op_req); @@ -1814,7 +1789,6 @@ glusterd3_1_commit_op (call_frame_t *frame, xlator_t *this, ret = glusterd_submit_request (peerinfo->rpc, &req, dummy_frame, peerinfo->mgmt, GD_MGMT_COMMIT_OP, NULL, - gd_xdr_from_mgmt_commit_op_req, this, glusterd3_1_commit_op_cbk, (xdrproc_t)xdr_gd1_mgmt_commit_op_req); @@ -1874,7 +1848,7 @@ glusterd3_1_brick_op_cbk (struct rpc_req *req, struct iovec *iov, goto out; } - ret = gd_xdr_to_mgmt_brick_op_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gd1_mgmt_brick_op_rsp); if (ret < 0) { gf_log ("", GF_LOG_ERROR, "error"); rsp.op_ret = -1; @@ -2044,7 +2018,6 @@ glusterd3_1_brick_op (call_frame_t *frame, xlator_t *this, ret = glusterd_submit_request (brickinfo->rpc, req, dummy_frame, &glusterd_glusterfs_3_1_mgmt_prog, req->op, NULL, - gd_xdr_from_mgmt_brick_op_req, this, glusterd3_1_brick_op_cbk, (xdrproc_t)xdr_gd1_mgmt_brick_op_req); if (req) { diff --git a/xlators/mgmt/glusterd/src/glusterd-store.c b/xlators/mgmt/glusterd/src/glusterd-store.c index f0164849e52..53fdcf484fa 100644 --- a/xlators/mgmt/glusterd/src/glusterd-store.c +++ b/xlators/mgmt/glusterd/src/glusterd-store.c @@ -44,8 +44,6 @@ #include "glusterd-utils.h" #include "glusterd-store.h" -#include "glusterd1.h" -#include "cli1.h" #include "rpc-clnt.h" #include "common-utils.h" diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 589bbbe2001..eaae6b7fb1c 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -46,6 +46,8 @@ #include "glusterd-volgen.h" #include "glusterd-pmap.h" +#include "xdr-generic.h" + #include <sys/resource.h> #include <inttypes.h> #include <signal.h> @@ -306,8 +308,7 @@ int glusterd_submit_request (struct rpc_clnt *rpc, void *req, call_frame_t *frame, rpc_clnt_prog_t *prog, int procnum, struct iobref *iobref, - gd_serialize_t sfunc, xlator_t *this, - fop_cbk_fn_t cbkfn, xdrproc_t xdrproc) + xlator_t *this, fop_cbk_fn_t cbkfn, xdrproc_t xdrproc) { int ret = -1; struct iobuf *iobuf = NULL; @@ -319,35 +320,36 @@ glusterd_submit_request (struct rpc_clnt *rpc, void *req, GF_ASSERT (rpc); GF_ASSERT (this); - req_size = xdr_sizeof (xdrproc, req); - iobuf = iobuf_get2 (this->ctx->iobuf_pool, req_size); - if (!iobuf) { - goto out; - }; + if (req) { + req_size = xdr_sizeof (xdrproc, req); + iobuf = iobuf_get2 (this->ctx->iobuf_pool, req_size); + if (!iobuf) { + goto out; + }; - if (!iobref) { - iobref = iobref_new (); if (!iobref) { - goto out; - } + iobref = iobref_new (); + if (!iobref) { + goto out; + } - new_iobref = 1; - } + new_iobref = 1; + } - iobref_add (iobref, iobuf); + iobref_add (iobref, iobuf); - iov.iov_base = iobuf->ptr; - iov.iov_len = iobuf_pagesize (iobuf); + iov.iov_base = iobuf->ptr; + iov.iov_len = iobuf_pagesize (iobuf); - /* Create the xdr payload */ - if (req && sfunc) { - ret = sfunc (iov, req); + /* Create the xdr payload */ + ret = xdr_serialize_generic (iov, req, xdrproc); if (ret == -1) { goto out; } iov.iov_len = ret; count = 1; } + /* Send the msg */ ret = rpc_clnt_submit (rpc, prog, procnum, cbkfn, &iov, count, @@ -379,8 +381,7 @@ out: struct iobuf * glusterd_serialize_reply (rpcsvc_request_t *req, void *arg, - gd_serialize_t sfunc, struct iovec *outmsg, - xdrproc_t xdrproc) + struct iovec *outmsg, xdrproc_t xdrproc) { struct iobuf *iob = NULL; ssize_t retlen = -1; @@ -403,7 +404,7 @@ glusterd_serialize_reply (rpcsvc_request_t *req, void *arg, /* retlen is used to received the error since size_t is unsigned and we * need -1 for error notification during encoding. */ - retlen = sfunc (*outmsg, arg); + retlen = xdr_serialize_generic (*outmsg, arg, xdrproc); if (retlen == -1) { gf_log ("", GF_LOG_ERROR, "Failed to encode message"); goto ret; @@ -422,8 +423,7 @@ ret: int glusterd_submit_reply (rpcsvc_request_t *req, void *arg, struct iovec *payload, int payloadcount, - struct iobref *iobref, gd_serialize_t sfunc, - xdrproc_t xdrproc) + struct iobref *iobref, xdrproc_t xdrproc) { struct iobuf *iob = NULL; int ret = -1; @@ -435,7 +435,6 @@ glusterd_submit_reply (rpcsvc_request_t *req, void *arg, goto out; } - if (!iobref) { iobref = iobref_new (); if (!iobref) { @@ -446,7 +445,7 @@ glusterd_submit_reply (rpcsvc_request_t *req, void *arg, new_iobref = 1; } - iob = glusterd_serialize_reply (req, arg, sfunc, &rsp, xdrproc); + iob = glusterd_serialize_reply (req, arg, &rsp, xdrproc); if (!iob) { gf_log ("", GF_LOG_ERROR, "Failed to serialize reply"); } else { diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.h b/xlators/mgmt/glusterd/src/glusterd-utils.h index 1a4dadf1f10..57e5c82f4d5 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.h +++ b/xlators/mgmt/glusterd/src/glusterd-utils.h @@ -71,15 +71,13 @@ glusterd_get_uuid (uuid_t *uuid); int glusterd_submit_reply (rpcsvc_request_t *req, void *arg, struct iovec *payload, int payloadcount, - struct iobref *iobref, gd_serialize_t sfunc, - xdrproc_t xdrproc); + struct iobref *iobref, xdrproc_t xdrproc); int glusterd_submit_request (struct rpc_clnt *rpc, void *req, call_frame_t *frame, rpc_clnt_prog_t *prog, int procnum, struct iobref *iobref, - gd_serialize_t sfunc, xlator_t *this, - fop_cbk_fn_t cbkfn, xdrproc_t xdrproc); + xlator_t *this, fop_cbk_fn_t cbkfn, xdrproc_t xdrproc); int32_t glusterd_volinfo_new (glusterd_volinfo_t **volinfo); diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c index 050a02e4bd6..9f1ebe01381 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volgen.c +++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c @@ -38,7 +38,7 @@ #include "graph-utils.h" #include "trie.h" #include "glusterd-mem-types.h" -#include "cli1.h" +#include "cli1-xdr.h" #include "glusterd-volgen.h" #include "glusterd-op-sm.h" #include "glusterd-utils.h" diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c index 1e467030431..d7b28ba1e84 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c @@ -23,7 +23,8 @@ #endif #include "common-utils.h" -#include "cli1.h" +#include "cli1-xdr.h" +#include "xdr-generic.h" #include "glusterd.h" #include "glusterd-op-sm.h" #include "glusterd-store.h" @@ -69,7 +70,8 @@ glusterd_handle_create_volume (rpcsvc_request_t *req) priv = this->private; ret = -1; - if (!gf_xdr_to_cli_create_vol_req (req->msg[0], &cli_req)) { + if (!xdr_to_generic (req->msg[0], &cli_req, + (xdrproc_t)xdr_gf1_cli_create_vol_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; snprintf (err_str, sizeof (err_str), "Garbage args received"); @@ -204,7 +206,6 @@ out: rsp.op_errstr = err_str; cli_rsp = &rsp; glusterd_submit_reply(req, cli_rsp, NULL, 0, NULL, - gf_xdr_serialize_cli_create_vol_rsp, (xdrproc_t)xdr_gf1_cli_create_vol_rsp); ret = 0; //Client response sent, prevent second response @@ -236,7 +237,8 @@ glusterd_handle_cli_start_volume (rpcsvc_request_t *req) GF_ASSERT (req); - if (!gf_xdr_to_cli_start_vol_req (req->msg[0], &cli_req)) { + if (!xdr_to_generic (req->msg[0], &cli_req, + (xdrproc_t)xdr_gf1_cli_start_vol_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -294,7 +296,8 @@ glusterd_handle_cli_stop_volume (rpcsvc_request_t *req) GF_ASSERT (req); - if (!gf_xdr_to_cli_stop_vol_req (req->msg[0], &cli_req)) { + if (!xdr_to_generic (req->msg[0], &cli_req, + (xdrproc_t)xdr_gf1_cli_stop_vol_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -351,7 +354,8 @@ glusterd_handle_cli_delete_volume (rpcsvc_request_t *req) GF_ASSERT (req); - if (!gf_xdr_to_cli_delete_vol_req (req->msg[0], &cli_req)) { + if (!xdr_to_generic (req->msg[0], &cli_req, + (xdrproc_t)xdr_gf1_cli_delete_vol_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; diff --git a/xlators/protocol/client/src/client-handshake.c b/xlators/protocol/client/src/client-handshake.c index 93be689118f..6f3dc8642bf 100644 --- a/xlators/protocol/client/src/client-handshake.c +++ b/xlators/protocol/client/src/client-handshake.c @@ -30,7 +30,7 @@ #include "compat-errno.h" #include "glusterfs3.h" -#include "portmap.h" +#include "portmap-xdr.h" extern rpc_clnt_prog_t clnt3_1_fop_prog; extern rpc_clnt_prog_t clnt_pmap_prog; @@ -211,8 +211,8 @@ client_start_ping (void *data) goto fail; ret = client_submit_request (this, NULL, frame, conf->handshake, - GF_HNDSK_PING, client_ping_cbk, NULL, NULL, - NULL, 0, NULL, 0, NULL, NULL); + GF_HNDSK_PING, client_ping_cbk, NULL, + NULL, 0, NULL, 0, NULL, (xdrproc_t)NULL); if (ret) goto fail; @@ -316,7 +316,7 @@ client3_getspec_cbk (struct rpc_req *req, struct iovec *iov, int count, goto out; } - ret = xdr_to_getspec_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf_getspec_rsp); if (ret < 0) { gf_log (frame->this->name, GF_LOG_ERROR, "XDR decoding failed, returning EINVAL"); @@ -359,8 +359,7 @@ int32_t client3_getspec (call_frame_t *frame, xlator_t *this, void *data) ret = client_submit_request (this, &req, frame, conf->handshake, GF_HNDSK_GETSPEC, client3_getspec_cbk, - NULL, xdr_from_getspec_req, NULL, 0, - NULL, 0, NULL, + NULL, NULL, 0, NULL, 0, NULL, (xdrproc_t)xdr_gf_getspec_req); if (ret) @@ -418,7 +417,7 @@ client3_1_reopen_cbk (struct rpc_req *req, struct iovec *iov, int count, goto out; } - ret = xdr_to_open_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_open_rsp); if (ret < 0) { gf_log (frame->this->name, GF_LOG_ERROR, "XDR decoding failed"); rsp.op_ret = -1; @@ -520,7 +519,7 @@ client3_1_reopendir_cbk (struct rpc_req *req, struct iovec *iov, int count, goto out; } - ret = xdr_to_opendir_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_opendir_rsp); if (ret < 0) { gf_log (frame->this->name, GF_LOG_ERROR, "XDR decoding failed"); rsp.op_ret = -1; @@ -633,8 +632,7 @@ protocol_client_reopendir (xlator_t *this, clnt_fd_ctx_t *fdctx) ret = client_submit_request (this, &req, frame, conf->fops, GFS3_OP_OPENDIR, client3_1_reopendir_cbk, NULL, - xdr_from_opendir_req, NULL, 0, NULL, 0, - NULL, + NULL, 0, NULL, 0, NULL, (xdrproc_t)xdr_gfs3_opendir_req); if (ret) goto out; @@ -716,7 +714,7 @@ protocol_client_reopen (xlator_t *this, clnt_fd_ctx_t *fdctx) local = NULL; ret = client_submit_request (this, &req, frame, conf->fops, GFS3_OP_OPEN, client3_1_reopen_cbk, NULL, - xdr_from_open_req, NULL, 0, NULL, 0, NULL, + NULL, 0, NULL, 0, NULL, (xdrproc_t)xdr_gfs3_open_req); if (ret) goto out; @@ -828,7 +826,7 @@ client_setvolume_cbk (struct rpc_req *req, struct iovec *iov, int count, void *m goto out; } - ret = xdr_to_setvolume_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf_setvolume_rsp); if (ret < 0) { gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed"); op_ret = -1; @@ -1042,8 +1040,7 @@ client_setvolume (xlator_t *this, struct rpc_clnt *rpc) ret = client_submit_request (this, &req, fr, conf->handshake, GF_HNDSK_SETVOLUME, client_setvolume_cbk, - NULL, xdr_from_setvolume_req, NULL, 0, - NULL, 0, NULL, + NULL, NULL, 0, NULL, 0, NULL, (xdrproc_t)xdr_gf_setvolume_req); fail: @@ -1148,7 +1145,7 @@ client_query_portmap_cbk (struct rpc_req *req, struct iovec *iov, int count, voi goto out; } - ret = xdr_to_pmap_port_by_brick_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_pmap_port_by_brick_rsp); if (ret < 0) { gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed"); goto out; @@ -1236,8 +1233,7 @@ client_query_portmap (xlator_t *this, struct rpc_clnt *rpc) ret = client_submit_request (this, &req, fr, &clnt_pmap_prog, GF_PMAP_PORTBYBRICK, client_query_portmap_cbk, - NULL, xdr_from_pmap_port_by_brick_req, - NULL, 0, NULL, 0, NULL, + NULL, NULL, 0, NULL, 0, NULL, (xdrproc_t)xdr_pmap_port_by_brick_req); fail: @@ -1265,7 +1261,7 @@ client_dump_version_cbk (struct rpc_req *req, struct iovec *iov, int count, goto out; } - ret = xdr_to_dump_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf_dump_rsp); if (ret < 0) { gf_log (frame->this->name, GF_LOG_ERROR, "XDR decoding failed"); goto out; @@ -1333,7 +1329,7 @@ client_handshake (xlator_t *this, struct rpc_clnt *rpc) req.gfs_id = 0xbabe; ret = client_submit_request (this, &req, frame, conf->dump, GF_DUMP_DUMP, client_dump_version_cbk, - NULL, xdr_from_dump_req, NULL, 0, NULL, 0, + NULL, NULL, 0, NULL, 0, NULL, (xdrproc_t)xdr_gf_dump_req); out: diff --git a/xlators/protocol/client/src/client.c b/xlators/protocol/client/src/client.c index 77e3f5413a1..971cd08b074 100644 --- a/xlators/protocol/client/src/client.c +++ b/xlators/protocol/client/src/client.c @@ -44,10 +44,10 @@ int client_destroy_rpc (xlator_t *this); int client_submit_request (xlator_t *this, void *req, call_frame_t *frame, rpc_clnt_prog_t *prog, int procnum, fop_cbk_fn_t cbk, - struct iobref *iobref, gfs_serialize_t sfunc, - struct iovec *rsphdr, int rsphdr_count, - struct iovec *rsp_payload, int rsp_payload_count, - struct iobref *rsp_iobref, xdrproc_t xdrproc) + struct iobref *iobref, struct iovec *rsphdr, + int rsphdr_count, struct iovec *rsp_payload, + int rsp_payload_count, struct iobref *rsp_iobref, + xdrproc_t xdrproc) { int ret = -1; clnt_conf_t *conf = NULL; @@ -111,18 +111,16 @@ client_submit_request (xlator_t *this, void *req, call_frame_t *frame, iov.iov_len = iobuf_size (iobuf); /* Create the xdr payload */ - if (sfunc) { - ret = sfunc (iov, req); - if (ret == -1) { - /* callingfn so that, we can get to know which xdr - function was called */ - gf_log_callingfn (this->name, GF_LOG_WARNING, - "XDR payload creation failed"); - goto out; - } - iov.iov_len = ret; - count = 1; + ret = xdr_serialize_generic (iov, req, xdrproc); + if (ret == -1) { + /* callingfn so that, we can get to know which xdr + function was called */ + gf_log_callingfn (this->name, GF_LOG_WARNING, + "XDR payload creation failed"); + goto out; } + iov.iov_len = ret; + count = 1; } /* Send the msg */ diff --git a/xlators/protocol/client/src/client.h b/xlators/protocol/client/src/client.h index 328e1ca2431..1322aebf961 100644 --- a/xlators/protocol/client/src/client.h +++ b/xlators/protocol/client/src/client.h @@ -161,7 +161,7 @@ int client_local_wipe (clnt_local_t *local); int client_submit_request (xlator_t *this, void *req, call_frame_t *frame, rpc_clnt_prog_t *prog, int procnum, fop_cbk_fn_t cbk, - struct iobref *iobref, gfs_serialize_t sfunc, + struct iobref *iobref, struct iovec *rsphdr, int rsphdr_count, struct iovec *rsp_payload, int rsp_count, struct iobref *rsp_iobref, xdrproc_t xdrproc); diff --git a/xlators/protocol/client/src/client3_1-fops.c b/xlators/protocol/client/src/client3_1-fops.c index c1a7f4e43e9..d55a614e5e1 100644 --- a/xlators/protocol/client/src/client3_1-fops.c +++ b/xlators/protocol/client/src/client3_1-fops.c @@ -35,8 +35,7 @@ int client_submit_vec_request (xlator_t *this, void *req, call_frame_t *frame, rpc_clnt_prog_t *prog, int procnum, fop_cbk_fn_t cbk, struct iovec *payload, int payloadcnt, - struct iobref *iobref, gfs_serialize_t sfunc, - xdrproc_t xdrproc) + struct iobref *iobref, xdrproc_t xdrproc) { int ret = 0; clnt_conf_t *conf = NULL; @@ -83,18 +82,17 @@ client_submit_vec_request (xlator_t *this, void *req, call_frame_t *frame, iov.iov_len = iobuf_size (iobuf); /* Create the xdr payload */ - if (sfunc) { - ret = sfunc (iov, req); - if (ret == -1) { - gf_log_callingfn ("", GF_LOG_WARNING, - "XDR function failed"); - goto out; - } - - iov.iov_len = ret; - count = 1; + ret = xdr_serialize_generic (iov, req, xdrproc); + if (ret == -1) { + gf_log_callingfn ("", GF_LOG_WARNING, + "XDR function failed"); + goto out; } + + iov.iov_len = ret; + count = 1; } + /* Send the msg */ ret = rpc_clnt_submit (conf->rpc, prog, procnum, cbk, &iov, count, payload, payloadcnt, new_iobref, frame, NULL, 0, @@ -155,7 +153,7 @@ client3_1_symlink_cbk (struct rpc_req *req, struct iovec *iov, int count, rsp.op_errno = ENOTCONN; goto out; } - ret = xdr_to_symlink_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_symlink_rsp); if (ret < 0) { gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed"); rsp.op_ret = -1; @@ -214,7 +212,7 @@ client3_1_mknod_cbk (struct rpc_req *req, struct iovec *iov, int count, rsp.op_errno = ENOTCONN; goto out; } - ret = xdr_to_mknod_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_mknod_rsp); if (ret < 0) { gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed"); rsp.op_ret = -1; @@ -272,7 +270,7 @@ client3_1_mkdir_cbk (struct rpc_req *req, struct iovec *iov, int count, rsp.op_errno = ENOTCONN; goto out; } - ret = xdr_to_mkdir_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_mkdir_rsp); if (ret < 0) { gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed"); rsp.op_ret = -1; @@ -329,7 +327,7 @@ client3_1_open_cbk (struct rpc_req *req, struct iovec *iov, int count, rsp.op_errno = ENOTCONN; goto out; } - ret = xdr_to_open_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_open_rsp); if (ret < 0) { gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed"); rsp.op_ret = -1; @@ -397,7 +395,7 @@ client3_1_stat_cbk (struct rpc_req *req, struct iovec *iov, int count, rsp.op_errno = ENOTCONN; goto out; } - ret = xdr_to_stat_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_stat_rsp); if (ret < 0) { gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed"); rsp.op_ret = -1; @@ -439,7 +437,7 @@ client3_1_readlink_cbk (struct rpc_req *req, struct iovec *iov, int count, rsp.op_errno = ENOTCONN; goto out; } - ret = xdr_to_readlink_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_readlink_rsp); if (ret < 0) { gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed"); rsp.op_ret = -1; @@ -487,7 +485,7 @@ client3_1_unlink_cbk (struct rpc_req *req, struct iovec *iov, int count, rsp.op_errno = ENOTCONN; goto out; } - ret = xdr_to_unlink_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_unlink_rsp); if (ret < 0) { gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed"); rsp.op_ret = -1; @@ -532,7 +530,7 @@ client3_1_rmdir_cbk (struct rpc_req *req, struct iovec *iov, int count, rsp.op_errno = ENOTCONN; goto out; } - ret = xdr_to_rmdir_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_rmdir_rsp); if (ret < 0) { gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed"); rsp.op_ret = -1; @@ -578,7 +576,7 @@ client3_1_truncate_cbk (struct rpc_req *req, struct iovec *iov, int count, rsp.op_errno = ENOTCONN; goto out; } - ret = xdr_to_truncate_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_truncate_rsp); if (ret < 0) { gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed"); rsp.op_ret = -1; @@ -623,7 +621,7 @@ client3_1_statfs_cbk (struct rpc_req *req, struct iovec *iov, int count, rsp.op_errno = ENOTCONN; goto out; } - ret = xdr_to_statfs_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_statfs_rsp); if (ret < 0) { gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed"); rsp.op_ret = -1; @@ -668,7 +666,7 @@ client3_1_writev_cbk (struct rpc_req *req, struct iovec *iov, int count, goto out; } - ret = xdr_to_truncate_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_truncate_rsp); if (ret < 0) { gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed"); rsp.op_ret = -1; @@ -712,7 +710,7 @@ client3_1_flush_cbk (struct rpc_req *req, struct iovec *iov, int count, rsp.op_errno = ENOTCONN; goto out; } - ret = xdr_to_common_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf_common_rsp); if (ret < 0) { gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed"); rsp.op_ret = -1; @@ -764,7 +762,7 @@ client3_1_fsync_cbk (struct rpc_req *req, struct iovec *iov, int count, goto out; } - ret = xdr_to_truncate_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_truncate_rsp); if (ret < 0) { gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed"); rsp.op_ret = -1; @@ -808,7 +806,7 @@ client3_1_setxattr_cbk (struct rpc_req *req, struct iovec *iov, int count, goto out; } - ret = xdr_to_common_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf_common_rsp); if (ret < 0) { gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed"); rsp.op_ret = -1; @@ -854,7 +852,7 @@ client3_1_getxattr_cbk (struct rpc_req *req, struct iovec *iov, int count, goto out; } - ret = xdr_to_getxattr_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_getxattr_rsp); if (ret < 0) { gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed"); op_ret = -1; @@ -939,7 +937,7 @@ client3_1_fgetxattr_cbk (struct rpc_req *req, struct iovec *iov, int count, op_errno = ENOTCONN; goto out; } - ret = xdr_to_fgetxattr_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_fgetxattr_rsp); if (ret < 0) { gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed"); op_ret = -1; @@ -1015,7 +1013,7 @@ client3_1_removexattr_cbk (struct rpc_req *req, struct iovec *iov, int count, goto out; } - ret = xdr_to_common_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf_common_rsp); if (ret < 0) { gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed"); rsp.op_ret = -1; @@ -1052,7 +1050,7 @@ client3_1_fsyncdir_cbk (struct rpc_req *req, struct iovec *iov, int count, rsp.op_errno = ENOTCONN; goto out; } - ret = xdr_to_common_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf_common_rsp); if (ret < 0) { gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed"); rsp.op_ret = -1; @@ -1089,7 +1087,7 @@ client3_1_access_cbk (struct rpc_req *req, struct iovec *iov, int count, rsp.op_errno = ENOTCONN; goto out; } - ret = xdr_to_common_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf_common_rsp); if (ret < 0) { gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed"); rsp.op_ret = -1; @@ -1129,7 +1127,7 @@ client3_1_ftruncate_cbk (struct rpc_req *req, struct iovec *iov, int count, rsp.op_errno = ENOTCONN; goto out; } - ret = xdr_to_ftruncate_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_ftruncate_rsp); if (ret < 0) { gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed"); rsp.op_ret = -1; @@ -1173,7 +1171,7 @@ client3_1_fstat_cbk (struct rpc_req *req, struct iovec *iov, int count, rsp.op_errno = ENOTCONN; goto out; } - ret = xdr_to_fstat_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_fstat_rsp); if (ret < 0) { gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed"); rsp.op_ret = -1; @@ -1215,7 +1213,7 @@ client3_1_inodelk_cbk (struct rpc_req *req, struct iovec *iov, int count, rsp.op_errno = ENOTCONN; goto out; } - ret = xdr_to_common_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf_common_rsp); if (ret < 0) { gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed"); rsp.op_ret = -1; @@ -1253,7 +1251,7 @@ client3_1_finodelk_cbk (struct rpc_req *req, struct iovec *iov, int count, rsp.op_errno = ENOTCONN; goto out; } - ret = xdr_to_common_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf_common_rsp); if (ret < 0) { gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed"); rsp.op_ret = -1; @@ -1291,7 +1289,7 @@ client3_1_entrylk_cbk (struct rpc_req *req, struct iovec *iov, int count, rsp.op_errno = ENOTCONN; goto out; } - ret = xdr_to_common_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf_common_rsp); if (ret < 0) { gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed"); rsp.op_ret = -1; @@ -1330,7 +1328,7 @@ client3_1_fentrylk_cbk (struct rpc_req *req, struct iovec *iov, int count, rsp.op_errno = ENOTCONN; goto out; } - ret = xdr_to_common_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf_common_rsp); if (ret < 0) { gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed"); rsp.op_ret = -1; @@ -1376,7 +1374,7 @@ client3_1_xattrop_cbk (struct rpc_req *req, struct iovec *iov, int count, op_errno = ENOTCONN; goto out; } - ret = xdr_to_xattrop_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_xattrop_rsp); if (ret < 0) { gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed"); op_ret = -1; @@ -1463,7 +1461,7 @@ client3_1_fxattrop_cbk (struct rpc_req *req, struct iovec *iov, int count, goto out; } - ret = xdr_to_fxattrop_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_fxattrop_rsp); if (ret < 0) { op_ret = -1; op_errno = EINVAL; @@ -1539,7 +1537,7 @@ client3_1_fsetxattr_cbk (struct rpc_req *req, struct iovec *iov, int count, rsp.op_errno = ENOTCONN; goto out; } - ret = xdr_to_common_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf_common_rsp); if (ret < 0) { gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed"); rsp.op_ret = -1; @@ -1578,7 +1576,7 @@ client3_1_fsetattr_cbk (struct rpc_req *req, struct iovec *iov, int count, rsp.op_errno = ENOTCONN; goto out; } - ret = xdr_to_fsetattr_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_fsetattr_rsp); if (ret < 0) { gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed"); rsp.op_ret = -1; @@ -1625,7 +1623,7 @@ client3_1_setattr_cbk (struct rpc_req *req, struct iovec *iov, int count, goto out; } - ret = xdr_to_setattr_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_setattr_rsp); if (ret < 0) { gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed"); rsp.op_ret = -1; @@ -1681,7 +1679,7 @@ client3_1_create_cbk (struct rpc_req *req, struct iovec *iov, int count, goto out; } - ret = xdr_to_create_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_create_rsp); if (ret < 0) { gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed"); rsp.op_ret = -1; @@ -1753,7 +1751,7 @@ client3_1_rchecksum_cbk (struct rpc_req *req, struct iovec *iov, int count, goto out; } - ret = xdr_to_rchecksum_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_rchecksum_rsp); if (ret < 0) { gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed"); rsp.op_ret = -1; @@ -1802,7 +1800,7 @@ client3_1_lk_cbk (struct rpc_req *req, struct iovec *iov, int count, goto out; } - ret = xdr_to_lk_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_lk_rsp); if (ret < 0) { gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed"); rsp.op_ret = -1; @@ -1866,7 +1864,7 @@ client3_1_readdir_cbk (struct rpc_req *req, struct iovec *iov, int count, goto out; } - ret = xdr_to_readdir_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_readdir_rsp); if (ret < 0) { gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed"); rsp.op_ret = -1; @@ -1922,7 +1920,7 @@ client3_1_readdirp_cbk (struct rpc_req *req, struct iovec *iov, int count, goto out; } - ret = xdr_to_readdirp_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_readdirp_rsp); if (ret < 0) { gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed"); rsp.op_ret = -1; @@ -1979,7 +1977,7 @@ client3_1_rename_cbk (struct rpc_req *req, struct iovec *iov, int count, goto out; } - ret = xdr_to_rename_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_rename_rsp); if (ret < 0) { gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed"); rsp.op_ret = -1; @@ -2038,7 +2036,7 @@ client3_1_link_cbk (struct rpc_req *req, struct iovec *iov, int count, goto out; } - ret = xdr_to_link_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_link_rsp); if (ret < 0) { gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed"); rsp.op_ret = -1; @@ -2096,7 +2094,7 @@ client3_1_opendir_cbk (struct rpc_req *req, struct iovec *iov, int count, goto out; } - ret = xdr_to_opendir_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_opendir_rsp); if (ret < 0) { gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed"); rsp.op_ret = -1; @@ -2173,7 +2171,7 @@ client3_1_lookup_cbk (struct rpc_req *req, struct iovec *iov, int count, goto out; } - ret = xdr_to_lookup_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_lookup_rsp); if (ret < 0) { gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed"); rsp.op_ret = -1; @@ -2283,7 +2281,7 @@ client3_1_readv_cbk (struct rpc_req *req, struct iovec *iov, int count, goto out; } - ret = xdr_to_readv_rsp (*iov, &rsp); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_read_rsp); if (ret < 0) { gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed"); rsp.op_ret = -1; @@ -2360,8 +2358,7 @@ client_fdctx_destroy (xlator_t *this, clnt_fd_ctx_t *fdctx) ret = client_submit_request (this, &req, fr, &clnt3_1_fop_prog, GFS3_OP_RELEASEDIR, client3_1_releasedir_cbk, - NULL, xdr_from_releasedir_req, - NULL, 0, NULL, 0, NULL, + NULL, NULL, 0, NULL, 0, NULL, (xdrproc_t)xdr_gfs3_releasedir_req); } else { gfs3_release_req req = {{0,},}; @@ -2370,8 +2367,7 @@ client_fdctx_destroy (xlator_t *this, clnt_fd_ctx_t *fdctx) ret = client_submit_request (this, &req, fr, &clnt3_1_fop_prog, GFS3_OP_RELEASE, client3_1_release_cbk, NULL, - xdr_from_release_req, NULL, 0, - NULL, 0, NULL, + NULL, 0, NULL, 0, NULL, (xdrproc_t)xdr_gfs3_release_req); } @@ -2429,8 +2425,7 @@ client3_1_releasedir (call_frame_t *frame, xlator_t *this, ret = client_submit_request (this, &req, frame, conf->fops, GFS3_OP_RELEASEDIR, client3_1_releasedir_cbk, - NULL, xdr_from_releasedir_req, - NULL, 0, NULL, 0, NULL, + NULL, NULL, 0, NULL, 0, NULL, (xdrproc_t)xdr_gfs3_releasedir_req); inode_unref (fdctx->inode); GF_FREE (fdctx); @@ -2486,9 +2481,8 @@ client3_1_release (call_frame_t *frame, xlator_t *this, ret = client_submit_request (this, &req, frame, conf->fops, GFS3_OP_RELEASE, - client3_1_release_cbk, NULL, - xdr_from_release_req, NULL, 0, - NULL, 0, NULL, + client3_1_release_cbk, NULL, NULL, + 0, NULL, 0, NULL, (xdrproc_t)xdr_gfs3_release_req); inode_unref (fdctx->inode); GF_FREE (fdctx); @@ -2593,7 +2587,7 @@ client3_1_lookup (call_frame_t *frame, xlator_t *this, ret = client_submit_request (this, &req, frame, conf->fops, GFS3_OP_LOOKUP, client3_1_lookup_cbk, - NULL, xdr_from_lookup_req, rsphdr, count, + NULL, rsphdr, count, NULL, 0, local->iobref, (xdrproc_t)xdr_gfs3_lookup_req); @@ -2667,7 +2661,7 @@ client3_1_stat (call_frame_t *frame, xlator_t *this, ret = client_submit_request (this, &req, frame, conf->fops, GFS3_OP_STAT, client3_1_stat_cbk, NULL, - xdr_from_stat_req, NULL, 0, NULL, 0, NULL, + NULL, 0, NULL, 0, NULL, (xdrproc_t)xdr_gfs3_stat_req); if (ret) { op_errno = ENOTCONN; @@ -2714,7 +2708,7 @@ client3_1_truncate (call_frame_t *frame, xlator_t *this, ret = client_submit_request (this, &req, frame, conf->fops, GFS3_OP_TRUNCATE, client3_1_truncate_cbk, NULL, - xdr_from_truncate_req, NULL, 0, NULL, 0, + NULL, 0, NULL, 0, NULL, (xdrproc_t)xdr_gfs3_truncate_req); if (ret) { op_errno = ENOTCONN; @@ -2773,7 +2767,7 @@ client3_1_ftruncate (call_frame_t *frame, xlator_t *this, ret = client_submit_request (this, &req, frame, conf->fops, GFS3_OP_FTRUNCATE, client3_1_ftruncate_cbk, NULL, - xdr_from_ftruncate_req, NULL, 0, NULL, 0, + NULL, 0, NULL, 0, NULL, (xdrproc_t)xdr_gfs3_ftruncate_req); if (ret) { op_errno = ENOTCONN; @@ -2819,7 +2813,7 @@ client3_1_access (call_frame_t *frame, xlator_t *this, ret = client_submit_request (this, &req, frame, conf->fops, GFS3_OP_ACCESS, client3_1_access_cbk, NULL, - xdr_from_access_req, NULL, 0, NULL, 0, + NULL, 0, NULL, 0, NULL, (xdrproc_t)xdr_gfs3_access_req); if (ret) { op_errno = ENOTCONN; @@ -2863,7 +2857,7 @@ client3_1_readlink (call_frame_t *frame, xlator_t *this, ret = client_submit_request (this, &req, frame, conf->fops, GFS3_OP_READLINK, client3_1_readlink_cbk, NULL, - xdr_from_readlink_req, NULL, 0, NULL, 0, + NULL, 0, NULL, 0, NULL, (xdrproc_t)xdr_gfs3_readlink_req); if (ret) { op_errno = ENOTCONN; @@ -2910,7 +2904,7 @@ client3_1_unlink (call_frame_t *frame, xlator_t *this, ret = client_submit_request (this, &req, frame, conf->fops, GFS3_OP_UNLINK, client3_1_unlink_cbk, NULL, - xdr_from_unlink_req, NULL, 0, NULL, 0, + NULL, 0, NULL, 0, NULL, (xdrproc_t)xdr_gfs3_unlink_req); if (ret) { op_errno = ENOTCONN; @@ -2955,7 +2949,7 @@ client3_1_rmdir (call_frame_t *frame, xlator_t *this, ret = client_submit_request (this, &req, frame, conf->fops, GFS3_OP_RMDIR, client3_1_rmdir_cbk, NULL, - xdr_from_rmdir_req, NULL, 0, NULL, 0, + NULL, 0, NULL, 0, NULL, (xdrproc_t)xdr_gfs3_rmdir_req); if (ret) { op_errno = ENOTCONN; @@ -3023,7 +3017,7 @@ client3_1_symlink (call_frame_t *frame, xlator_t *this, ret = client_submit_request (this, &req, frame, conf->fops, GFS3_OP_SYMLINK, client3_1_symlink_cbk, - NULL, xdr_from_symlink_req, NULL, 0, NULL, + NULL, NULL, 0, NULL, 0, NULL, (xdrproc_t)xdr_gfs3_symlink_req); if (ret) { op_errno = ENOTCONN; @@ -3087,7 +3081,7 @@ client3_1_rename (call_frame_t *frame, xlator_t *this, ret = client_submit_request (this, &req, frame, conf->fops, GFS3_OP_RENAME, client3_1_rename_cbk, NULL, - xdr_from_rename_req, NULL, 0, NULL, 0, + NULL, 0, NULL, 0, NULL, (xdrproc_t)xdr_gfs3_rename_req); if (ret) { op_errno = ENOTCONN; @@ -3148,7 +3142,7 @@ client3_1_link (call_frame_t *frame, xlator_t *this, ret = client_submit_request (this, &req, frame, conf->fops, GFS3_OP_LINK, client3_1_link_cbk, NULL, - xdr_from_link_req, NULL, 0, NULL, 0, NULL, + NULL, 0, NULL, 0, NULL, (xdrproc_t)xdr_gfs3_link_req); if (ret) { op_errno = ENOTCONN; @@ -3218,7 +3212,7 @@ client3_1_mknod (call_frame_t *frame, xlator_t *this, ret = client_submit_request (this, &req, frame, conf->fops, GFS3_OP_MKNOD, client3_1_mknod_cbk, NULL, - xdr_from_mknod_req, NULL, 0, NULL, 0, + NULL, 0, NULL, 0, NULL, (xdrproc_t)xdr_gfs3_mknod_req); if (ret) { op_errno = ENOTCONN; @@ -3299,7 +3293,7 @@ client3_1_mkdir (call_frame_t *frame, xlator_t *this, ret = client_submit_request (this, &req, frame, conf->fops, GFS3_OP_MKDIR, client3_1_mkdir_cbk, NULL, - xdr_from_mkdir_req, NULL, 0, NULL, 0, + NULL, 0, NULL, 0, NULL, (xdrproc_t)xdr_gfs3_mkdir_req); if (ret) { op_errno = ENOTCONN; @@ -3382,7 +3376,7 @@ client3_1_create (call_frame_t *frame, xlator_t *this, ret = client_submit_request (this, &req, frame, conf->fops, GFS3_OP_CREATE, client3_1_create_cbk, NULL, - xdr_from_create_req, NULL, 0, NULL, 0, + NULL, 0, NULL, 0, NULL, (xdrproc_t)xdr_gfs3_create_req); if (ret) { op_errno = ENOTCONN; @@ -3452,7 +3446,7 @@ client3_1_open (call_frame_t *frame, xlator_t *this, ret = client_submit_request (this, &req, frame, conf->fops, GFS3_OP_OPEN, client3_1_open_cbk, NULL, - xdr_from_open_req, NULL, 0, NULL, 0, NULL, + NULL, 0, NULL, 0, NULL, (xdrproc_t)xdr_gfs3_open_req); if (ret) { op_errno = ENOTCONN; @@ -3560,7 +3554,7 @@ client3_1_readv (call_frame_t *frame, xlator_t *this, ret = client_submit_request (this, &req, frame, conf->fops, GFS3_OP_READ, client3_1_readv_cbk, NULL, - xdr_from_readv_req, NULL, 0, &rsp_vec, 1, + NULL, 0, &rsp_vec, 1, local->iobref, (xdrproc_t)xdr_gfs3_read_req); if (ret) { @@ -3628,7 +3622,7 @@ client3_1_writev (call_frame_t *frame, xlator_t *this, void *data) ret = client_submit_vec_request (this, &req, frame, conf->fops, GFS3_OP_WRITE, client3_1_writev_cbk, args->vector, args->count, args->iobref, - xdr_from_writev_req, + (xdrproc_t)xdr_gfs3_write_req); if (ret) goto unwind; @@ -3697,7 +3691,7 @@ client3_1_flush (call_frame_t *frame, xlator_t *this, ret = client_submit_request (this, &req, frame, conf->fops, GFS3_OP_FLUSH, client3_1_flush_cbk, NULL, - xdr_from_flush_req, NULL, 0, NULL, 0, + NULL, 0, NULL, 0, NULL, (xdrproc_t)xdr_gfs3_flush_req); if (ret) { op_errno = ENOTCONN; @@ -3755,7 +3749,7 @@ client3_1_fsync (call_frame_t *frame, xlator_t *this, ret = client_submit_request (this, &req, frame, conf->fops, GFS3_OP_FSYNC, client3_1_fsync_cbk, NULL, - xdr_from_fsync_req, NULL, 0, NULL, 0, + NULL, 0, NULL, 0, NULL, (xdrproc_t)xdr_gfs3_fsync_req); if (ret) { op_errno = ENOTCONN; @@ -3812,7 +3806,7 @@ client3_1_fstat (call_frame_t *frame, xlator_t *this, ret = client_submit_request (this, &req, frame, conf->fops, GFS3_OP_FSTAT, client3_1_fstat_cbk, NULL, - xdr_from_fstat_req, NULL, 0, NULL, 0, + NULL, 0, NULL, 0, NULL, (xdrproc_t)xdr_gfs3_fstat_req); if (ret) { op_errno = ENOTCONN; @@ -3866,8 +3860,7 @@ client3_1_opendir (call_frame_t *frame, xlator_t *this, ret = client_submit_request (this, &req, frame, conf->fops, GFS3_OP_OPENDIR, client3_1_opendir_cbk, - NULL, xdr_from_opendir_req, - NULL, 0, NULL, 0, NULL, + NULL, NULL, 0, NULL, 0, NULL, (xdrproc_t)xdr_gfs3_opendir_req); if (ret) { op_errno = ENOTCONN; @@ -3930,7 +3923,7 @@ client3_1_fsyncdir (call_frame_t *frame, xlator_t *this, void *data) ret = client_submit_request (this, &req, frame, conf->fops, GFS3_OP_FSYNCDIR, client3_1_fsyncdir_cbk, - NULL, xdr_from_fsyncdir_req, NULL, 0, + NULL, NULL, 0, NULL, 0, NULL, (xdrproc_t)xdr_gfs3_fsyncdir_req); if (ret) { @@ -3978,7 +3971,7 @@ client3_1_statfs (call_frame_t *frame, xlator_t *this, ret = client_submit_request (this, &req, frame, conf->fops, GFS3_OP_STATFS, client3_1_statfs_cbk, NULL, - xdr_from_statfs_req, NULL, 0, NULL, 0, + NULL, 0, NULL, 0, NULL, (xdrproc_t)xdr_gfs3_statfs_req); if (ret) { op_errno = ENOTCONN; @@ -4036,8 +4029,7 @@ client3_1_setxattr (call_frame_t *frame, xlator_t *this, ret = client_submit_request (this, &req, frame, conf->fops, GFS3_OP_SETXATTR, client3_1_setxattr_cbk, - NULL, xdr_from_setxattr_req, NULL, 0, - NULL, 0, NULL, + NULL, NULL, 0, NULL, 0, NULL, (xdrproc_t)xdr_gfs3_setxattr_req); if (ret) { op_errno = ENOTCONN; @@ -4116,8 +4108,7 @@ client3_1_fsetxattr (call_frame_t *frame, xlator_t *this, ret = client_submit_request (this, &req, frame, conf->fops, GFS3_OP_FSETXATTR, client3_1_fsetxattr_cbk, - NULL, xdr_from_fsetxattr_req, NULL, 0, - NULL, 0, NULL, + NULL, NULL, 0, NULL, 0, NULL, (xdrproc_t)xdr_gfs3_fsetxattr_req); if (ret) { op_errno = ENOTCONN; @@ -4227,7 +4218,7 @@ client3_1_fgetxattr (call_frame_t *frame, xlator_t *this, ret = client_submit_request (this, &req, frame, conf->fops, GFS3_OP_FGETXATTR, client3_1_fgetxattr_cbk, NULL, - xdr_from_fgetxattr_req, rsphdr, count, + rsphdr, count, NULL, 0, local->iobref, (xdrproc_t)xdr_gfs3_fgetxattr_req); if (ret) { @@ -4360,7 +4351,7 @@ client3_1_getxattr (call_frame_t *frame, xlator_t *this, ret = client_submit_request (this, &req, frame, conf->fops, GFS3_OP_GETXATTR, client3_1_getxattr_cbk, NULL, - xdr_from_getxattr_req, rsphdr, count, + rsphdr, count, NULL, 0, local->iobref, (xdrproc_t)xdr_gfs3_getxattr_req); if (ret) { @@ -4472,7 +4463,7 @@ client3_1_xattrop (call_frame_t *frame, xlator_t *this, ret = client_submit_request (this, &req, frame, conf->fops, GFS3_OP_XATTROP, client3_1_xattrop_cbk, NULL, - xdr_from_xattrop_req, rsphdr, count, + rsphdr, count, NULL, 0, local->iobref, (xdrproc_t)xdr_gfs3_xattrop_req); if (ret) { @@ -4605,7 +4596,7 @@ client3_1_fxattrop (call_frame_t *frame, xlator_t *this, ret = client_submit_request (this, &req, frame, conf->fops, GFS3_OP_FXATTROP, client3_1_fxattrop_cbk, NULL, - xdr_from_fxattrop_req, rsphdr, count, + rsphdr, count, NULL, 0, local->iobref, (xdrproc_t)xdr_gfs3_fxattrop_req); if (ret) { @@ -4675,8 +4666,7 @@ client3_1_removexattr (call_frame_t *frame, xlator_t *this, ret = client_submit_request (this, &req, frame, conf->fops, GFS3_OP_REMOVEXATTR, client3_1_removexattr_cbk, NULL, - xdr_from_removexattr_req, NULL, 0, NULL, - 0, NULL, + NULL, 0, NULL, 0, NULL, (xdrproc_t)xdr_gfs3_removexattr_req); if (ret) { op_errno = ENOTCONN; @@ -4768,7 +4758,7 @@ client3_1_lk (call_frame_t *frame, xlator_t *this, gf_proto_flock_from_flock (&req.flock, args->flock); ret = client_submit_request (this, &req, frame, conf->fops, GFS3_OP_LK, - client3_1_lk_cbk, NULL, xdr_from_lk_req, + client3_1_lk_cbk, NULL, NULL, 0, NULL, 0, NULL, (xdrproc_t)xdr_gfs3_lk_req); if (ret) { @@ -4844,7 +4834,7 @@ client3_1_inodelk (call_frame_t *frame, xlator_t *this, ret = client_submit_request (this, &req, frame, conf->fops, GFS3_OP_INODELK, client3_1_inodelk_cbk, NULL, - xdr_from_inodelk_req, NULL, 0, NULL, 0, + NULL, 0, NULL, 0, NULL, (xdrproc_t)xdr_gfs3_inodelk_req); if (ret) { op_errno = ENOTCONN; @@ -4933,7 +4923,7 @@ client3_1_finodelk (call_frame_t *frame, xlator_t *this, ret = client_submit_request (this, &req, frame, conf->fops, GFS3_OP_FINODELK, client3_1_finodelk_cbk, NULL, - xdr_from_finodelk_req, NULL, 0, NULL, 0, + NULL, 0, NULL, 0, NULL, (xdrproc_t)xdr_gfs3_finodelk_req); if (ret) { op_errno = ENOTCONN; @@ -4986,7 +4976,7 @@ client3_1_entrylk (call_frame_t *frame, xlator_t *this, ret = client_submit_request (this, &req, frame, conf->fops, GFS3_OP_ENTRYLK, client3_1_entrylk_cbk, NULL, - xdr_from_entrylk_req, NULL, 0, NULL, 0, + NULL, 0, NULL, 0, NULL, (xdrproc_t)xdr_gfs3_entrylk_req); if (ret) { op_errno = ENOTCONN; @@ -5053,7 +5043,7 @@ client3_1_fentrylk (call_frame_t *frame, xlator_t *this, ret = client_submit_request (this, &req, frame, conf->fops, GFS3_OP_FENTRYLK, client3_1_fentrylk_cbk, NULL, - xdr_from_fentrylk_req, NULL, 0, NULL, 0, + NULL, 0, NULL, 0, NULL, (xdrproc_t)xdr_gfs3_fentrylk_req); if (ret) { op_errno = ENOTCONN; @@ -5113,7 +5103,7 @@ client3_1_rchecksum (call_frame_t *frame, xlator_t *this, ret = client_submit_request (this, &req, frame, conf->fops, GFS3_OP_RCHECKSUM, client3_1_rchecksum_cbk, NULL, - xdr_from_rchecksum_req, NULL, 0, NULL, + NULL, 0, NULL, 0, NULL, (xdrproc_t)xdr_gfs3_rchecksum_req); if (ret) { op_errno = ENOTCONN; @@ -5217,7 +5207,7 @@ client3_1_readdir (call_frame_t *frame, xlator_t *this, ret = client_submit_request (this, &req, frame, conf->fops, GFS3_OP_READDIR, client3_1_readdir_cbk, NULL, - xdr_from_readdir_req, rsphdr, count, + rsphdr, count, NULL, 0, rsp_iobref, (xdrproc_t)xdr_gfs3_readdir_req); rsp_iobref = NULL; @@ -5338,7 +5328,7 @@ client3_1_readdirp (call_frame_t *frame, xlator_t *this, ret = client_submit_request (this, &req, frame, conf->fops, GFS3_OP_READDIRP, client3_1_readdirp_cbk, NULL, - xdr_from_readdirp_req, rsphdr, count, NULL, + rsphdr, count, NULL, 0, rsp_iobref, (xdrproc_t)xdr_gfs3_readdirp_req); if (ret) { @@ -5398,7 +5388,7 @@ client3_1_setattr (call_frame_t *frame, xlator_t *this, ret = client_submit_request (this, &req, frame, conf->fops, GFS3_OP_SETATTR, client3_1_setattr_cbk, NULL, - xdr_from_setattr_req, NULL, 0, NULL, 0, + NULL, 0, NULL, 0, NULL, (xdrproc_t)xdr_gfs3_setattr_req); if (ret) { op_errno = ENOTCONN; @@ -5456,7 +5446,7 @@ client3_1_fsetattr (call_frame_t *frame, xlator_t *this, void *data) ret = client_submit_request (this, &req, frame, conf->fops, GFS3_OP_FSETATTR, client3_1_fsetattr_cbk, NULL, - xdr_from_fsetattr_req, NULL, 0, NULL, 0, + NULL, 0, NULL, 0, NULL, (xdrproc_t)xdr_gfs3_fsetattr_req); if (ret) { op_errno = ENOTCONN; diff --git a/xlators/protocol/server/src/server-handshake.c b/xlators/protocol/server/src/server-handshake.c index 694853417d6..edad73dba7b 100644 --- a/xlators/protocol/server/src/server-handshake.c +++ b/xlators/protocol/server/src/server-handshake.c @@ -266,7 +266,7 @@ server_getspec (rpcsvc_request_t *req) conn = req->trans->private; this = req->svc->mydata; conf = this->private; - if (xdr_to_glusterfs_req (req, &args, xdr_to_getspec_req)) { + if (!xdr_to_generic (req->msg[0], &args, (xdrproc_t)xdr_gf_getspec_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; op_errno = EINVAL; @@ -326,7 +326,6 @@ fail: rsp.op_ret = ret; server_submit_reply (NULL, req, &rsp, NULL, 0, NULL, - (gfs_serialize_t)xdr_serialize_getspec_rsp, (xdrproc_t)xdr_gf_getspec_rsp); return 0; @@ -360,7 +359,7 @@ server_setvolume (rpcsvc_request_t *req) params = dict_new (); reply = dict_new (); - if (xdr_to_glusterfs_req (req, &args, xdr_to_setvolume_req)) { + if (!xdr_to_generic (req->msg[0], &args, (xdrproc_t)xdr_gf_setvolume_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto fail; @@ -621,7 +620,6 @@ fail: rsp.op_errno = gf_errno_to_error (op_errno); server_submit_reply (NULL, req, &rsp, NULL, 0, NULL, - (gfs_serialize_t)xdr_serialize_setvolume_rsp, (xdrproc_t)xdr_gf_setvolume_rsp); @@ -652,7 +650,6 @@ server_ping (rpcsvc_request_t *req) rsp.op_ret = 0; server_submit_reply (NULL, req, &rsp, NULL, 0, NULL, - xdr_serialize_common_rsp, (xdrproc_t)xdr_gf_common_rsp); return 0; diff --git a/xlators/protocol/server/src/server.c b/xlators/protocol/server/src/server.c index 32ecc4d8c9b..ec91ba7c21a 100644 --- a/xlators/protocol/server/src/server.c +++ b/xlators/protocol/server/src/server.c @@ -37,8 +37,8 @@ #include "rpcsvc.h" struct iobuf * -gfs_serialize_reply (rpcsvc_request_t *req, void *arg, gfs_serialize_t sfunc, - struct iovec *outmsg, xdrproc_t xdrproc) +gfs_serialize_reply (rpcsvc_request_t *req, void *arg, struct iovec *outmsg, + xdrproc_t xdrproc) { struct iobuf *iob = NULL; ssize_t retlen = 0; @@ -65,17 +65,15 @@ gfs_serialize_reply (rpcsvc_request_t *req, void *arg, gfs_serialize_t sfunc, /* retlen is used to received the error since size_t is unsigned and we * need -1 for error notification during encoding. */ - retlen = -1; - if (sfunc) { - retlen = sfunc (*outmsg, arg); - if (retlen == -1) { - /* Failed to Encode 'GlusterFS' msg in RPC is not exactly - failure of RPC return values.. client should get - notified about this, so there are no missing frames */ - gf_log_callingfn ("", GF_LOG_ERROR, "Failed to encode message"); - req->rpc_err = GARBAGE_ARGS; - retlen = 0; - } + + retlen = xdr_serialize_generic (*outmsg, arg, xdrproc); + if (retlen == -1) { + /* Failed to Encode 'GlusterFS' msg in RPC is not exactly + failure of RPC return values.. client should get + notified about this, so there are no missing frames */ + gf_log_callingfn ("", GF_LOG_ERROR, "Failed to encode message"); + req->rpc_err = GARBAGE_ARGS; + retlen = 0; } } outmsg->iov_len = retlen; @@ -93,8 +91,7 @@ ret: int server_submit_reply (call_frame_t *frame, rpcsvc_request_t *req, void *arg, struct iovec *payload, int payloadcount, - struct iobref *iobref, gfs_serialize_t sfunc, - xdrproc_t xdrproc) + struct iobref *iobref, xdrproc_t xdrproc) { struct iobuf *iob = NULL; int ret = -1; @@ -118,7 +115,7 @@ server_submit_reply (call_frame_t *frame, rpcsvc_request_t *req, void *arg, new_iobref = 1; } - iob = gfs_serialize_reply (req, arg, sfunc, &rsp, xdrproc); + iob = gfs_serialize_reply (req, arg, &rsp, xdrproc); if (!iob) { gf_log ("", GF_LOG_ERROR, "Failed to serialize reply"); goto ret; @@ -163,21 +160,6 @@ ret: /* */ int -xdr_to_glusterfs_req (rpcsvc_request_t *req, void *arg, gfs_serialize_t sfunc) -{ - int ret = -1; - - GF_VALIDATE_OR_GOTO ("server", req, out); - - ret = sfunc (req->msg[0], arg); - - if (ret > 0) - ret = 0; -out: - return ret; -} - -int server_fd (xlator_t *this) { server_conf_t *conf = NULL; diff --git a/xlators/protocol/server/src/server.h b/xlators/protocol/server/src/server.h index 9c7459fb1ad..807b87a3578 100644 --- a/xlators/protocol/server/src/server.h +++ b/xlators/protocol/server/src/server.h @@ -193,16 +193,10 @@ extern struct rpcsvc_program gluster_handshake_prog; extern struct rpcsvc_program glusterfs3_1_fop_prog; extern struct rpcsvc_program gluster_ping_prog; -typedef ssize_t (*gfs_serialize_t) (struct iovec outmsg, void *args); - int server_submit_reply (call_frame_t *frame, rpcsvc_request_t *req, void *arg, struct iovec *payload, int payloadcount, - struct iobref *iobref, gfs_serialize_t sfunc, - xdrproc_t xdrproc); - -int xdr_to_glusterfs_req (rpcsvc_request_t *req, void *arg, - gfs_serialize_t sfunc); + struct iobref *iobref, xdrproc_t xdrproc); int gf_server_check_setxattr_cmd (call_frame_t *frame, dict_t *dict); int gf_server_check_getxattr_cmd (call_frame_t *frame, const char *name); diff --git a/xlators/protocol/server/src/server3_1-fops.c b/xlators/protocol/server/src/server3_1-fops.c index a4666343eb0..5b6bf29fc6e 100644 --- a/xlators/protocol/server/src/server3_1-fops.c +++ b/xlators/protocol/server/src/server3_1-fops.c @@ -55,7 +55,6 @@ server_statfs_cbk (call_frame_t *frame, void *cookie, xlator_t *this, } server_submit_reply (frame, req, &rsp, NULL, 0, NULL, - xdr_serialize_statfs_rsp, (xdrproc_t)xdr_gfs3_statfs_rsp); return 0; @@ -171,7 +170,6 @@ out: } server_submit_reply (frame, req, &rsp, NULL, 0, NULL, - (gfs_serialize_t)xdr_serialize_lookup_rsp, (xdrproc_t)xdr_gfs3_lookup_rsp); if (rsp.dict.dict_val) @@ -223,7 +221,6 @@ server_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, } server_submit_reply (frame, req, &rsp, NULL, 0, NULL, - xdr_serialize_lk_rsp, (xdrproc_t)xdr_gfs3_lk_rsp); return 0; @@ -264,7 +261,6 @@ server_inodelk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, } server_submit_reply (frame, req, &rsp, NULL, 0, NULL, - xdr_serialize_common_rsp, (xdrproc_t)xdr_gf_common_rsp); return 0; @@ -307,7 +303,6 @@ server_finodelk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, } server_submit_reply (frame, req, &rsp, NULL, 0, NULL, - xdr_serialize_common_rsp, (xdrproc_t)xdr_gf_common_rsp); return 0; @@ -347,7 +342,6 @@ server_entrylk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, } server_submit_reply (frame, req, &rsp, NULL, 0, NULL, - xdr_serialize_common_rsp, (xdrproc_t)xdr_gf_common_rsp); return 0; } @@ -387,7 +381,6 @@ server_fentrylk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, } server_submit_reply (frame, req, &rsp, NULL, 0, NULL, - xdr_serialize_common_rsp, (xdrproc_t)xdr_gf_common_rsp); return 0; @@ -416,7 +409,6 @@ server_access_cbk (call_frame_t *frame, void *cookie, xlator_t *this, op_ret, strerror (op_errno)); server_submit_reply (frame, req, &rsp, NULL, 0, NULL, - xdr_serialize_common_rsp, (xdrproc_t)xdr_gf_common_rsp); return 0; @@ -459,7 +451,6 @@ server_rmdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this, } server_submit_reply (frame, req, &rsp, NULL, 0, NULL, - xdr_serialize_rmdir_rsp, (xdrproc_t)xdr_gfs3_rmdir_rsp); return 0; @@ -499,7 +490,6 @@ server_mkdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this, } server_submit_reply (frame, req, &rsp, NULL, 0, NULL, - xdr_serialize_mkdir_rsp, (xdrproc_t)xdr_gfs3_mkdir_rsp); return 0; @@ -539,7 +529,6 @@ server_mknod_cbk (call_frame_t *frame, void *cookie, xlator_t *this, } server_submit_reply (frame, req, &rsp, NULL, 0, NULL, - xdr_serialize_mknod_rsp, (xdrproc_t)xdr_gfs3_mknod_rsp); @@ -570,7 +559,6 @@ server_fsyncdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this, } server_submit_reply (frame, req, &rsp, NULL, 0, NULL, - xdr_serialize_common_rsp, (xdrproc_t)xdr_gf_common_rsp); return 0; @@ -608,7 +596,6 @@ unwind: rsp.op_errno = gf_errno_to_error (op_errno); server_submit_reply (frame, req, &rsp, NULL, 0, NULL, - xdr_serialize_readdir_rsp, (xdrproc_t)xdr_gfs3_readdir_rsp); readdir_rsp_cleanup (&rsp); @@ -630,7 +617,6 @@ server_releasedir_cbk (call_frame_t *frame, void *cookie, xlator_t *this, rsp.op_errno = gf_errno_to_error (op_errno); server_submit_reply (frame, req, &rsp, NULL, 0, NULL, - xdr_serialize_common_rsp, (xdrproc_t)xdr_gf_common_rsp); return 0; @@ -669,7 +655,6 @@ server_opendir_cbk (call_frame_t *frame, void *cookie, xlator_t *this, rsp.op_errno = gf_errno_to_error (op_errno); server_submit_reply (frame, req, &rsp, NULL, 0, NULL, - xdr_serialize_opendir_rsp, (xdrproc_t)xdr_gfs3_opendir_rsp); return 0; @@ -696,7 +681,6 @@ server_removexattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, op_ret, strerror (op_errno)); server_submit_reply (frame, req, &rsp, NULL, 0, NULL, - xdr_serialize_common_rsp, (xdrproc_t)xdr_gf_common_rsp); return 0; @@ -758,7 +742,6 @@ out: state->name, op_ret, strerror (op_errno)); server_submit_reply (frame, req, &rsp, NULL, 0, NULL, - xdr_serialize_getxattr_rsp, (xdrproc_t)xdr_gfs3_getxattr_rsp); if (rsp.dict.dict_val) @@ -823,7 +806,6 @@ out: state->name, op_ret, strerror (op_errno)); server_submit_reply (frame, req, &rsp, NULL, 0, NULL, - xdr_serialize_fgetxattr_rsp, (xdrproc_t)xdr_gfs3_fgetxattr_rsp); if (rsp.dict.dict_val) @@ -853,7 +835,6 @@ server_setxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, state->loc.inode ? state->loc.inode->ino : 0, op_ret, strerror (op_errno)); server_submit_reply (frame, req, &rsp, NULL, 0, NULL, - xdr_serialize_common_rsp, (xdrproc_t)xdr_gf_common_rsp); return 0; @@ -882,7 +863,6 @@ server_fsetxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, strerror (op_errno)); server_submit_reply (frame, req, &rsp, NULL, 0, NULL, - xdr_serialize_common_rsp, (xdrproc_t)xdr_gf_common_rsp); return 0; @@ -937,7 +917,6 @@ server_rename_cbk (call_frame_t *frame, void *cookie, xlator_t *this, op_ret, strerror (op_errno)); server_submit_reply (frame, req, &rsp, NULL, 0, NULL, - xdr_serialize_rename_rsp, (xdrproc_t)xdr_gfs3_rename_rsp); return 0; @@ -987,7 +966,6 @@ server_unlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this, } server_submit_reply (frame, req, &rsp, NULL, 0, NULL, - xdr_serialize_unlink_rsp, (xdrproc_t)xdr_gfs3_unlink_rsp); return 0; @@ -1028,7 +1006,6 @@ server_symlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this, } server_submit_reply (frame, req, &rsp, NULL, 0, NULL, - xdr_serialize_symlink_rsp, (xdrproc_t)xdr_gfs3_symlink_rsp); return 0; @@ -1074,7 +1051,6 @@ server_link_cbk (call_frame_t *frame, void *cookie, xlator_t *this, op_ret, strerror (op_errno)); server_submit_reply (frame, req, &rsp, NULL, 0, NULL, - xdr_serialize_link_rsp, (xdrproc_t)xdr_gfs3_link_rsp); return 0; @@ -1108,7 +1084,6 @@ server_truncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this, } server_submit_reply (frame, req, &rsp, NULL, 0, NULL, - xdr_serialize_truncate_rsp, (xdrproc_t)xdr_gfs3_truncate_rsp); return 0; @@ -1140,7 +1115,6 @@ server_fstat_cbk (call_frame_t *frame, void *cookie, xlator_t *this, } server_submit_reply (frame, req, &rsp, NULL, 0, NULL, - xdr_serialize_fstat_rsp, (xdrproc_t)xdr_gfs3_fstat_rsp); return 0; @@ -1174,7 +1148,6 @@ server_ftruncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this, } server_submit_reply (frame, req, &rsp, NULL, 0, NULL, - xdr_serialize_ftruncate_rsp, (xdrproc_t)xdr_gfs3_ftruncate_rsp); return 0; @@ -1203,7 +1176,6 @@ server_flush_cbk (call_frame_t *frame, void *cookie, xlator_t *this, } server_submit_reply (frame, req, &rsp, NULL, 0, NULL, - xdr_serialize_common_rsp, (xdrproc_t)xdr_gf_common_rsp); @@ -1238,7 +1210,6 @@ server_fsync_cbk (call_frame_t *frame, void *cookie, xlator_t *this, } server_submit_reply (frame, req, &rsp, NULL, 0, NULL, - xdr_serialize_fsync_rsp, (xdrproc_t)xdr_gfs3_fsync_rsp); return 0; @@ -1271,7 +1242,6 @@ server_writev_cbk (call_frame_t *frame, void *cookie, xlator_t *this, } server_submit_reply (frame, req, &rsp, NULL, 0, NULL, - xdr_serialize_writev_rsp, (xdrproc_t)xdr_gfs3_write_rsp); return 0; @@ -1306,7 +1276,6 @@ server_readv_cbk (call_frame_t *frame, void *cookie, xlator_t *this, } server_submit_reply (frame, req, &rsp, vector, count, iobref, - xdr_serialize_readv_rsp, (xdrproc_t)xdr_gfs3_read_rsp); return 0; @@ -1341,7 +1310,6 @@ server_rchecksum_cbk (call_frame_t *frame, void *cookie, xlator_t *this, strerror (op_errno)); server_submit_reply (frame, req, &rsp, NULL, 0, NULL, - xdr_serialize_rchecksum_rsp, (xdrproc_t)xdr_gfs3_rchecksum_rsp); return 0; @@ -1380,7 +1348,6 @@ server_open_cbk (call_frame_t *frame, void *cookie, xlator_t *this, rsp.op_errno = gf_errno_to_error (op_errno); server_submit_reply (frame, req, &rsp, NULL, 0, NULL, - xdr_serialize_open_rsp, (xdrproc_t)xdr_gfs3_open_rsp); return 0; } @@ -1459,7 +1426,6 @@ out: rsp.op_errno = gf_errno_to_error (op_errno); server_submit_reply (frame, req, &rsp, NULL, 0, NULL, - xdr_serialize_create_rsp, (xdrproc_t)xdr_gfs3_create_rsp); return 0; @@ -1497,7 +1463,6 @@ server_readlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this, rsp.path = ""; server_submit_reply (frame, req, &rsp, NULL, 0, NULL, - xdr_serialize_readlink_rsp, (xdrproc_t)xdr_gfs3_readlink_rsp); return 0; @@ -1529,7 +1494,6 @@ server_stat_cbk (call_frame_t *frame, void *cookie, xlator_t *this, } server_submit_reply (frame, req, &rsp, NULL, 0, NULL, - xdr_serialize_stat_rsp, (xdrproc_t)xdr_gfs3_stat_rsp); return 0; @@ -1564,7 +1528,6 @@ server_setattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, } server_submit_reply (frame, req, &rsp, NULL, 0, NULL, - xdr_serialize_setattr_rsp, (xdrproc_t)xdr_gfs3_setattr_rsp); return 0; @@ -1599,7 +1562,6 @@ server_fsetattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, rsp.op_errno = gf_errno_to_error (op_errno); server_submit_reply (frame, req, &rsp, NULL, 0, NULL, - xdr_serialize_fsetattr_rsp, (xdrproc_t)xdr_gfs3_fsetattr_rsp); return 0; @@ -1670,7 +1632,6 @@ out: op_ret, strerror (op_errno)); server_submit_reply (frame, req, &rsp, NULL, 0, NULL, - xdr_serialize_xattrop_rsp, (xdrproc_t)xdr_gfs3_xattrop_rsp); if (rsp.dict.dict_val) @@ -1745,7 +1706,6 @@ out: strerror (op_errno)); server_submit_reply (frame, req, &rsp, NULL, 0, NULL, - xdr_serialize_fxattrop_rsp, (xdrproc_t)xdr_gfs3_fxattrop_rsp); if (rsp.dict.dict_val) @@ -1789,7 +1749,6 @@ out: rsp.op_errno = gf_errno_to_error (op_errno); server_submit_reply (frame, req, &rsp, NULL, 0, NULL, - xdr_serialize_readdirp_rsp, (xdrproc_t)xdr_gfs3_readdirp_rsp); readdirp_rsp_cleanup (&rsp); @@ -2726,7 +2685,7 @@ server_stat (rpcsvc_request_t *req) /* Initialize args first, then decode */ args.path = alloca (req->msg[0].iov_len); - if (!xdr_to_stat_req (req->msg[0], &args)) { + if (!xdr_to_generic (req->msg[0], &args, (xdrproc_t)xdr_gfs3_stat_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -2771,7 +2730,7 @@ server_setattr (rpcsvc_request_t *req) args.path = alloca (req->msg[0].iov_len); - if (!xdr_to_setattr_req (req->msg[0], &args)) { + if (!xdr_to_generic (req->msg[0], &args, (xdrproc_t)xdr_gfs3_setattr_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -2817,7 +2776,7 @@ server_fsetattr (rpcsvc_request_t *req) if (!req) return ret; - if (!xdr_to_fsetattr_req (req->msg[0], &args)) { + if (!xdr_to_generic (req->msg[0], &args, (xdrproc_t)xdr_gfs3_fsetattr_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -2864,7 +2823,7 @@ server_readlink (rpcsvc_request_t *req) args.path = alloca (req->msg[0].iov_len); - if (!xdr_to_readlink_req (req->msg[0], &args)) { + if (!xdr_to_generic (req->msg[0], &args, (xdrproc_t)xdr_gfs3_readlink_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -2914,7 +2873,7 @@ server_create (rpcsvc_request_t *req) args.path = alloca (req->msg[0].iov_len); args.bname = alloca (req->msg[0].iov_len); - if (!xdr_to_create_req (req->msg[0], &args)) { + if (!xdr_to_generic (req->msg[0], &args, (xdrproc_t)xdr_gfs3_create_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -3007,7 +2966,7 @@ server_open (rpcsvc_request_t *req) args.path = alloca (req->msg[0].iov_len); - if (!xdr_to_open_req (req->msg[0], &args)) { + if (!xdr_to_generic (req->msg[0], &args, (xdrproc_t)xdr_gfs3_open_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -3052,7 +3011,7 @@ server_readv (rpcsvc_request_t *req) if (!req) goto out; - if (!xdr_to_readv_req (req->msg[0], &args)) { + if (!xdr_to_generic (req->msg[0], &args, (xdrproc_t)xdr_gfs3_read_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -3098,7 +3057,7 @@ server_writev (rpcsvc_request_t *req) if (!req) return ret; - len = xdr_to_writev_req (req->msg[0], &args); + len = xdr_to_generic (req->msg[0], &args, (xdrproc_t)xdr_gfs3_write_req); if (len == 0) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; @@ -3189,7 +3148,7 @@ server_release (rpcsvc_request_t *req) gf_common_rsp rsp = {0,}; int ret = -1; - if (!xdr_to_release_req (req->msg[0], &args)) { + if (!xdr_to_generic (req->msg[0], &args, (xdrproc_t)xdr_gfs3_release_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -3199,7 +3158,6 @@ server_release (rpcsvc_request_t *req) gf_fd_put (conn->fdtable, args.fd); server_submit_reply (NULL, req, &rsp, NULL, 0, NULL, - xdr_serialize_common_rsp, (xdrproc_t)xdr_gf_common_rsp); ret = 0; out: @@ -3214,7 +3172,7 @@ server_releasedir (rpcsvc_request_t *req) gf_common_rsp rsp = {0,}; int ret = -1; - if (!xdr_to_release_req (req->msg[0], &args)) { + if (!xdr_to_generic (req->msg[0], &args, (xdrproc_t)xdr_gfs3_release_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -3224,7 +3182,6 @@ server_releasedir (rpcsvc_request_t *req) gf_fd_put (conn->fdtable, args.fd); server_submit_reply (NULL, req, &rsp, NULL, 0, NULL, - xdr_serialize_common_rsp, (xdrproc_t)xdr_gf_common_rsp); ret = 0; out: @@ -3243,7 +3200,7 @@ server_fsync (rpcsvc_request_t *req) if (!req) return ret; - if (!xdr_to_fsync_req (req->msg[0], &args)) { + if (!xdr_to_generic (req->msg[0], &args, (xdrproc_t)xdr_gfs3_fsync_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -3287,7 +3244,7 @@ server_flush (rpcsvc_request_t *req) if (!req) return ret; - if (!xdr_to_flush_req (req->msg[0], &args)) { + if (!xdr_to_generic (req->msg[0], &args, (xdrproc_t)xdr_gfs3_flush_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -3330,7 +3287,7 @@ server_ftruncate (rpcsvc_request_t *req) if (!req) return ret; - if (!xdr_to_ftruncate_req (req->msg[0], &args)) { + if (!xdr_to_generic (req->msg[0], &args, (xdrproc_t)xdr_gfs3_ftruncate_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -3373,7 +3330,7 @@ server_fstat (rpcsvc_request_t *req) if (!req) return ret; - if (!xdr_to_fstat_req (req->msg[0], &args)) { + if (!xdr_to_generic (req->msg[0], &args, (xdrproc_t)xdr_gfs3_fstat_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -3416,7 +3373,7 @@ server_truncate (rpcsvc_request_t *req) return ret; args.path = alloca (req->msg[0].iov_len); - if (!xdr_to_truncate_req (req->msg[0], &args)) { + if (!xdr_to_generic (req->msg[0], &args, (xdrproc_t)xdr_gfs3_truncate_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -3464,7 +3421,7 @@ server_unlink (rpcsvc_request_t *req) args.path = alloca (req->msg[0].iov_len); args.bname = alloca (req->msg[0].iov_len); - if (!xdr_to_unlink_req (req->msg[0], &args)) { + if (!xdr_to_generic (req->msg[0], &args, (xdrproc_t)xdr_gfs3_unlink_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -3516,7 +3473,7 @@ server_setxattr (rpcsvc_request_t *req) args.path = alloca (req->msg[0].iov_len); args.dict.dict_val = alloca (req->msg[0].iov_len); - if (!xdr_to_setxattr_req (req->msg[0], &args)) { + if (!xdr_to_generic (req->msg[0], &args, (xdrproc_t)xdr_gfs3_setxattr_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -3602,7 +3559,7 @@ server_fsetxattr (rpcsvc_request_t *req) conn = req->trans->xl_private; args.dict.dict_val = alloca (req->msg[0].iov_len); - if (!xdr_to_fsetxattr_req (req->msg[0], &args)) { + if (!xdr_to_generic (req->msg[0], &args, (xdrproc_t)xdr_gfs3_fsetxattr_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -3681,7 +3638,7 @@ server_fxattrop (rpcsvc_request_t *req) conn = req->trans->xl_private; args.dict.dict_val = alloca (req->msg[0].iov_len); - if (!xdr_to_fxattrop_req (req->msg[0], &args)) { + if (!xdr_to_generic (req->msg[0], &args, (xdrproc_t)xdr_gfs3_fxattrop_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -3764,7 +3721,7 @@ server_xattrop (rpcsvc_request_t *req) args.dict.dict_val = alloca (req->msg[0].iov_len); args.path = alloca (req->msg[0].iov_len); - if (!xdr_to_xattrop_req (req->msg[0], &args)) { + if (!xdr_to_generic (req->msg[0], &args, (xdrproc_t)xdr_gfs3_xattrop_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -3840,7 +3797,7 @@ server_getxattr (rpcsvc_request_t *req) args.path = alloca (req->msg[0].iov_len); args.name = alloca (4096); - if (!xdr_to_getxattr_req (req->msg[0], &args)) { + if (!xdr_to_generic (req->msg[0], &args, (xdrproc_t)xdr_gfs3_getxattr_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -3890,7 +3847,7 @@ server_fgetxattr (rpcsvc_request_t *req) return ret; args.name = alloca (4096); - if (!xdr_to_fgetxattr_req (req->msg[0], &args)) { + if (!xdr_to_generic (req->msg[0], &args, (xdrproc_t)xdr_gfs3_fgetxattr_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -3939,7 +3896,7 @@ server_removexattr (rpcsvc_request_t *req) args.path = alloca (req->msg[0].iov_len); args.name = alloca (4096); - if (!xdr_to_removexattr_req (req->msg[0], &args)) { + if (!xdr_to_generic (req->msg[0], &args, (xdrproc_t)xdr_gfs3_removexattr_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -3987,7 +3944,7 @@ server_opendir (rpcsvc_request_t *req) args.path = alloca (req->msg[0].iov_len); - if (!xdr_to_opendir_req (req->msg[0], &args)) { + if (!xdr_to_generic (req->msg[0], &args, (xdrproc_t)xdr_gfs3_opendir_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -4031,7 +3988,7 @@ server_readdirp (rpcsvc_request_t *req) if (!req) return ret; - if (!xdr_to_readdirp_req (req->msg[0], &args)) { + if (!xdr_to_generic (req->msg[0], &args, (xdrproc_t)xdr_gfs3_readdirp_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -4085,7 +4042,7 @@ server_readdir (rpcsvc_request_t *req) if (!req) return ret; - if (!xdr_to_readdir_req (req->msg[0], &args)) { + if (!xdr_to_generic (req->msg[0], &args, (xdrproc_t)xdr_gfs3_readdir_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -4138,7 +4095,7 @@ server_fsyncdir (rpcsvc_request_t *req) if (!req) return ret; - if (!xdr_to_fsyncdir_req (req->msg[0], &args)) { + if (!xdr_to_generic (req->msg[0], &args, (xdrproc_t)xdr_gfs3_fsyncdir_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -4187,7 +4144,7 @@ server_mknod (rpcsvc_request_t *req) args.path = alloca (req->msg[0].iov_len); args.bname = alloca (req->msg[0].iov_len); - if (!xdr_to_mknod_req (req->msg[0], &args)) { + if (!xdr_to_generic (req->msg[0], &args, (xdrproc_t)xdr_gfs3_mknod_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -4286,7 +4243,7 @@ server_mkdir (rpcsvc_request_t *req) args.path = alloca (req->msg[0].iov_len); args.bname = alloca (req->msg[0].iov_len); - if (!xdr_to_mkdir_req (req->msg[0], &args)) { + if (!xdr_to_generic (req->msg[0], &args, (xdrproc_t)xdr_gfs3_mkdir_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -4380,7 +4337,7 @@ server_rmdir (rpcsvc_request_t *req) args.path = alloca (req->msg[0].iov_len); args.bname = alloca (req->msg[0].iov_len); - if (!xdr_to_rmdir_req (req->msg[0], &args)) { + if (!xdr_to_generic (req->msg[0], &args, (xdrproc_t)xdr_gfs3_rmdir_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -4431,7 +4388,7 @@ server_inodelk (rpcsvc_request_t *req) args.path = alloca (req->msg[0].iov_len); args.volume = alloca (4096); - if (!xdr_to_inodelk_req (req->msg[0], &args)) { + if (!xdr_to_generic (req->msg[0], &args, (xdrproc_t)xdr_gfs3_inodelk_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -4504,7 +4461,7 @@ server_finodelk (rpcsvc_request_t *req) return ret; args.volume = alloca (4096); - if (!xdr_to_finodelk_req (req->msg[0], &args)) { + if (!xdr_to_generic (req->msg[0], &args, (xdrproc_t)xdr_gfs3_finodelk_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -4580,7 +4537,7 @@ server_entrylk (rpcsvc_request_t *req) args.volume = alloca (4096); args.name = alloca (4096); - if (!xdr_to_entrylk_req (req->msg[0], &args)) { + if (!xdr_to_generic (req->msg[0], &args, (xdrproc_t)xdr_gfs3_entrylk_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -4632,7 +4589,7 @@ server_fentrylk (rpcsvc_request_t *req) args.name = alloca (4096); args.volume = alloca (4096); - if (!xdr_to_fentrylk_req (req->msg[0], &args)) { + if (!xdr_to_generic (req->msg[0], &args, (xdrproc_t)xdr_gfs3_fentrylk_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -4680,7 +4637,7 @@ server_access (rpcsvc_request_t *req) return ret; args.path = alloca (req->msg[0].iov_len); - if (!xdr_to_access_req (req->msg[0], &args)) { + if (!xdr_to_generic (req->msg[0], &args, (xdrproc_t)xdr_gfs3_access_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -4731,7 +4688,7 @@ server_symlink (rpcsvc_request_t *req) args.bname = alloca (req->msg[0].iov_len); args.linkname = alloca (4096); - if (!xdr_to_symlink_req (req->msg[0], &args)) { + if (!xdr_to_generic (req->msg[0], &args, (xdrproc_t)xdr_gfs3_symlink_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -4826,7 +4783,7 @@ server_link (rpcsvc_request_t *req) args.newpath = alloca (req->msg[0].iov_len); args.newbname = alloca (req->msg[0].iov_len); - if (!xdr_to_link_req (req->msg[0], &args)) { + if (!xdr_to_generic (req->msg[0], &args, (xdrproc_t)xdr_gfs3_link_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -4879,7 +4836,7 @@ server_rename (rpcsvc_request_t *req) args.newpath = alloca (req->msg[0].iov_len); args.newbname = alloca (req->msg[0].iov_len); - if (!xdr_to_rename_req (req->msg[0], &args)) { + if (!xdr_to_generic (req->msg[0], &args, (xdrproc_t)xdr_gfs3_rename_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -4930,7 +4887,7 @@ server_lk (rpcsvc_request_t *req) conn = req->trans->xl_private; - if (!xdr_to_lk_req (req->msg[0], &args)) { + if (!xdr_to_generic (req->msg[0], &args, (xdrproc_t)xdr_gfs3_lk_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -5019,7 +4976,7 @@ server_rchecksum (rpcsvc_request_t *req) if (!req) return ret; - if (!xdr_to_rchecksum_req (req->msg[0], &args)) { + if (!xdr_to_generic (req->msg[0], &args, (xdrproc_t)xdr_gfs3_rchecksum_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -5060,7 +5017,6 @@ server_null (rpcsvc_request_t *req) rsp.op_ret = 0; server_submit_reply (NULL, req, &rsp, NULL, 0, NULL, - (gfs_serialize_t)xdr_serialize_common_rsp, (xdrproc_t)xdr_gf_common_rsp); return 0; @@ -5085,7 +5041,7 @@ server_lookup (rpcsvc_request_t *req) args.bname = alloca (req->msg[0].iov_len); args.dict.dict_val = alloca (req->msg[0].iov_len); - if (!xdr_to_lookup_req (req->msg[0], &args)) { + if (!xdr_to_generic (req->msg[0], &args, (xdrproc_t)xdr_gfs3_lookup_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto err; @@ -5177,7 +5133,7 @@ server_statfs (rpcsvc_request_t *req) return ret; args.path = alloca (req->msg[0].iov_len); - if (!xdr_to_statfs_req (req->msg[0], &args)) { + if (!xdr_to_generic (req->msg[0], &args, (xdrproc_t)xdr_gfs3_statfs_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; |