aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2012-05-21 22:44:31 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-05-22 16:45:43 -0400
commit79d4e1f0d8910f0214a57832ca6d589640d572c0 (patch)
treec32a4ff22864b554061b0ea6f81667f9f4ef14cf /fs
parent722baafc9e638714a69aa66e9ed24ef961ff350c (diff)
NFS: Use proper naming conventions for NFSv4.1 server scope fields
Clean up: When naming fields and data types, follow established conventions to facilitate accurate grep/cscope searches. Additionally, for consistency, move the scope field into the NFSv4- specific part of the nfs_client, and free that memory in the logic that shuts down NFSv4 nfs_clients. Introduced by commit 99fe60d0 "nfs41: exchange_id operation", April 1 2009. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/client.c2
-rw-r--r--fs/nfs/nfs4_fs.h2
-rw-r--r--fs/nfs/nfs4proc.c18
3 files changed, 12 insertions, 10 deletions
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index b4e2199c32b3..471fc9b927a9 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -237,6 +237,7 @@ static void nfs4_shutdown_client(struct nfs_client *clp)
237 nfs_idmap_delete(clp); 237 nfs_idmap_delete(clp);
238 238
239 rpc_destroy_wait_queue(&clp->cl_rpcwaitq); 239 rpc_destroy_wait_queue(&clp->cl_rpcwaitq);
240 kfree(clp->cl_serverscope);
240} 241}
241 242
242/* idr_remove_all is not needed as all id's are removed by nfs_put_client */ 243/* idr_remove_all is not needed as all id's are removed by nfs_put_client */
@@ -305,7 +306,6 @@ static void nfs_free_client(struct nfs_client *clp)
305 306
306 put_net(clp->net); 307 put_net(clp->net);
307 kfree(clp->cl_hostname); 308 kfree(clp->cl_hostname);
308 kfree(clp->server_scope);
309 kfree(clp->impl_id); 309 kfree(clp->impl_id);
310 kfree(clp); 310 kfree(clp);
311 311
diff --git a/fs/nfs/nfs4_fs.h b/fs/nfs/nfs4_fs.h
index edeef71f957a..b14bcc3c132d 100644
--- a/fs/nfs/nfs4_fs.h
+++ b/fs/nfs/nfs4_fs.h
@@ -338,7 +338,7 @@ extern void nfs4_schedule_stateid_recovery(const struct nfs_server *, struct nfs
338extern void nfs41_handle_sequence_flag_errors(struct nfs_client *clp, u32 flags); 338extern void nfs41_handle_sequence_flag_errors(struct nfs_client *clp, u32 flags);
339extern void nfs41_handle_recall_slot(struct nfs_client *clp); 339extern void nfs41_handle_recall_slot(struct nfs_client *clp);
340extern void nfs41_handle_server_scope(struct nfs_client *, 340extern void nfs41_handle_server_scope(struct nfs_client *,
341 struct server_scope **); 341 struct nfs41_server_scope **);
342extern void nfs4_put_lock_state(struct nfs4_lock_state *lsp); 342extern void nfs4_put_lock_state(struct nfs4_lock_state *lsp);
343extern int nfs4_set_lock_state(struct nfs4_state *state, struct file_lock *fl); 343extern int nfs4_set_lock_state(struct nfs4_state *state, struct file_lock *fl);
344extern void nfs4_select_rw_stateid(nfs4_stateid *, struct nfs4_state *, 344extern void nfs4_select_rw_stateid(nfs4_stateid *, struct nfs4_state *,
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 0f4e54033abf..94494f24bb12 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -5052,7 +5052,8 @@ out_inval:
5052} 5052}
5053 5053
5054static bool 5054static bool
5055nfs41_same_server_scope(struct server_scope *a, struct server_scope *b) 5055nfs41_same_server_scope(struct nfs41_server_scope *a,
5056 struct nfs41_server_scope *b)
5056{ 5057{
5057 if (a->server_scope_sz == b->server_scope_sz && 5058 if (a->server_scope_sz == b->server_scope_sz &&
5058 memcmp(a->server_scope, b->server_scope, a->server_scope_sz) == 0) 5059 memcmp(a->server_scope, b->server_scope, a->server_scope_sz) == 0)
@@ -5099,7 +5100,8 @@ int nfs4_proc_exchange_id(struct nfs_client *clp, struct rpc_cred *cred)
5099 clp->cl_rpcclient->cl_nodename, 5100 clp->cl_rpcclient->cl_nodename,
5100 clp->cl_rpcclient->cl_auth->au_flavor); 5101 clp->cl_rpcclient->cl_auth->au_flavor);
5101 5102
5102 res.server_scope = kzalloc(sizeof(struct server_scope), GFP_KERNEL); 5103 res.server_scope = kzalloc(sizeof(struct nfs41_server_scope),
5104 GFP_KERNEL);
5103 if (unlikely(!res.server_scope)) { 5105 if (unlikely(!res.server_scope)) {
5104 status = -ENOMEM; 5106 status = -ENOMEM;
5105 goto out; 5107 goto out;
@@ -5123,18 +5125,18 @@ int nfs4_proc_exchange_id(struct nfs_client *clp, struct rpc_cred *cred)
5123 kfree(res.impl_id); 5125 kfree(res.impl_id);
5124 5126
5125 if (!status) { 5127 if (!status) {
5126 if (clp->server_scope && 5128 if (clp->cl_serverscope &&
5127 !nfs41_same_server_scope(clp->server_scope, 5129 !nfs41_same_server_scope(clp->cl_serverscope,
5128 res.server_scope)) { 5130 res.server_scope)) {
5129 dprintk("%s: server_scope mismatch detected\n", 5131 dprintk("%s: server_scope mismatch detected\n",
5130 __func__); 5132 __func__);
5131 set_bit(NFS4CLNT_SERVER_SCOPE_MISMATCH, &clp->cl_state); 5133 set_bit(NFS4CLNT_SERVER_SCOPE_MISMATCH, &clp->cl_state);
5132 kfree(clp->server_scope); 5134 kfree(clp->cl_serverscope);
5133 clp->server_scope = NULL; 5135 clp->cl_serverscope = NULL;
5134 } 5136 }
5135 5137
5136 if (!clp->server_scope) { 5138 if (!clp->cl_serverscope) {
5137 clp->server_scope = res.server_scope; 5139 clp->cl_serverscope = res.server_scope;
5138 goto out; 5140 goto out;
5139 } 5141 }
5140 } 5142 }