Commit 457a5ebc authored by Trond Myklebust's avatar Trond Myklebust

RPC: Reduce stack utilization for all synchronous NFS operations by

   using a dynamically allocated rpc_task structure instead of
   allocating one on the stack.  This reduces stack utilization by
   over 200 bytes for all synchronous NFS operations.
Signed-off-by: default avatarChuck Lever <cel@netapp.com>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@fys.uio.no>
parent d6d6692e
...@@ -335,7 +335,7 @@ void rpc_clnt_sigunmask(struct rpc_clnt *clnt, sigset_t *oldset) ...@@ -335,7 +335,7 @@ void rpc_clnt_sigunmask(struct rpc_clnt *clnt, sigset_t *oldset)
*/ */
int rpc_call_sync(struct rpc_clnt *clnt, struct rpc_message *msg, int flags) int rpc_call_sync(struct rpc_clnt *clnt, struct rpc_message *msg, int flags)
{ {
struct rpc_task my_task, *task = &my_task; struct rpc_task *task;
sigset_t oldset; sigset_t oldset;
int status; int status;
...@@ -343,15 +343,15 @@ int rpc_call_sync(struct rpc_clnt *clnt, struct rpc_message *msg, int flags) ...@@ -343,15 +343,15 @@ int rpc_call_sync(struct rpc_clnt *clnt, struct rpc_message *msg, int flags)
if (clnt->cl_dead) if (clnt->cl_dead)
return -EIO; return -EIO;
if (flags & RPC_TASK_ASYNC) { BUG_ON(flags & RPC_TASK_ASYNC);
printk("rpc_call_sync: Illegal flag combination for synchronous task\n");
flags &= ~RPC_TASK_ASYNC;
}
rpc_clnt_sigmask(clnt, &oldset); rpc_clnt_sigmask(clnt, &oldset);
/* Create/initialize a new RPC task */ status = -ENOMEM;
rpc_init_task(task, clnt, NULL, flags); task = rpc_new_task(clnt, NULL, flags);
if (task == NULL)
goto out;
rpc_call_setup(task, msg, 0); rpc_call_setup(task, msg, 0);
/* Set up the call info struct and execute the task */ /* Set up the call info struct and execute the task */
...@@ -362,6 +362,7 @@ int rpc_call_sync(struct rpc_clnt *clnt, struct rpc_message *msg, int flags) ...@@ -362,6 +362,7 @@ int rpc_call_sync(struct rpc_clnt *clnt, struct rpc_message *msg, int flags)
rpc_release_task(task); rpc_release_task(task);
} }
out:
rpc_clnt_sigunmask(clnt, &oldset); rpc_clnt_sigunmask(clnt, &oldset);
return status; return status;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment