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 /include/linux/nfsd | |
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 'include/linux/nfsd')
-rw-r--r-- | include/linux/nfsd/xdr.h | 2 | ||||
-rw-r--r-- | include/linux/nfsd/xdr3.h | 2 | ||||
-rw-r--r-- | include/linux/nfsd/xdr4.h | 2 |
3 files changed, 0 insertions, 6 deletions
diff --git a/include/linux/nfsd/xdr.h b/include/linux/nfsd/xdr.h index a38f9d776de9..0e53de87d886 100644 --- a/include/linux/nfsd/xdr.h +++ b/include/linux/nfsd/xdr.h | |||
@@ -30,7 +30,6 @@ struct nfsd_readargs { | |||
30 | struct svc_fh fh; | 30 | struct svc_fh fh; |
31 | __u32 offset; | 31 | __u32 offset; |
32 | __u32 count; | 32 | __u32 count; |
33 | struct kvec vec[RPCSVC_MAXPAGES]; | ||
34 | int vlen; | 33 | int vlen; |
35 | }; | 34 | }; |
36 | 35 | ||
@@ -38,7 +37,6 @@ struct nfsd_writeargs { | |||
38 | svc_fh fh; | 37 | svc_fh fh; |
39 | __u32 offset; | 38 | __u32 offset; |
40 | int len; | 39 | int len; |
41 | struct kvec vec[RPCSVC_MAXPAGES]; | ||
42 | int vlen; | 40 | int vlen; |
43 | }; | 41 | }; |
44 | 42 | ||
diff --git a/include/linux/nfsd/xdr3.h b/include/linux/nfsd/xdr3.h index a4322741f8b9..474d882dc2f3 100644 --- a/include/linux/nfsd/xdr3.h +++ b/include/linux/nfsd/xdr3.h | |||
@@ -33,7 +33,6 @@ struct nfsd3_readargs { | |||
33 | struct svc_fh fh; | 33 | struct svc_fh fh; |
34 | __u64 offset; | 34 | __u64 offset; |
35 | __u32 count; | 35 | __u32 count; |
36 | struct kvec vec[RPCSVC_MAXPAGES]; | ||
37 | int vlen; | 36 | int vlen; |
38 | }; | 37 | }; |
39 | 38 | ||
@@ -43,7 +42,6 @@ struct nfsd3_writeargs { | |||
43 | __u32 count; | 42 | __u32 count; |
44 | int stable; | 43 | int stable; |
45 | __u32 len; | 44 | __u32 len; |
46 | struct kvec vec[RPCSVC_MAXPAGES]; | ||
47 | int vlen; | 45 | int vlen; |
48 | }; | 46 | }; |
49 | 47 | ||
diff --git a/include/linux/nfsd/xdr4.h b/include/linux/nfsd/xdr4.h index 77adba7d2281..66e642762a07 100644 --- a/include/linux/nfsd/xdr4.h +++ b/include/linux/nfsd/xdr4.h | |||
@@ -241,7 +241,6 @@ struct nfsd4_read { | |||
241 | stateid_t rd_stateid; /* request */ | 241 | stateid_t rd_stateid; /* request */ |
242 | u64 rd_offset; /* request */ | 242 | u64 rd_offset; /* request */ |
243 | u32 rd_length; /* request */ | 243 | u32 rd_length; /* request */ |
244 | struct kvec rd_iov[RPCSVC_MAXPAGES]; | ||
245 | int rd_vlen; | 244 | int rd_vlen; |
246 | struct file *rd_filp; | 245 | struct file *rd_filp; |
247 | 246 | ||
@@ -326,7 +325,6 @@ struct nfsd4_write { | |||
326 | u64 wr_offset; /* request */ | 325 | u64 wr_offset; /* request */ |
327 | u32 wr_stable_how; /* request */ | 326 | u32 wr_stable_how; /* request */ |
328 | u32 wr_buflen; /* request */ | 327 | u32 wr_buflen; /* request */ |
329 | struct kvec wr_vec[RPCSVC_MAXPAGES]; /* request */ | ||
330 | int wr_vlen; | 328 | int wr_vlen; |
331 | 329 | ||
332 | u32 wr_bytes_written; /* response */ | 330 | u32 wr_bytes_written; /* response */ |