aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/nfs_xdr.h
diff options
context:
space:
mode:
authorChuck Lever <cel@netapp.com>2005-11-30 18:09:02 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-01-06 14:58:49 -0500
commit40859d7ee64ed6bfad8a4e93f9bb5c1074afadff (patch)
treeed4069423c3d6551035d5b6116f50452cdac4103 /include/linux/nfs_xdr.h
parent325cfed9ae901320e9234b18c21434b783dbe342 (diff)
NFS: support large reads and writes on the wire
Most NFS server implementations allow up to 64KB reads and writes on the wire. The Solaris NFS server allows up to a megabyte, for instance. Now the Linux NFS client supports transfer sizes up to 1MB, too. This will help reduce protocol and context switch overhead on read/write intensive NFS workloads, and support larger atomic read and write operations on servers that support them. Test-plan: Connectathon and iozone on mount point with wsize=rsize>32768 over TCP. Tests with NFS over UDP to verify the maximum RPC payload size cap. Signed-off-by: Chuck Lever <cel@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'include/linux/nfs_xdr.h')
-rw-r--r--include/linux/nfs_xdr.h29
1 files changed, 16 insertions, 13 deletions
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index b8b0eed98ec9..9f422fd87673 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -4,6 +4,16 @@
4#include <linux/sunrpc/xprt.h> 4#include <linux/sunrpc/xprt.h>
5#include <linux/nfsacl.h> 5#include <linux/nfsacl.h>
6 6
7/*
8 * To change the maximum rsize and wsize supported by the NFS client, adjust
9 * NFS_MAX_FILE_IO_SIZE. 64KB is a typical maximum, but some servers can
10 * support a megabyte or more. The default is left at 4096 bytes, which is
11 * reasonable for NFS over UDP.
12 */
13#define NFS_MAX_FILE_IO_SIZE (1048576U)
14#define NFS_DEF_FILE_IO_SIZE (4096U)
15#define NFS_MIN_FILE_IO_SIZE (1024U)
16
7struct nfs4_fsid { 17struct nfs4_fsid {
8 __u64 major; 18 __u64 major;
9 __u64 minor; 19 __u64 minor;
@@ -215,12 +225,6 @@ struct nfs4_delegreturnargs {
215/* 225/*
216 * Arguments to the read call. 226 * Arguments to the read call.
217 */ 227 */
218
219#define NFS_READ_MAXIOV (9U)
220#if (NFS_READ_MAXIOV > (MAX_IOVEC -2))
221#error "NFS_READ_MAXIOV is too large"
222#endif
223
224struct nfs_readargs { 228struct nfs_readargs {
225 struct nfs_fh * fh; 229 struct nfs_fh * fh;
226 struct nfs_open_context *context; 230 struct nfs_open_context *context;
@@ -239,11 +243,6 @@ struct nfs_readres {
239/* 243/*
240 * Arguments to the write call. 244 * Arguments to the write call.
241 */ 245 */
242#define NFS_WRITE_MAXIOV (9U)
243#if (NFS_WRITE_MAXIOV > (MAX_IOVEC -2))
244#error "NFS_WRITE_MAXIOV is too large"
245#endif
246
247struct nfs_writeargs { 246struct nfs_writeargs {
248 struct nfs_fh * fh; 247 struct nfs_fh * fh;
249 struct nfs_open_context *context; 248 struct nfs_open_context *context;
@@ -674,6 +673,8 @@ struct nfs4_server_caps_res {
674 673
675struct nfs_page; 674struct nfs_page;
676 675
676#define NFS_PAGEVEC_SIZE (8U)
677
677struct nfs_read_data { 678struct nfs_read_data {
678 int flags; 679 int flags;
679 struct rpc_task task; 680 struct rpc_task task;
@@ -682,13 +683,14 @@ struct nfs_read_data {
682 struct nfs_fattr fattr; /* fattr storage */ 683 struct nfs_fattr fattr; /* fattr storage */
683 struct list_head pages; /* Coalesced read requests */ 684 struct list_head pages; /* Coalesced read requests */
684 struct nfs_page *req; /* multi ops per nfs_page */ 685 struct nfs_page *req; /* multi ops per nfs_page */
685 struct page *pagevec[NFS_READ_MAXIOV]; 686 struct page **pagevec;
686 struct nfs_readargs args; 687 struct nfs_readargs args;
687 struct nfs_readres res; 688 struct nfs_readres res;
688#ifdef CONFIG_NFS_V4 689#ifdef CONFIG_NFS_V4
689 unsigned long timestamp; /* For lease renewal */ 690 unsigned long timestamp; /* For lease renewal */
690#endif 691#endif
691 void (*complete) (struct nfs_read_data *, int); 692 void (*complete) (struct nfs_read_data *, int);
693 struct page *page_array[NFS_PAGEVEC_SIZE + 1];
692}; 694};
693 695
694struct nfs_write_data { 696struct nfs_write_data {
@@ -700,13 +702,14 @@ struct nfs_write_data {
700 struct nfs_writeverf verf; 702 struct nfs_writeverf verf;
701 struct list_head pages; /* Coalesced requests we wish to flush */ 703 struct list_head pages; /* Coalesced requests we wish to flush */
702 struct nfs_page *req; /* multi ops per nfs_page */ 704 struct nfs_page *req; /* multi ops per nfs_page */
703 struct page *pagevec[NFS_WRITE_MAXIOV]; 705 struct page **pagevec;
704 struct nfs_writeargs args; /* argument struct */ 706 struct nfs_writeargs args; /* argument struct */
705 struct nfs_writeres res; /* result struct */ 707 struct nfs_writeres res; /* result struct */
706#ifdef CONFIG_NFS_V4 708#ifdef CONFIG_NFS_V4
707 unsigned long timestamp; /* For lease renewal */ 709 unsigned long timestamp; /* For lease renewal */
708#endif 710#endif
709 void (*complete) (struct nfs_write_data *, int); 711 void (*complete) (struct nfs_write_data *, int);
712 struct page *page_array[NFS_PAGEVEC_SIZE + 1];
710}; 713};
711 714
712struct nfs_access_entry; 715struct nfs_access_entry;