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.h20
1 files changed, 6 insertions, 14 deletions
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h
index eac30d6bec17..88d166b555e8 100644
--- a/include/linux/nfs_page.h
+++ b/include/linux/nfs_page.h
@@ -27,7 +27,6 @@ enum {
27 PG_CLEAN, 27 PG_CLEAN,
28 PG_NEED_COMMIT, 28 PG_NEED_COMMIT,
29 PG_NEED_RESCHED, 29 PG_NEED_RESCHED,
30 PG_PARTIAL_READ_FAILED,
31 PG_COMMIT_TO_DS, 30 PG_COMMIT_TO_DS,
32}; 31};
33 32
@@ -37,7 +36,6 @@ struct nfs_page {
37 struct page *wb_page; /* page to read in/write out */ 36 struct page *wb_page; /* page to read in/write out */
38 struct nfs_open_context *wb_context; /* File state context info */ 37 struct nfs_open_context *wb_context; /* File state context info */
39 struct nfs_lock_context *wb_lock_context; /* lock context info */ 38 struct nfs_lock_context *wb_lock_context; /* lock context info */
40 atomic_t wb_complete; /* i/os we're waiting for */
41 pgoff_t wb_index; /* Offset >> PAGE_CACHE_SHIFT */ 39 pgoff_t wb_index; /* Offset >> PAGE_CACHE_SHIFT */
42 unsigned int wb_offset, /* Offset & ~PAGE_CACHE_MASK */ 40 unsigned int wb_offset, /* Offset & ~PAGE_CACHE_MASK */
43 wb_pgbase, /* Start of page data */ 41 wb_pgbase, /* Start of page data */
@@ -68,7 +66,9 @@ struct nfs_pageio_descriptor {
68 int pg_ioflags; 66 int pg_ioflags;
69 int pg_error; 67 int pg_error;
70 const struct rpc_call_ops *pg_rpc_callops; 68 const struct rpc_call_ops *pg_rpc_callops;
69 const struct nfs_pgio_completion_ops *pg_completion_ops;
71 struct pnfs_layout_segment *pg_lseg; 70 struct pnfs_layout_segment *pg_lseg;
71 struct nfs_direct_req *pg_dreq;
72}; 72};
73 73
74#define NFS_WBACK_BUSY(req) (test_bit(PG_BUSY,&(req)->wb_flags)) 74#define NFS_WBACK_BUSY(req) (test_bit(PG_BUSY,&(req)->wb_flags))
@@ -84,6 +84,7 @@ extern void nfs_release_request(struct nfs_page *req);
84extern void nfs_pageio_init(struct nfs_pageio_descriptor *desc, 84extern void nfs_pageio_init(struct nfs_pageio_descriptor *desc,
85 struct inode *inode, 85 struct inode *inode,
86 const struct nfs_pageio_ops *pg_ops, 86 const struct nfs_pageio_ops *pg_ops,
87 const struct nfs_pgio_completion_ops *compl_ops,
87 size_t bsize, 88 size_t bsize,
88 int how); 89 int how);
89extern int nfs_pageio_add_request(struct nfs_pageio_descriptor *, 90extern int nfs_pageio_add_request(struct nfs_pageio_descriptor *,
@@ -95,26 +96,17 @@ extern bool nfs_generic_pg_test(struct nfs_pageio_descriptor *desc,
95 struct nfs_page *req); 96 struct nfs_page *req);
96extern int nfs_wait_on_request(struct nfs_page *); 97extern int nfs_wait_on_request(struct nfs_page *);
97extern void nfs_unlock_request(struct nfs_page *req); 98extern void nfs_unlock_request(struct nfs_page *req);
99extern void nfs_unlock_and_release_request(struct nfs_page *req);
98 100
99/* 101/*
100 * Lock the page of an asynchronous request without getting a new reference 102 * Lock the page of an asynchronous request
101 */ 103 */
102static inline int 104static inline int
103nfs_lock_request_dontget(struct nfs_page *req)
104{
105 return !test_and_set_bit(PG_BUSY, &req->wb_flags);
106}
107
108static inline int
109nfs_lock_request(struct nfs_page *req) 105nfs_lock_request(struct nfs_page *req)
110{ 106{
111 if (test_and_set_bit(PG_BUSY, &req->wb_flags)) 107 return !test_and_set_bit(PG_BUSY, &req->wb_flags);
112 return 0;
113 kref_get(&req->wb_kref);
114 return 1;
115} 108}
116 109
117
118/** 110/**
119 * nfs_list_add_request - Insert a request into a list 111 * nfs_list_add_request - Insert a request into a list
120 * @req: request 112 * @req: request