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 /xlators/protocol/client/src/client-handshake.c | |
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>
Diffstat (limited to 'xlators/protocol/client/src/client-handshake.c')
-rw-r--r-- | xlators/protocol/client/src/client-handshake.c | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/xlators/protocol/client/src/client-handshake.c b/xlators/protocol/client/src/client-handshake.c index 93be68911..6f3dc8642 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: |