.. | .. |
---|
81 | 81 | u32 fh_versions_cnt; |
---|
82 | 82 | struct nfs_fh *fh_versions; |
---|
83 | 83 | nfs4_stateid stateid; |
---|
84 | | - struct rpc_cred __rcu *ro_cred; |
---|
85 | | - struct rpc_cred __rcu *rw_cred; |
---|
| 84 | + const struct cred __rcu *ro_cred; |
---|
| 85 | + const struct cred __rcu *rw_cred; |
---|
86 | 86 | refcount_t ref; |
---|
87 | 87 | spinlock_t lock; |
---|
88 | 88 | unsigned long flags; |
---|
.. | .. |
---|
99 | 99 | u64 stripe_unit; |
---|
100 | 100 | u32 flags; |
---|
101 | 101 | u32 mirror_array_cnt; |
---|
102 | | - struct nfs4_ff_layout_mirror **mirror_array; |
---|
| 102 | + struct nfs4_ff_layout_mirror *mirror_array[]; |
---|
103 | 103 | }; |
---|
104 | 104 | |
---|
105 | 105 | struct nfs4_flexfile_layout { |
---|
.. | .. |
---|
180 | 180 | return FF_LAYOUT_LSEG(lseg)->flags & FF_FLAGS_NO_READ_IO; |
---|
181 | 181 | } |
---|
182 | 182 | |
---|
183 | | -static inline bool |
---|
184 | | -ff_layout_test_devid_unavailable(struct nfs4_deviceid_node *node) |
---|
185 | | -{ |
---|
186 | | - /* |
---|
187 | | - * Flexfiles should never mark a DS unavailable, but if it does |
---|
188 | | - * print a (ratelimited) warning as this can affect performance. |
---|
189 | | - */ |
---|
190 | | - if (nfs4_test_deviceid_unavailable(node)) { |
---|
191 | | - u32 *p = (u32 *)node->deviceid.data; |
---|
192 | | - |
---|
193 | | - pr_warn_ratelimited("NFS: flexfiles layout referencing an " |
---|
194 | | - "unavailable device [%x%x%x%x]\n", |
---|
195 | | - p[0], p[1], p[2], p[3]); |
---|
196 | | - return true; |
---|
197 | | - } |
---|
198 | | - return false; |
---|
199 | | -} |
---|
200 | | - |
---|
201 | 183 | static inline int |
---|
202 | | -nfs4_ff_layout_ds_version(struct pnfs_layout_segment *lseg, u32 ds_idx) |
---|
| 184 | +nfs4_ff_layout_ds_version(const struct nfs4_ff_layout_mirror *mirror) |
---|
203 | 185 | { |
---|
204 | | - return FF_LAYOUT_COMP(lseg, ds_idx)->mirror_ds->ds_versions[0].version; |
---|
| 186 | + return mirror->mirror_ds->ds_versions[0].version; |
---|
205 | 187 | } |
---|
206 | 188 | |
---|
207 | 189 | struct nfs4_ff_layout_ds * |
---|
.. | .. |
---|
213 | 195 | struct nfs4_ff_layout_mirror *mirror, u64 offset, |
---|
214 | 196 | u64 length, int status, enum nfs_opnum4 opnum, |
---|
215 | 197 | gfp_t gfp_flags); |
---|
| 198 | +void ff_layout_send_layouterror(struct pnfs_layout_segment *lseg); |
---|
216 | 199 | int ff_layout_encode_ds_ioerr(struct xdr_stream *xdr, const struct list_head *head); |
---|
217 | 200 | void ff_layout_free_ds_ioerr(struct list_head *head); |
---|
218 | 201 | unsigned int ff_layout_fetch_ds_ioerr(struct pnfs_layout_hdr *lo, |
---|
.. | .. |
---|
220 | 203 | struct list_head *head, |
---|
221 | 204 | unsigned int maxnum); |
---|
222 | 205 | struct nfs_fh * |
---|
223 | | -nfs4_ff_layout_select_ds_fh(struct pnfs_layout_segment *lseg, u32 mirror_idx); |
---|
224 | | -int |
---|
225 | | -nfs4_ff_layout_select_ds_stateid(struct pnfs_layout_segment *lseg, |
---|
226 | | - u32 mirror_idx, |
---|
227 | | - nfs4_stateid *stateid); |
---|
| 206 | +nfs4_ff_layout_select_ds_fh(struct nfs4_ff_layout_mirror *mirror); |
---|
| 207 | +void |
---|
| 208 | +nfs4_ff_layout_select_ds_stateid(const struct nfs4_ff_layout_mirror *mirror, |
---|
| 209 | + nfs4_stateid *stateid); |
---|
228 | 210 | |
---|
229 | 211 | struct nfs4_pnfs_ds * |
---|
230 | | -nfs4_ff_layout_prepare_ds(struct pnfs_layout_segment *lseg, u32 ds_idx, |
---|
| 212 | +nfs4_ff_layout_prepare_ds(struct pnfs_layout_segment *lseg, |
---|
| 213 | + struct nfs4_ff_layout_mirror *mirror, |
---|
231 | 214 | bool fail_return); |
---|
232 | 215 | |
---|
233 | 216 | struct rpc_clnt * |
---|
234 | | -nfs4_ff_find_or_create_ds_client(struct pnfs_layout_segment *lseg, |
---|
235 | | - u32 ds_idx, |
---|
| 217 | +nfs4_ff_find_or_create_ds_client(struct nfs4_ff_layout_mirror *mirror, |
---|
236 | 218 | struct nfs_client *ds_clp, |
---|
237 | 219 | struct inode *inode); |
---|
238 | | -struct rpc_cred *ff_layout_get_ds_cred(struct pnfs_layout_segment *lseg, |
---|
239 | | - u32 ds_idx, struct rpc_cred *mdscred); |
---|
| 220 | +const struct cred *ff_layout_get_ds_cred(struct nfs4_ff_layout_mirror *mirror, |
---|
| 221 | + const struct pnfs_layout_range *range, |
---|
| 222 | + const struct cred *mdscred); |
---|
240 | 223 | bool ff_layout_avoid_mds_available_ds(struct pnfs_layout_segment *lseg); |
---|
241 | 224 | bool ff_layout_avoid_read_on_rw(struct pnfs_layout_segment *lseg); |
---|
242 | 225 | |
---|