diff options
author | Andy Adamson <andros@netapp.com> | 2009-04-01 09:22:49 -0400 |
---|---|---|
committer | Benny Halevy <bhalevy@panasas.com> | 2009-06-17 15:25:13 -0400 |
commit | b4b82607ffcf09b57301846d154f2c09c0b807c0 (patch) | |
tree | 3ffce1ce6e27d22296ce62b5c8dbe2d32ac2cbef | |
parent | 90a16617ee6a052c3a1aac00eb67136324cf4dd0 (diff) |
nfs41: get_clid_cred for EXCHANGE_ID
Unlike SETCLIENTID, EXCHANGE_ID requires a machine credential. Do not search
for credentials other than the machine credential.
Signed-off-by: Andy Adamson <andros@netapp.com>
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r-- | fs/nfs/nfs4_fs.h | 1 | ||||
-rw-r--r-- | fs/nfs/nfs4proc.c | 2 | ||||
-rw-r--r-- | fs/nfs/nfs4state.c | 14 |
3 files changed, 17 insertions, 0 deletions
diff --git a/fs/nfs/nfs4_fs.h b/fs/nfs/nfs4_fs.h index 1da3e354de22..61bc3a32e1e2 100644 --- a/fs/nfs/nfs4_fs.h +++ b/fs/nfs/nfs4_fs.h | |||
@@ -248,6 +248,7 @@ struct rpc_cred *nfs4_get_setclientid_cred(struct nfs_client *clp); | |||
248 | struct rpc_cred *nfs4_get_renew_cred_locked(struct nfs_client *clp); | 248 | struct rpc_cred *nfs4_get_renew_cred_locked(struct nfs_client *clp); |
249 | #if defined(CONFIG_NFS_V4_1) | 249 | #if defined(CONFIG_NFS_V4_1) |
250 | struct rpc_cred *nfs4_get_machine_cred_locked(struct nfs_client *clp); | 250 | struct rpc_cred *nfs4_get_machine_cred_locked(struct nfs_client *clp); |
251 | struct rpc_cred *nfs4_get_exchange_id_cred(struct nfs_client *clp); | ||
251 | #endif /* CONFIG_NFS_V4_1 */ | 252 | #endif /* CONFIG_NFS_V4_1 */ |
252 | 253 | ||
253 | extern struct nfs4_state_owner * nfs4_get_state_owner(struct nfs_server *, struct rpc_cred *); | 254 | extern struct nfs4_state_owner * nfs4_get_state_owner(struct nfs_server *, struct rpc_cred *); |
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index b4e5442efa6c..64d611658d1f 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -4796,6 +4796,7 @@ struct nfs4_state_recovery_ops nfs41_reboot_recovery_ops = { | |||
4796 | .recover_open = nfs4_open_reclaim, | 4796 | .recover_open = nfs4_open_reclaim, |
4797 | .recover_lock = nfs4_lock_reclaim, | 4797 | .recover_lock = nfs4_lock_reclaim, |
4798 | .establish_clid = nfs4_proc_exchange_id, | 4798 | .establish_clid = nfs4_proc_exchange_id, |
4799 | .get_clid_cred = nfs4_get_exchange_id_cred, | ||
4799 | }; | 4800 | }; |
4800 | #endif /* CONFIG_NFS_V4_1 */ | 4801 | #endif /* CONFIG_NFS_V4_1 */ |
4801 | 4802 | ||
@@ -4815,6 +4816,7 @@ struct nfs4_state_recovery_ops nfs41_nograce_recovery_ops = { | |||
4815 | .recover_open = nfs4_open_expired, | 4816 | .recover_open = nfs4_open_expired, |
4816 | .recover_lock = nfs4_lock_expired, | 4817 | .recover_lock = nfs4_lock_expired, |
4817 | .establish_clid = nfs4_proc_exchange_id, | 4818 | .establish_clid = nfs4_proc_exchange_id, |
4819 | .get_clid_cred = nfs4_get_exchange_id_cred, | ||
4818 | }; | 4820 | }; |
4819 | #endif /* CONFIG_NFS_V4_1 */ | 4821 | #endif /* CONFIG_NFS_V4_1 */ |
4820 | 4822 | ||
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index 90e56072844b..7dc971335ec2 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c | |||
@@ -114,6 +114,20 @@ struct rpc_cred *nfs4_get_renew_cred_locked(struct nfs_client *clp) | |||
114 | return cred; | 114 | return cred; |
115 | } | 115 | } |
116 | 116 | ||
117 | #if defined(CONFIG_NFS_V4_1) | ||
118 | |||
119 | struct rpc_cred *nfs4_get_exchange_id_cred(struct nfs_client *clp) | ||
120 | { | ||
121 | struct rpc_cred *cred; | ||
122 | |||
123 | spin_lock(&clp->cl_lock); | ||
124 | cred = nfs4_get_machine_cred_locked(clp); | ||
125 | spin_unlock(&clp->cl_lock); | ||
126 | return cred; | ||
127 | } | ||
128 | |||
129 | #endif /* CONFIG_NFS_V4_1 */ | ||
130 | |||
117 | struct rpc_cred *nfs4_get_setclientid_cred(struct nfs_client *clp) | 131 | struct rpc_cred *nfs4_get_setclientid_cred(struct nfs_client *clp) |
118 | { | 132 | { |
119 | struct nfs4_state_owner *sp; | 133 | struct nfs4_state_owner *sp; |