diff options
author | Andy Adamson <andros@netapp.com> | 2010-10-20 00:18:03 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-10-24 18:07:10 -0400 |
commit | b1f69b754ee312ec75f2c7ead0e6851cd9598cc2 (patch) | |
tree | 1d8e70abb2cd087e3b97f73d86db8b9568467378 /include | |
parent | 974cec8ca0352eb5d281535b714cf194a606e98f (diff) |
NFSv4.1: pnfs: add LAYOUTGET and GETDEVICEINFO infrastructure
Add the ability to actually send LAYOUTGET and GETDEVICEINFO. This also adds
in the machinery to handle layout state and the deviceid cache. Note that
GETDEVICEINFO is not called directly by the generic layer. Instead it
is called by the drivers while parsing the LAYOUTGET opaque data in response
to an unknown device id embedded therein. RFC 5661 only encodes
device ids within the driver-specific opaque data.
Signed-off-by: Andy Adamson <andros@netapp.com>
Signed-off-by: Dean Hildebrand <dhildebz@umich.edu>
Signed-off-by: Marc Eshel <eshel@almaden.ibm.com>
Signed-off-by: Mike Sager <sager@netapp.com>
Signed-off-by: Ricardo Labiaga <ricardo.labiaga@netapp.com>
Signed-off-by: Tao Guo <guotao@nrchpc.ac.cn>
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: Fred Isaman <iisaman@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/nfs4.h | 2 | ||||
-rw-r--r-- | include/linux/nfs_fs_sb.h | 1 | ||||
-rw-r--r-- | include/linux/nfs_xdr.h | 49 |
3 files changed, 52 insertions, 0 deletions
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index 34da32436ac0..a9683d6acaa4 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h | |||
@@ -545,6 +545,8 @@ enum { | |||
545 | NFSPROC4_CLNT_SEQUENCE, | 545 | NFSPROC4_CLNT_SEQUENCE, |
546 | NFSPROC4_CLNT_GET_LEASE_TIME, | 546 | NFSPROC4_CLNT_GET_LEASE_TIME, |
547 | NFSPROC4_CLNT_RECLAIM_COMPLETE, | 547 | NFSPROC4_CLNT_RECLAIM_COMPLETE, |
548 | NFSPROC4_CLNT_LAYOUTGET, | ||
549 | NFSPROC4_CLNT_GETDEVICEINFO, | ||
548 | }; | 550 | }; |
549 | 551 | ||
550 | /* nfs41 types */ | 552 | /* nfs41 types */ |
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h index 4d62f1581ed1..452d96436d26 100644 --- a/include/linux/nfs_fs_sb.h +++ b/include/linux/nfs_fs_sb.h | |||
@@ -83,6 +83,7 @@ struct nfs_client { | |||
83 | u32 cl_exchange_flags; | 83 | u32 cl_exchange_flags; |
84 | struct nfs4_session *cl_session; /* sharred session */ | 84 | struct nfs4_session *cl_session; /* sharred session */ |
85 | struct list_head cl_layouts; | 85 | struct list_head cl_layouts; |
86 | struct pnfs_deviceid_cache *cl_devid_cache; /* pNFS deviceid cache */ | ||
86 | #endif /* CONFIG_NFS_V4_1 */ | 87 | #endif /* CONFIG_NFS_V4_1 */ |
87 | 88 | ||
88 | #ifdef CONFIG_NFS_FSCACHE | 89 | #ifdef CONFIG_NFS_FSCACHE |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index 065f9d105d05..ba6cc8f223c9 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
@@ -187,6 +187,55 @@ struct nfs4_get_lease_time_res { | |||
187 | struct nfs4_sequence_res lr_seq_res; | 187 | struct nfs4_sequence_res lr_seq_res; |
188 | }; | 188 | }; |
189 | 189 | ||
190 | #define PNFS_LAYOUT_MAXSIZE 4096 | ||
191 | |||
192 | struct nfs4_layoutdriver_data { | ||
193 | __u32 len; | ||
194 | void *buf; | ||
195 | }; | ||
196 | |||
197 | struct pnfs_layout_range { | ||
198 | u32 iomode; | ||
199 | u64 offset; | ||
200 | u64 length; | ||
201 | }; | ||
202 | |||
203 | struct nfs4_layoutget_args { | ||
204 | __u32 type; | ||
205 | struct pnfs_layout_range range; | ||
206 | __u64 minlength; | ||
207 | __u32 maxcount; | ||
208 | struct inode *inode; | ||
209 | struct nfs_open_context *ctx; | ||
210 | struct nfs4_sequence_args seq_args; | ||
211 | }; | ||
212 | |||
213 | struct nfs4_layoutget_res { | ||
214 | __u32 return_on_close; | ||
215 | struct pnfs_layout_range range; | ||
216 | __u32 type; | ||
217 | nfs4_stateid stateid; | ||
218 | struct nfs4_layoutdriver_data layout; | ||
219 | struct nfs4_sequence_res seq_res; | ||
220 | }; | ||
221 | |||
222 | struct nfs4_layoutget { | ||
223 | struct nfs4_layoutget_args args; | ||
224 | struct nfs4_layoutget_res res; | ||
225 | struct pnfs_layout_segment **lsegpp; | ||
226 | int status; | ||
227 | }; | ||
228 | |||
229 | struct nfs4_getdeviceinfo_args { | ||
230 | struct pnfs_device *pdev; | ||
231 | struct nfs4_sequence_args seq_args; | ||
232 | }; | ||
233 | |||
234 | struct nfs4_getdeviceinfo_res { | ||
235 | struct pnfs_device *pdev; | ||
236 | struct nfs4_sequence_res seq_res; | ||
237 | }; | ||
238 | |||
190 | /* | 239 | /* |
191 | * Arguments to the open call. | 240 | * Arguments to the open call. |
192 | */ | 241 | */ |