aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/nfs_page.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/nfs_page.h')
-rw-r--r--include/linux/nfs_page.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h
index 25311b3bedf..d378f08b905 100644
--- a/include/linux/nfs_page.h
+++ b/include/linux/nfs_page.h
@@ -55,6 +55,12 @@ struct nfs_page {
55 struct nfs_writeverf wb_verf; /* Commit cookie */ 55 struct nfs_writeverf wb_verf; /* Commit cookie */
56}; 56};
57 57
58struct nfs_pageio_descriptor;
59struct nfs_pageio_ops {
60 bool (*pg_test)(struct nfs_pageio_descriptor *, struct nfs_page *, struct nfs_page *);
61 int (*pg_doio)(struct nfs_pageio_descriptor *);
62};
63
58struct nfs_pageio_descriptor { 64struct nfs_pageio_descriptor {
59 struct list_head pg_list; 65 struct list_head pg_list;
60 unsigned long pg_bytes_written; 66 unsigned long pg_bytes_written;
@@ -64,11 +70,10 @@ struct nfs_pageio_descriptor {
64 char pg_moreio; 70 char pg_moreio;
65 71
66 struct inode *pg_inode; 72 struct inode *pg_inode;
67 int (*pg_doio)(struct nfs_pageio_descriptor *); 73 const struct nfs_pageio_ops *pg_ops;
68 int pg_ioflags; 74 int pg_ioflags;
69 int pg_error; 75 int pg_error;
70 struct pnfs_layout_segment *pg_lseg; 76 struct pnfs_layout_segment *pg_lseg;
71 bool (*pg_test)(struct nfs_pageio_descriptor *, struct nfs_page *, struct nfs_page *);
72}; 77};
73 78
74#define NFS_WBACK_BUSY(req) (test_bit(PG_BUSY,&(req)->wb_flags)) 79#define NFS_WBACK_BUSY(req) (test_bit(PG_BUSY,&(req)->wb_flags))
@@ -85,7 +90,7 @@ extern int nfs_scan_list(struct nfs_inode *nfsi, struct list_head *dst,
85 pgoff_t idx_start, unsigned int npages, int tag); 90 pgoff_t idx_start, unsigned int npages, int tag);
86extern void nfs_pageio_init(struct nfs_pageio_descriptor *desc, 91extern void nfs_pageio_init(struct nfs_pageio_descriptor *desc,
87 struct inode *inode, 92 struct inode *inode,
88 int (*doio)(struct nfs_pageio_descriptor *desc), 93 const struct nfs_pageio_ops *pg_ops,
89 size_t bsize, 94 size_t bsize,
90 int how); 95 int how);
91extern int nfs_pageio_add_request(struct nfs_pageio_descriptor *, 96extern int nfs_pageio_add_request(struct nfs_pageio_descriptor *,
@@ -100,6 +105,9 @@ extern void nfs_unlock_request(struct nfs_page *req);
100extern int nfs_set_page_tag_locked(struct nfs_page *req); 105extern int nfs_set_page_tag_locked(struct nfs_page *req);
101extern void nfs_clear_page_tag_locked(struct nfs_page *req); 106extern void nfs_clear_page_tag_locked(struct nfs_page *req);
102 107
108extern int nfs_generic_pg_readpages(struct nfs_pageio_descriptor *desc);
109extern int nfs_generic_pg_writepages(struct nfs_pageio_descriptor *desc);
110
103 111
104/* 112/*
105 * Lock the page of an asynchronous request without getting a new reference 113 * Lock the page of an asynchronous request without getting a new reference