diff options
author | Benny Halevy <bhalevy@panasas.com> | 2011-05-25 13:25:22 -0400 |
---|---|---|
committer | Boaz Harrosh <bharrosh@panasas.com> | 2011-05-29 13:56:43 -0400 |
commit | dfed206b8857d41a91ebba030f99e30017a44dda (patch) | |
tree | ac4c161b548e872e92da36499a2e8c28f5a34aeb /fs/nfs/pnfs.h | |
parent | a0fe8bf427f4987d7b82678292ca03cfd7331467 (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.h | 21 |
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); |
159 | enum pnfs_try_status pnfs_try_to_read_data(struct nfs_read_data *, | 159 | enum pnfs_try_status pnfs_try_to_read_data(struct nfs_read_data *, |
160 | const struct rpc_call_ops *); | 160 | const struct rpc_call_ops *); |
161 | void pnfs_pageio_init_read(struct nfs_pageio_descriptor *, struct inode *); | 161 | int pnfs_generic_pg_test(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev, struct nfs_page *req); |
162 | void pnfs_pageio_init_write(struct nfs_pageio_descriptor *, struct inode *); | ||
163 | int pnfs_layout_process(struct nfs4_layoutget *lgp); | 162 | int pnfs_layout_process(struct nfs4_layoutget *lgp); |
164 | void pnfs_free_lseg_list(struct list_head *tmp_list); | 163 | void pnfs_free_lseg_list(struct list_head *tmp_list); |
165 | void pnfs_destroy_layout(struct nfs_inode *); | 164 | void 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 | ||
295 | static 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 | ||
298 | static inline void pnfs_destroy_all_layouts(struct nfs_client *clp) | 304 | static 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 | ||
379 | static inline void | 385 | static inline void pnfs_pageio_init(struct nfs_pageio_descriptor *pgio, |
380 | pnfs_pageio_init_read(struct nfs_pageio_descriptor *pgio, struct inode *ino) | 386 | struct inode *inode) |
381 | { | ||
382 | pgio->pg_test = NULL; | ||
383 | } | ||
384 | |||
385 | static inline void | ||
386 | pnfs_pageio_init_write(struct nfs_pageio_descriptor *pgio, struct inode *ino) | ||
387 | { | 387 | { |
388 | pgio->pg_test = NULL; | ||
389 | } | 388 | } |
390 | 389 | ||
391 | static inline void | 390 | static inline void |