| .. | .. |
|---|
| 42 | 42 | struct nfs_page { |
|---|
| 43 | 43 | struct list_head wb_list; /* Defines state of page: */ |
|---|
| 44 | 44 | struct page *wb_page; /* page to read in/write out */ |
|---|
| 45 | | - struct nfs_open_context *wb_context; /* File state context info */ |
|---|
| 46 | 45 | struct nfs_lock_context *wb_lock_context; /* lock context info */ |
|---|
| 47 | 46 | pgoff_t wb_index; /* Offset >> PAGE_SHIFT */ |
|---|
| 48 | 47 | unsigned int wb_offset, /* Offset & ~PAGE_MASK */ |
|---|
| .. | .. |
|---|
| 53 | 52 | struct nfs_write_verifier wb_verf; /* Commit cookie */ |
|---|
| 54 | 53 | struct nfs_page *wb_this_page; /* list of reqs for this page */ |
|---|
| 55 | 54 | struct nfs_page *wb_head; /* head pointer for req list */ |
|---|
| 55 | + unsigned short wb_nio; /* Number of I/O attempts */ |
|---|
| 56 | 56 | }; |
|---|
| 57 | 57 | |
|---|
| 58 | +struct nfs_pgio_mirror; |
|---|
| 58 | 59 | struct nfs_pageio_descriptor; |
|---|
| 59 | 60 | struct nfs_pageio_ops { |
|---|
| 60 | 61 | void (*pg_init)(struct nfs_pageio_descriptor *, struct nfs_page *); |
|---|
| .. | .. |
|---|
| 64 | 65 | unsigned int (*pg_get_mirror_count)(struct nfs_pageio_descriptor *, |
|---|
| 65 | 66 | struct nfs_page *); |
|---|
| 66 | 67 | 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); |
|---|
| 67 | 71 | }; |
|---|
| 68 | 72 | |
|---|
| 69 | 73 | struct nfs_rw_ops { |
|---|
| .. | .. |
|---|
| 87 | 91 | }; |
|---|
| 88 | 92 | |
|---|
| 89 | 93 | struct nfs_pageio_descriptor { |
|---|
| 90 | | - unsigned char pg_moreio : 1; |
|---|
| 91 | 94 | struct inode *pg_inode; |
|---|
| 92 | 95 | const struct nfs_pageio_ops *pg_ops; |
|---|
| 93 | 96 | const struct nfs_rw_ops *pg_rw_ops; |
|---|
| .. | .. |
|---|
| 105 | 108 | struct nfs_pgio_mirror pg_mirrors_static[1]; |
|---|
| 106 | 109 | struct nfs_pgio_mirror *pg_mirrors_dynamic; |
|---|
| 107 | 110 | u32 pg_mirror_idx; /* current mirror */ |
|---|
| 111 | + unsigned short pg_maxretrans; |
|---|
| 112 | + unsigned char pg_moreio : 1; |
|---|
| 108 | 113 | }; |
|---|
| 109 | 114 | |
|---|
| 110 | 115 | /* arbitrarily selected limit to number of mirrors */ |
|---|
| .. | .. |
|---|
| 114 | 119 | |
|---|
| 115 | 120 | extern struct nfs_page *nfs_create_request(struct nfs_open_context *ctx, |
|---|
| 116 | 121 | struct page *page, |
|---|
| 117 | | - struct nfs_page *last, |
|---|
| 118 | 122 | unsigned int offset, |
|---|
| 119 | 123 | unsigned int count); |
|---|
| 120 | 124 | extern void nfs_release_request(struct nfs_page *); |
|---|
| .. | .. |
|---|
| 139 | 143 | extern int nfs_wait_on_request(struct nfs_page *); |
|---|
| 140 | 144 | extern void nfs_unlock_request(struct nfs_page *req); |
|---|
| 141 | 145 | 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, |
|---|
| 149 | + struct nfs_commit_info *cinfo, |
|---|
| 150 | + struct inode *inode); |
|---|
| 142 | 151 | extern int nfs_page_group_lock(struct nfs_page *); |
|---|
| 143 | 152 | extern void nfs_page_group_unlock(struct nfs_page *); |
|---|
| 144 | 153 | extern bool nfs_page_group_sync_on_bit(struct nfs_page *, unsigned int); |
|---|
| .. | .. |
|---|
| 201 | 210 | return (((loff_t)req->wb_index) << PAGE_SHIFT) + req->wb_offset; |
|---|
| 202 | 211 | } |
|---|
| 203 | 212 | |
|---|
| 213 | +static inline struct nfs_open_context * |
|---|
| 214 | +nfs_req_openctx(struct nfs_page *req) |
|---|
| 215 | +{ |
|---|
| 216 | + return req->wb_lock_context->open_context; |
|---|
| 217 | +} |
|---|
| 218 | + |
|---|
| 204 | 219 | #endif /* _LINUX_NFS_PAGE_H */ |
|---|