diff options
| author | Benny Halevy <bhalevy@panasas.com> | 2009-04-01 09:22:29 -0400 |
|---|---|---|
| committer | Benny Halevy <bhalevy@panasas.com> | 2009-06-17 15:23:57 -0400 |
| commit | 99fe60d062cfecf382c036065b3278b82b6c5eff (patch) | |
| tree | b4451fc4bb42c0915c4f736cc5fdae9e818b55d4 /include | |
| parent | 938e10109115a71cc69d475122f21cf75e5046cd (diff) | |
nfs41: exchange_id operation
Implement the exchange_id operation conforming to
http://tools.ietf.org/html/draft-ietf-nfsv4-minorversion1-26
Unlike NFSv4.0, NFSv4.1 requires machine credentials. RPC_AUTH_GSS machine
credentials will be passed into the kernel at mount time to be available for
the exchange_id operation.
RPC_AUTH_UNIX root mounts can use the UNIX root credential. Store the root
credential in the nfs_client struct.
Without a credential, NFSv4.1 state renewal fails.
[nfs41: establish clientid via exchange id only if cred != NULL]
Signed-off-by: Andy Adamson<andros@umich.edu>
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
[nfsd41: move nfstime4 from under CONFIG_NFS_V4_1]
Signed-off-by: Andy Adamson <andros@netapp.com>
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
[nfs41: do not wait a lease time in exchange id]
Signed-off-by: Andy Adamson <andros@netapp.com>
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
[nfs41: pass *session in seq_args and seq_res]
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
[nfs41: Ignoring impid in decode_exchange_id is missing a READ_BUF]
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
[nfs41: fix Xcode_exchange_id's xdr Xcoding pointer type]
[nfs41: get rid of unused struct nfs41_exchange_id_res members]
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/nfs4.h | 1 | ||||
| -rw-r--r-- | include/linux/nfs_fs_sb.h | 6 | ||||
| -rw-r--r-- | include/linux/nfs_xdr.h | 40 | ||||
| -rw-r--r-- | include/linux/nfsd/state.h | 1 |
4 files changed, 47 insertions, 1 deletions
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index 7c36fcf2dfb7..ad65709ed8d3 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h | |||
| @@ -21,6 +21,7 @@ | |||
| 21 | #define NFS4_FHSIZE 128 | 21 | #define NFS4_FHSIZE 128 |
| 22 | #define NFS4_MAXPATHLEN PATH_MAX | 22 | #define NFS4_MAXPATHLEN PATH_MAX |
| 23 | #define NFS4_MAXNAMLEN NAME_MAX | 23 | #define NFS4_MAXNAMLEN NAME_MAX |
| 24 | #define NFS4_OPAQUE_LIMIT 1024 | ||
| 24 | #define NFS4_MAX_SESSIONID_LEN 16 | 25 | #define NFS4_MAX_SESSIONID_LEN 16 |
| 25 | 26 | ||
| 26 | #define NFS4_ACCESS_READ 0x0001 | 27 | #define NFS4_ACCESS_READ 0x0001 |
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h index 206485e5082f..435ed556efb5 100644 --- a/include/linux/nfs_fs_sb.h +++ b/include/linux/nfs_fs_sb.h | |||
| @@ -78,6 +78,12 @@ struct nfs_client { | |||
| 78 | #endif /* CONFIG_NFS_V4 */ | 78 | #endif /* CONFIG_NFS_V4 */ |
| 79 | 79 | ||
| 80 | #ifdef CONFIG_NFS_V4_1 | 80 | #ifdef CONFIG_NFS_V4_1 |
| 81 | /* clientid returned from EXCHANGE_ID, used by session operations */ | ||
| 82 | u64 cl_ex_clid; | ||
| 83 | /* The sequence id to use for the next CREATE_SESSION */ | ||
| 84 | u32 cl_seqid; | ||
| 85 | /* The flags used for obtaining the clientid during EXCHANGE_ID */ | ||
| 86 | u32 cl_exchange_flags; | ||
| 81 | struct nfs4_session *cl_session; /* sharred session */ | 87 | struct nfs4_session *cl_session; /* sharred session */ |
| 82 | #endif /* CONFIG_NFS_V4_1 */ | 88 | #endif /* CONFIG_NFS_V4_1 */ |
| 83 | 89 | ||
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index 4ac14b40efc9..5d70b924af5e 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
| @@ -879,6 +879,46 @@ struct nfs4_fs_locations_res { | |||
| 879 | 879 | ||
| 880 | #endif /* CONFIG_NFS_V4 */ | 880 | #endif /* CONFIG_NFS_V4 */ |
| 881 | 881 | ||
| 882 | struct nfstime4 { | ||
| 883 | u64 seconds; | ||
| 884 | u32 nseconds; | ||
| 885 | }; | ||
| 886 | |||
| 887 | #ifdef CONFIG_NFS_V4_1 | ||
| 888 | struct nfs_impl_id4 { | ||
| 889 | u32 domain_len; | ||
| 890 | char *domain; | ||
| 891 | u32 name_len; | ||
| 892 | char *name; | ||
| 893 | struct nfstime4 date; | ||
| 894 | }; | ||
| 895 | |||
| 896 | #define NFS4_EXCHANGE_ID_LEN (48) | ||
| 897 | struct nfs41_exchange_id_args { | ||
| 898 | struct nfs_client *client; | ||
| 899 | nfs4_verifier *verifier; | ||
| 900 | unsigned int id_len; | ||
| 901 | char id[NFS4_EXCHANGE_ID_LEN]; | ||
| 902 | u32 flags; | ||
| 903 | }; | ||
| 904 | |||
| 905 | struct server_owner { | ||
| 906 | uint64_t minor_id; | ||
| 907 | uint32_t major_id_sz; | ||
| 908 | char major_id[NFS4_OPAQUE_LIMIT]; | ||
| 909 | }; | ||
| 910 | |||
| 911 | struct server_scope { | ||
| 912 | uint32_t server_scope_sz; | ||
| 913 | char server_scope[NFS4_OPAQUE_LIMIT]; | ||
| 914 | }; | ||
| 915 | |||
| 916 | struct nfs41_exchange_id_res { | ||
| 917 | struct nfs_client *client; | ||
| 918 | u32 flags; | ||
| 919 | }; | ||
| 920 | #endif /* CONFIG_NFS_V4_1 */ | ||
| 921 | |||
| 882 | struct nfs_page; | 922 | struct nfs_page; |
| 883 | 923 | ||
| 884 | #define NFS_PAGEVEC_SIZE (8U) | 924 | #define NFS_PAGEVEC_SIZE (8U) |
diff --git a/include/linux/nfsd/state.h b/include/linux/nfsd/state.h index 4d61c873feed..7ef4b7ad1214 100644 --- a/include/linux/nfsd/state.h +++ b/include/linux/nfsd/state.h | |||
| @@ -41,7 +41,6 @@ | |||
| 41 | #include <linux/kref.h> | 41 | #include <linux/kref.h> |
| 42 | #include <linux/sunrpc/clnt.h> | 42 | #include <linux/sunrpc/clnt.h> |
| 43 | 43 | ||
| 44 | #define NFS4_OPAQUE_LIMIT 1024 | ||
| 45 | typedef struct { | 44 | typedef struct { |
| 46 | u32 cl_boot; | 45 | u32 cl_boot; |
| 47 | u32 cl_id; | 46 | u32 cl_id; |
