aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/pnfs.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/pnfs.h')
-rw-r--r--fs/nfs/pnfs.h25
1 files changed, 13 insertions, 12 deletions
diff --git a/fs/nfs/pnfs.h b/fs/nfs/pnfs.h
index 96bf4e6f45be..137a2bd5c8c7 100644
--- a/fs/nfs/pnfs.h
+++ b/fs/nfs/pnfs.h
@@ -87,7 +87,8 @@ struct pnfs_layoutdriver_type {
87 void (*free_lseg) (struct pnfs_layout_segment *lseg); 87 void (*free_lseg) (struct pnfs_layout_segment *lseg);
88 88
89 /* test for nfs page cache coalescing */ 89 /* test for nfs page cache coalescing */
90 bool (*pg_test)(struct nfs_pageio_descriptor *, struct nfs_page *, struct nfs_page *); 90 const struct nfs_pageio_ops *pg_read_ops;
91 const struct nfs_pageio_ops *pg_write_ops;
91 92
92 /* Returns true if layoutdriver wants to divert this request to 93 /* Returns true if layoutdriver wants to divert this request to
93 * driver's commit routine. 94 * driver's commit routine.
@@ -152,6 +153,10 @@ struct pnfs_layout_segment *
152pnfs_update_layout(struct inode *ino, struct nfs_open_context *ctx, 153pnfs_update_layout(struct inode *ino, struct nfs_open_context *ctx,
153 loff_t pos, u64 count, enum pnfs_iomode access_type, 154 loff_t pos, u64 count, enum pnfs_iomode access_type,
154 gfp_t gfp_flags); 155 gfp_t gfp_flags);
156
157bool pnfs_pageio_init_read(struct nfs_pageio_descriptor *, struct inode *);
158bool pnfs_pageio_init_write(struct nfs_pageio_descriptor *, struct inode *, int);
159
155void set_pnfs_layoutdriver(struct nfs_server *, u32 id); 160void set_pnfs_layoutdriver(struct nfs_server *, u32 id);
156void unset_pnfs_layoutdriver(struct nfs_server *); 161void unset_pnfs_layoutdriver(struct nfs_server *);
157enum pnfs_try_status pnfs_try_to_write_data(struct nfs_write_data *, 162enum pnfs_try_status pnfs_try_to_write_data(struct nfs_write_data *,
@@ -293,15 +298,6 @@ static inline int pnfs_return_layout(struct inode *ino)
293 return 0; 298 return 0;
294} 299}
295 300
296static inline void pnfs_pageio_init(struct nfs_pageio_descriptor *pgio,
297 struct inode *inode)
298{
299 struct pnfs_layoutdriver_type *ld = NFS_SERVER(inode)->pnfs_curr_ld;
300
301 if (ld)
302 pgio->pg_test = ld->pg_test;
303}
304
305#else /* CONFIG_NFS_V4_1 */ 301#else /* CONFIG_NFS_V4_1 */
306 302
307static inline void pnfs_destroy_all_layouts(struct nfs_client *clp) 303static inline void pnfs_destroy_all_layouts(struct nfs_client *clp)
@@ -385,9 +381,14 @@ static inline void unset_pnfs_layoutdriver(struct nfs_server *s)
385{ 381{
386} 382}
387 383
388static inline void pnfs_pageio_init(struct nfs_pageio_descriptor *pgio, 384static inline bool pnfs_pageio_init_read(struct nfs_pageio_descriptor *pgio, struct inode *inode)
389 struct inode *inode)
390{ 385{
386 return false;
387}
388
389static inline bool pnfs_pageio_init_write(struct nfs_pageio_descriptor *pgio, struct inode *inode, int ioflags)
390{
391 return false;
391} 392}
392 393
393static inline void 394static inline void