aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/pnfs.h
diff options
context:
space:
mode:
authorBenny Halevy <bhalevy@panasas.com>2011-05-25 13:25:22 -0400
committerBoaz Harrosh <bharrosh@panasas.com>2011-05-29 13:56:43 -0400
commitdfed206b8857d41a91ebba030f99e30017a44dda (patch)
treeac4c161b548e872e92da36499a2e8c28f5a34aeb /fs/nfs/pnfs.h
parenta0fe8bf427f4987d7b82678292ca03cfd7331467 (diff)
NFSv4.1: unify pnfs_pageio_init functions
Use common code for pnfs_pageio_init_{read,write} and use a common generic pg_test function. Note that this function always assumes the the layout driver's pg_test method is implemented. [Fix BUG] Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Diffstat (limited to 'fs/nfs/pnfs.h')
-rw-r--r--fs/nfs/pnfs.h21
1 files changed, 10 insertions, 11 deletions
diff --git a/fs/nfs/pnfs.h b/fs/nfs/pnfs.h
index 3fda97146777..c056688ee92b 100644
--- a/fs/nfs/pnfs.h
+++ b/fs/nfs/pnfs.h
@@ -158,8 +158,7 @@ enum pnfs_try_status pnfs_try_to_write_data(struct nfs_write_data *,
158 const struct rpc_call_ops *, int); 158 const struct rpc_call_ops *, int);
159enum pnfs_try_status pnfs_try_to_read_data(struct nfs_read_data *, 159enum pnfs_try_status pnfs_try_to_read_data(struct nfs_read_data *,
160 const struct rpc_call_ops *); 160 const struct rpc_call_ops *);
161void pnfs_pageio_init_read(struct nfs_pageio_descriptor *, struct inode *); 161int pnfs_generic_pg_test(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev, struct nfs_page *req);
162void pnfs_pageio_init_write(struct nfs_pageio_descriptor *, struct inode *);
163int pnfs_layout_process(struct nfs4_layoutget *lgp); 162int pnfs_layout_process(struct nfs4_layoutget *lgp);
164void pnfs_free_lseg_list(struct list_head *tmp_list); 163void pnfs_free_lseg_list(struct list_head *tmp_list);
165void pnfs_destroy_layout(struct nfs_inode *); 164void pnfs_destroy_layout(struct nfs_inode *);
@@ -293,6 +292,13 @@ static inline int pnfs_return_layout(struct inode *ino)
293 return 0; 292 return 0;
294} 293}
295 294
295static inline void pnfs_pageio_init(struct nfs_pageio_descriptor *pgio,
296 struct inode *inode)
297{
298 if (NFS_SERVER(inode)->pnfs_curr_ld)
299 pgio->pg_test = pnfs_generic_pg_test;
300}
301
296#else /* CONFIG_NFS_V4_1 */ 302#else /* CONFIG_NFS_V4_1 */
297 303
298static inline void pnfs_destroy_all_layouts(struct nfs_client *clp) 304static inline void pnfs_destroy_all_layouts(struct nfs_client *clp)
@@ -376,16 +382,9 @@ static inline void unset_pnfs_layoutdriver(struct nfs_server *s)
376{ 382{
377} 383}
378 384
379static inline void 385static inline void pnfs_pageio_init(struct nfs_pageio_descriptor *pgio,
380pnfs_pageio_init_read(struct nfs_pageio_descriptor *pgio, struct inode *ino) 386 struct inode *inode)
381{
382 pgio->pg_test = NULL;
383}
384
385static inline void
386pnfs_pageio_init_write(struct nfs_pageio_descriptor *pgio, struct inode *ino)
387{ 387{
388 pgio->pg_test = NULL;
389} 388}
390 389
391static inline void 390static inline void