aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/pnfs.h
diff options
context:
space:
mode:
authorAndy Adamson <andros@netapp.com>2011-02-28 20:34:16 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2011-03-11 15:38:42 -0500
commit64419a9b20938d9070fdd8c58c2fa23c911915f8 (patch)
tree182c1eaebcfb9b8e02fc75d807b346209757ace1 /fs/nfs/pnfs.h
parentbae724ef95b0d0a1f4518f5451e7c8aabc41f820 (diff)
NFSv4.1: generic read
Separate the rpc run portion of nfs_read_rpcsetup into a new function nfs_initiate_read that is called for normal NFS I/O. Add a pNFS read_pagelist function that is called instead of nfs_intitate_read for pNFS reads. Signed-off-by: Andy Adamson <andros@citi.umich.edu> Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> Signed-off-by: Dean Hildebrand <dhildeb@us.ibm.com> Signed-off-by: Fred Isaman <iisaman@citi.umich.edu> Signed-off-by: Fred Isaman <iisaman@netapp.com> Signed-off-by: Mike Sager <sager@netapp.com> Signed-off-by: Mingyang Guo <guomingyang@nrchpc.ac.cn> Signed-off-by: Ricardo Labiaga <Ricardo.Labiaga@netapp.com> Signed-off-by: Tao Guo <guotao@nrchpc.ac.cn> Signed-off-by: Andy Adamson <andros@netapp.com> Signed-off-by: Benny Halevy <bhalevy@panasas.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/pnfs.h')
-rw-r--r--fs/nfs/pnfs.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/fs/nfs/pnfs.h b/fs/nfs/pnfs.h
index 5107d14db485..585023fabb55 100644
--- a/fs/nfs/pnfs.h
+++ b/fs/nfs/pnfs.h
@@ -45,6 +45,11 @@ struct pnfs_layout_segment {
45 struct pnfs_layout_hdr *pls_layout; 45 struct pnfs_layout_hdr *pls_layout;
46}; 46};
47 47
48enum pnfs_try_status {
49 PNFS_ATTEMPTED = 0,
50 PNFS_NOT_ATTEMPTED = 1,
51};
52
48#ifdef CONFIG_NFS_V4_1 53#ifdef CONFIG_NFS_V4_1
49 54
50#define LAYOUT_NFSV4_1_MODULE_PREFIX "nfs-layouttype4" 55#define LAYOUT_NFSV4_1_MODULE_PREFIX "nfs-layouttype4"
@@ -70,6 +75,12 @@ struct pnfs_layoutdriver_type {
70 75
71 /* test for nfs page cache coalescing */ 76 /* test for nfs page cache coalescing */
72 int (*pg_test)(struct nfs_pageio_descriptor *, struct nfs_page *, struct nfs_page *); 77 int (*pg_test)(struct nfs_pageio_descriptor *, struct nfs_page *, struct nfs_page *);
78
79 /*
80 * Return PNFS_ATTEMPTED to indicate the layout code has attempted
81 * I/O, else return PNFS_NOT_ATTEMPTED to fall back to normal NFS
82 */
83 enum pnfs_try_status (*read_pagelist) (struct nfs_read_data *nfs_data);
73}; 84};
74 85
75struct pnfs_layout_hdr { 86struct pnfs_layout_hdr {
@@ -157,6 +168,8 @@ pnfs_update_layout(struct inode *ino, struct nfs_open_context *ctx,
157 enum pnfs_iomode access_type); 168 enum pnfs_iomode access_type);
158void set_pnfs_layoutdriver(struct nfs_server *, u32 id); 169void set_pnfs_layoutdriver(struct nfs_server *, u32 id);
159void unset_pnfs_layoutdriver(struct nfs_server *); 170void unset_pnfs_layoutdriver(struct nfs_server *);
171enum pnfs_try_status pnfs_try_to_read_data(struct nfs_read_data *,
172 const struct rpc_call_ops *);
160void pnfs_pageio_init_read(struct nfs_pageio_descriptor *, struct inode *); 173void pnfs_pageio_init_read(struct nfs_pageio_descriptor *, struct inode *);
161int pnfs_layout_process(struct nfs4_layoutget *lgp); 174int pnfs_layout_process(struct nfs4_layoutget *lgp);
162void pnfs_free_lseg_list(struct list_head *tmp_list); 175void pnfs_free_lseg_list(struct list_head *tmp_list);
@@ -227,6 +240,13 @@ pnfs_update_layout(struct inode *ino, struct nfs_open_context *ctx,
227 return NULL; 240 return NULL;
228} 241}
229 242
243static inline enum pnfs_try_status
244pnfs_try_to_read_data(struct nfs_read_data *data,
245 const struct rpc_call_ops *call_ops)
246{
247 return PNFS_NOT_ATTEMPTED;
248}
249
230static inline bool 250static inline bool
231pnfs_roc(struct inode *ino) 251pnfs_roc(struct inode *ino)
232{ 252{