diff options
author | NeilBrown <neilb@suse.de> | 2006-10-04 05:15:47 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-04 10:55:15 -0400 |
commit | 3cc03b164cf01c6f36e64720b58610d292fb26f7 (patch) | |
tree | b558e11a087945ad5b9a1a25483aa2acc8d93fbb /fs/nfsd/nfsproc.c | |
parent | 4452435948424e5322c2a2fefbdc2cf3732cc45d (diff) |
[PATCH] knfsd: Avoid excess stack usage in svc_tcp_recvfrom
.. by allocating the array of 'kvec' in 'struct svc_rqst'.
As we plan to increase RPCSVC_MAXPAGES from 8 upto 256, we can no longer
allocate an array of this size on the stack. So we allocate it in 'struct
svc_rqst'.
However svc_rqst contains (indirectly) an array of the same type and size
(actually several, but they are in a union). So rather than waste space, we
move those arrays out of the separately allocated union and into svc_rqst to
share with the kvec moved out of svc_tcp_recvfrom (various arrays are used at
different times, so there is no conflict).
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/nfsd/nfsproc.c')
-rw-r--r-- | fs/nfsd/nfsproc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/nfsd/nfsproc.c b/fs/nfsd/nfsproc.c index 4e06810b6104..ca4973150218 100644 --- a/fs/nfsd/nfsproc.c +++ b/fs/nfsd/nfsproc.c | |||
@@ -159,7 +159,7 @@ nfsd_proc_read(struct svc_rqst *rqstp, struct nfsd_readargs *argp, | |||
159 | resp->count = argp->count; | 159 | resp->count = argp->count; |
160 | nfserr = nfsd_read(rqstp, fh_copy(&resp->fh, &argp->fh), NULL, | 160 | nfserr = nfsd_read(rqstp, fh_copy(&resp->fh, &argp->fh), NULL, |
161 | argp->offset, | 161 | argp->offset, |
162 | argp->vec, argp->vlen, | 162 | rqstp->rq_vec, argp->vlen, |
163 | &resp->count); | 163 | &resp->count); |
164 | 164 | ||
165 | if (nfserr) return nfserr; | 165 | if (nfserr) return nfserr; |
@@ -185,7 +185,7 @@ nfsd_proc_write(struct svc_rqst *rqstp, struct nfsd_writeargs *argp, | |||
185 | 185 | ||
186 | nfserr = nfsd_write(rqstp, fh_copy(&resp->fh, &argp->fh), NULL, | 186 | nfserr = nfsd_write(rqstp, fh_copy(&resp->fh, &argp->fh), NULL, |
187 | argp->offset, | 187 | argp->offset, |
188 | argp->vec, argp->vlen, | 188 | rqstp->rq_vec, argp->vlen, |
189 | argp->len, | 189 | argp->len, |
190 | &stable); | 190 | &stable); |
191 | return nfsd_return_attrs(nfserr, resp); | 191 | return nfsd_return_attrs(nfserr, resp); |