From fa09df5e7a1f5599a9f94a1f6c8a032ba9134df9 Mon Sep 17 00:00:00 2001 From: Trond Myklebust Date: Fri, 20 Dec 2002 05:42:20 -0800 Subject: [PATCH] Clean up NFSv4 READ xdr path This creates a clean XDR path for the NFSv4 read requests instead of routing through encode_compound()/decode_compound(). This eliminates the intermediate step of setting up a struct nfs4_compound before proceeding to XDR encoding, and removes the large 'switch()' statements from the codepath altogether. --- include/linux/nfs4.h | 1 + include/linux/nfs_fs.h | 2 +- include/linux/nfs_xdr.h | 25 +++---------------------- 3 files changed, 5 insertions(+), 23 deletions(-) (limited to 'include/linux') diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index 36e71c8ed51e..d2eb0669c2b9 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h @@ -203,6 +203,7 @@ enum open_delegation_type4 { enum { NFSPROC4_CLNT_NULL = 0, /* Unused */ NFSPROC4_CLNT_COMPOUND, /* Soon to be unused */ + NFSPROC4_CLNT_READ, }; #endif diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 2673e32cc4ba..b4c9adc3defb 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h @@ -369,7 +369,7 @@ extern int nfs_readpage(struct file *, struct page *); extern int nfs_readpages(struct file *, struct address_space *, struct list_head *, unsigned); extern int nfs_pagein_list(struct list_head *, int); -extern void nfs_readpage_result(struct rpc_task *, unsigned int count, int eof); +extern void nfs_readpage_result(struct rpc_task *); extern void nfs_readdata_release(struct rpc_task *); /* diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index af914e160fc6..12281bac2845 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h @@ -422,15 +422,6 @@ struct nfs4_putfh { struct nfs_fh * pf_fhandle; /* request */ }; -struct nfs4_read { - u64 rd_offset; /* request */ - u32 rd_length; /* request */ - u32 *rd_eof; /* response */ - u32 *rd_bytes_read; /* response */ - struct page ** rd_pages; /* zero-copy data */ - unsigned int rd_pgbase; /* zero-copy data */ -}; - struct nfs4_readdir { u64 rd_cookie; /* request */ nfs4_verifier rd_req_verifier; /* request */ @@ -500,7 +491,6 @@ struct nfs4_op { struct nfs4_open open; struct nfs4_open_confirm open_confirm; struct nfs4_putfh putfh; - struct nfs4_read read; struct nfs4_readdir readdir; struct nfs4_readlink readlink; struct nfs4_remove remove; @@ -548,20 +538,11 @@ struct nfs_read_data { struct nfs_fattr fattr; /* fattr storage */ struct list_head pages; /* Coalesced read requests */ struct page *pagevec[NFS_READ_MAXIOV]; - union { - struct { - struct nfs_readargs args; - struct nfs_readres res; - } v3; /* also v2 */ + struct nfs_readargs args; + struct nfs_readres res; #ifdef CONFIG_NFS_V4 - struct { - struct nfs4_compound compound; - struct nfs4_op ops[3]; - u32 res_count; - u32 res_eof; - } v4; + unsigned long timestamp; /* For lease renewal */ #endif - } u; }; struct nfs_write_data { -- cgit v1.2.3