From 188be30f9fb87c160509b1c43d2422ebed32ec9d Mon Sep 17 00:00:00 2001 From: yury Date: Wed, 30 Aug 2006 07:02:13 +0000 Subject: [PATCH] - reduce stack consumption in fld_client_rpc() and seq_client_rpc() functions. --- lustre/fid/fid_request.c | 11 +++++------ lustre/fld/fld_request.c | 13 ++++++------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/lustre/fid/fid_request.c b/lustre/fid/fid_request.c index 7b9a24a..fcadda0 100644 --- a/lustre/fid/fid_request.c +++ b/lustre/fid/fid_request.c @@ -51,11 +51,9 @@ static int seq_client_rpc(struct lu_client_seq *seq, struct lu_range *range, __u32 opc, const char *opcname) { + int rc, size[2] = { sizeof(struct ptlrpc_body), + sizeof(__u32) }; struct obd_export *exp = seq->lcs_exp; - int repsize[2] = { sizeof(struct ptlrpc_body), - sizeof(struct lu_range) }; - int rc, reqsize[2] = { sizeof(struct ptlrpc_body), - sizeof(__u32) }; struct ptlrpc_request *req; struct req_capsule pill; struct lu_range *ran; @@ -64,7 +62,7 @@ static int seq_client_rpc(struct lu_client_seq *seq, req = ptlrpc_prep_req(class_exp2cliimp(exp), LUSTRE_MDS_VERSION, - SEQ_QUERY, 2, reqsize, + SEQ_QUERY, 2, size, NULL); if (req == NULL) RETURN(-ENOMEM); @@ -76,7 +74,8 @@ static int seq_client_rpc(struct lu_client_seq *seq, op = req_capsule_client_get(&pill, &RMF_SEQ_OPC); *op = opc; - ptlrpc_req_set_repsize(req, 2, repsize); + size[1] = sizeof(struct lu_range); + ptlrpc_req_set_repsize(req, 2, size); if (seq->lcs_type == LUSTRE_SEQ_METADATA) { req->rq_request_portal = (opc == SEQ_ALLOC_SUPER) ? diff --git a/lustre/fld/fld_request.c b/lustre/fld/fld_request.c index 82bf843..d82758d 100644 --- a/lustre/fld/fld_request.c +++ b/lustre/fld/fld_request.c @@ -349,11 +349,9 @@ EXPORT_SYMBOL(fld_client_fini); static int fld_client_rpc(struct obd_export *exp, struct md_fld *mf, __u32 fld_op) { - int reqsize[3] = { sizeof(struct ptlrpc_body), - sizeof(__u32), - sizeof(struct md_fld) }; - int repsize[2] = { sizeof(struct ptlrpc_body), - sizeof(struct md_fld) }; + int size[3] = { sizeof(struct ptlrpc_body), + sizeof(__u32), + sizeof(struct md_fld) }; struct ptlrpc_request *req; struct req_capsule pill; struct md_fld *pmf; @@ -365,7 +363,7 @@ static int fld_client_rpc(struct obd_export *exp, req = ptlrpc_prep_req(class_exp2cliimp(exp), LUSTRE_MDS_VERSION, FLD_QUERY, - 3, reqsize, NULL); + 3, size, NULL); if (req == NULL) RETURN(-ENOMEM); @@ -379,7 +377,8 @@ static int fld_client_rpc(struct obd_export *exp, pmf = req_capsule_client_get(&pill, &RMF_FLD_MDFLD); *pmf = *mf; - ptlrpc_req_set_repsize(req, 2, repsize); + size[1] = sizeof(struct md_fld); + ptlrpc_req_set_repsize(req, 2, size); req->rq_request_portal = FLD_REQUEST_PORTAL; rc = ptlrpc_queue_wait(req); -- 1.8.3.1