hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/include/linux/nfs_page.h
....@@ -42,7 +42,6 @@
4242 struct nfs_page {
4343 struct list_head wb_list; /* Defines state of page: */
4444 struct page *wb_page; /* page to read in/write out */
45
- struct nfs_open_context *wb_context; /* File state context info */
4645 struct nfs_lock_context *wb_lock_context; /* lock context info */
4746 pgoff_t wb_index; /* Offset >> PAGE_SHIFT */
4847 unsigned int wb_offset, /* Offset & ~PAGE_MASK */
....@@ -53,8 +52,10 @@
5352 struct nfs_write_verifier wb_verf; /* Commit cookie */
5453 struct nfs_page *wb_this_page; /* list of reqs for this page */
5554 struct nfs_page *wb_head; /* head pointer for req list */
55
+ unsigned short wb_nio; /* Number of I/O attempts */
5656 };
5757
58
+struct nfs_pgio_mirror;
5859 struct nfs_pageio_descriptor;
5960 struct nfs_pageio_ops {
6061 void (*pg_init)(struct nfs_pageio_descriptor *, struct nfs_page *);
....@@ -64,6 +65,9 @@
6465 unsigned int (*pg_get_mirror_count)(struct nfs_pageio_descriptor *,
6566 struct nfs_page *);
6667 void (*pg_cleanup)(struct nfs_pageio_descriptor *);
68
+ struct nfs_pgio_mirror *
69
+ (*pg_get_mirror)(struct nfs_pageio_descriptor *, u32);
70
+ u32 (*pg_set_mirror)(struct nfs_pageio_descriptor *, u32);
6771 };
6872
6973 struct nfs_rw_ops {
....@@ -87,7 +91,6 @@
8791 };
8892
8993 struct nfs_pageio_descriptor {
90
- unsigned char pg_moreio : 1;
9194 struct inode *pg_inode;
9295 const struct nfs_pageio_ops *pg_ops;
9396 const struct nfs_rw_ops *pg_rw_ops;
....@@ -105,6 +108,8 @@
105108 struct nfs_pgio_mirror pg_mirrors_static[1];
106109 struct nfs_pgio_mirror *pg_mirrors_dynamic;
107110 u32 pg_mirror_idx; /* current mirror */
111
+ unsigned short pg_maxretrans;
112
+ unsigned char pg_moreio : 1;
108113 };
109114
110115 /* arbitrarily selected limit to number of mirrors */
....@@ -114,7 +119,6 @@
114119
115120 extern struct nfs_page *nfs_create_request(struct nfs_open_context *ctx,
116121 struct page *page,
117
- struct nfs_page *last,
118122 unsigned int offset,
119123 unsigned int count);
120124 extern void nfs_release_request(struct nfs_page *);
....@@ -139,6 +143,9 @@
139143 extern int nfs_wait_on_request(struct nfs_page *);
140144 extern void nfs_unlock_request(struct nfs_page *req);
141145 extern void nfs_unlock_and_release_request(struct nfs_page *);
146
+extern struct nfs_page *nfs_page_group_lock_head(struct nfs_page *req);
147
+extern int nfs_page_group_lock_subrequests(struct nfs_page *head);
148
+extern void nfs_join_page_group(struct nfs_page *head, struct inode *inode);
142149 extern int nfs_page_group_lock(struct nfs_page *);
143150 extern void nfs_page_group_unlock(struct nfs_page *);
144151 extern bool nfs_page_group_sync_on_bit(struct nfs_page *, unsigned int);
....@@ -201,4 +208,10 @@
201208 return (((loff_t)req->wb_index) << PAGE_SHIFT) + req->wb_offset;
202209 }
203210
211
+static inline struct nfs_open_context *
212
+nfs_req_openctx(struct nfs_page *req)
213
+{
214
+ return req->wb_lock_context->open_context;
215
+}
216
+
204217 #endif /* _LINUX_NFS_PAGE_H */