diff options
author | shishir gowda <shishirng@gluster.com> | 2011-07-29 16:36:27 +0530 |
---|---|---|
committer | Anand Avati <avati@gluster.com> | 2011-07-31 23:15:32 -0700 |
commit | df0a72d9c118c2a1146f2787eee6d5f0a58853f0 (patch) | |
tree | fc6eb998d3e3965610aef473a1f6b3e46cf2fb7c /xlators/mgmt/glusterd/src/glusterd-utils.c | |
parent | 76acac485b9f06f36d145b4c31fa6f4da3c70f52 (diff) |
Variable IOBUF: Use variable iobuf for cli/glusterd/glusterfsd(mgmt)
By using variable iobufs, xfer data size is no more limited to
128K (default). This helps in scaling.
Change-Id: Iab453db9223d887306d150cd6fe0b1eae9c422cc
BUG: 2472
Reviewed-on: http://review.gluster.com/13
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amar@gluster.com>
Reviewed-by: Anand Avati <avati@gluster.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 56e03e6624b..73c9ffb029f 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -307,18 +307,20 @@ 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) + fop_cbk_fn_t cbkfn, xdrproc_t xdrproc) { int ret = -1; struct iobuf *iobuf = NULL; int count = 0; char new_iobref = 0, start_ping = 0; struct iovec iov = {0, }; + ssize_t req_size = 0; GF_ASSERT (rpc); GF_ASSERT (this); - iobuf = iobuf_get (this->ctx->iobuf_pool); + req_size = xdr_sizeof (xdrproc, req); + iobuf = iobuf_get2 (this->ctx->iobuf_pool, req_size); if (!iobuf) { goto out; }; @@ -335,7 +337,7 @@ glusterd_submit_request (struct rpc_clnt *rpc, void *req, iobref_add (iobref, iobuf); iov.iov_base = iobuf->ptr; - iov.iov_len = 128 * GF_UNIT_KB; + iov.iov_len = iobuf_pagesize (iobuf); /* Create the xdr payload */ if (req && sfunc) { @@ -377,15 +379,18 @@ out: struct iobuf * glusterd_serialize_reply (rpcsvc_request_t *req, void *arg, - gd_serialize_t sfunc, struct iovec *outmsg) + gd_serialize_t sfunc, struct iovec *outmsg, + xdrproc_t xdrproc) { struct iobuf *iob = NULL; ssize_t retlen = -1; + ssize_t rsp_size = 0; /* First, get the io buffer into which the reply in arg will * be serialized. */ - iob = iobuf_get (req->svc->ctx->iobuf_pool); + rsp_size = xdr_sizeof (xdrproc, arg); + iob = iobuf_get2 (req->svc->ctx->iobuf_pool, rsp_size); if (!iob) { gf_log ("", GF_LOG_ERROR, "Failed to get iobuf"); goto ret; @@ -417,7 +422,8 @@ ret: int glusterd_submit_reply (rpcsvc_request_t *req, void *arg, struct iovec *payload, int payloadcount, - struct iobref *iobref, gd_serialize_t sfunc) + struct iobref *iobref, gd_serialize_t sfunc, + xdrproc_t xdrproc) { struct iobuf *iob = NULL; int ret = -1; @@ -440,7 +446,7 @@ glusterd_submit_reply (rpcsvc_request_t *req, void *arg, new_iobref = 1; } - iob = glusterd_serialize_reply (req, arg, sfunc, &rsp); + iob = glusterd_serialize_reply (req, arg, sfunc, &rsp, xdrproc); if (!iob) { gf_log ("", GF_LOG_ERROR, "Failed to serialize reply"); } else { |