NFS: Use proper naming conventions for nfs_client.impl_id field
authorChuck Lever <chuck.lever@oracle.com>
Tue, 22 May 2012 02:44:41 +0000 (22:44 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Tue, 22 May 2012 20:45:43 +0000 (16:45 -0400)
Clean up:  When naming fields and data types, follow established
conventions to facilitate accurate grep/cscope searches.

Additionally, for consistency, move the impl_id 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 7d2ed9ac "NFSv4: parse and display server
implementation ids," Fri Feb 17, 2012.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/client.c
fs/nfs/nfs4proc.c
fs/nfs/super.c
include/linux/nfs_fs_sb.h

index 471fc9b927a9676823131197d0a4d47482d4fcb5..39db1beb92f8c7797ecd659ba90b823ee807ff9c 100644 (file)
@@ -238,6 +238,7 @@ static void nfs4_shutdown_client(struct nfs_client *clp)
 
        rpc_destroy_wait_queue(&clp->cl_rpcwaitq);
        kfree(clp->cl_serverscope);
+       kfree(clp->cl_implid);
 }
 
 /* idr_remove_all is not needed as all id's are removed by nfs_put_client */
@@ -306,7 +307,6 @@ static void nfs_free_client(struct nfs_client *clp)
 
        put_net(clp->net);
        kfree(clp->cl_hostname);
-       kfree(clp->impl_id);
        kfree(clp);
 
        dprintk("<-- nfs_free_client()\n");
index 94494f24bb12adb7bf68e87b35fc17da7d3a8026..daa4e1b17313903e47d46e169d4ca70509599050 100644 (file)
@@ -5119,8 +5119,8 @@ int nfs4_proc_exchange_id(struct nfs_client *clp, struct rpc_cred *cred)
 
        if (!status) {
                /* use the most recent implementation id */
-               kfree(clp->impl_id);
-               clp->impl_id = res.impl_id;
+               kfree(clp->cl_implid);
+               clp->cl_implid = res.impl_id;
        } else
                kfree(res.impl_id);
 
@@ -5144,12 +5144,12 @@ int nfs4_proc_exchange_id(struct nfs_client *clp, struct rpc_cred *cred)
 out_server_scope:
        kfree(res.server_scope);
 out:
-       if (clp->impl_id)
+       if (clp->cl_implid)
                dprintk("%s: Server Implementation ID: "
                        "domain: %s, name: %s, date: %llu,%u\n",
-                       __func__, clp->impl_id->domain, clp->impl_id->name,
-                       clp->impl_id->date.seconds,
-                       clp->impl_id->date.nseconds);
+                       __func__, clp->cl_implid->domain, clp->cl_implid->name,
+                       clp->cl_implid->date.seconds,
+                       clp->cl_implid->date.nseconds);
        dprintk("<-- %s status= %d\n", __func__, status);
        return status;
 }
index a973eb101a928df8524ddb13da26bb40a7243564..ff656c022684e9e2b0d94587cf9d807d670bd715 100644 (file)
@@ -796,8 +796,8 @@ static void show_pnfs(struct seq_file *m, struct nfs_server *server)
 
 static void show_implementation_id(struct seq_file *m, struct nfs_server *nfss)
 {
-       if (nfss->nfs_client && nfss->nfs_client->impl_id) {
-               struct nfs41_impl_id *impl_id = nfss->nfs_client->impl_id;
+       if (nfss->nfs_client && nfss->nfs_client->cl_implid) {
+               struct nfs41_impl_id *impl_id = nfss->nfs_client->cl_implid;
                seq_printf(m, "\n\timpl_id:\tname='%s',domain='%s',"
                           "date='%llu,%u'",
                           impl_id->name, impl_id->domain,
index 900d733668eb4a9b1a5256e6dce12cd0d3072a96..773e02135903fa36bd75a9c7948ad36eb6e9acdb 100644 (file)
@@ -81,13 +81,13 @@ struct nfs_client {
        u32                     cl_exchange_flags;
        struct nfs4_session     *cl_session;    /* shared session */
        struct nfs41_server_scope *cl_serverscope;
+       struct nfs41_impl_id    *cl_implid;
 #endif /* CONFIG_NFS_V4 */
 
 #ifdef CONFIG_NFS_FSCACHE
        struct fscache_cookie   *fscache;       /* client index cache cookie */
 #endif
 
-       struct nfs41_impl_id    *impl_id;       /* from exchange_id */
        struct net              *net;
 };