diff options
author | Weston Andros Adamson <dros@netapp.com> | 2012-02-17 15:20:26 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-03-01 17:10:22 -0500 |
commit | 7d2ed9ac22bc6bf0d34e8fd291a5295f373b384e (patch) | |
tree | d6af20f85e68c075c6587afaa94f56fe001aae4b /fs/nfs/nfs4proc.c | |
parent | 9edbd953f8aeabf49b89c7c29ff9e31560775b27 (diff) |
NFSv4: parse and display server implementation ids
Shows the implementation ids in /proc/self/mountstats. This doesn't break
the nfs-utils mountstats tool.
Signed-off-by: Weston Andros Adamson <dros@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r-- | fs/nfs/nfs4proc.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 20c3bb06763a..90a17cc3ebc9 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -4950,11 +4950,24 @@ int nfs4_proc_exchange_id(struct nfs_client *clp, struct rpc_cred *cred) | |||
4950 | goto out; | 4950 | goto out; |
4951 | } | 4951 | } |
4952 | 4952 | ||
4953 | res.impl_id = kzalloc(sizeof(struct nfs41_impl_id), GFP_KERNEL); | ||
4954 | if (unlikely(!res.impl_id)) { | ||
4955 | status = -ENOMEM; | ||
4956 | goto out_server_scope; | ||
4957 | } | ||
4958 | |||
4953 | status = rpc_call_sync(clp->cl_rpcclient, &msg, RPC_TASK_TIMEOUT); | 4959 | status = rpc_call_sync(clp->cl_rpcclient, &msg, RPC_TASK_TIMEOUT); |
4954 | if (!status) | 4960 | if (!status) |
4955 | status = nfs4_check_cl_exchange_flags(clp->cl_exchange_flags); | 4961 | status = nfs4_check_cl_exchange_flags(clp->cl_exchange_flags); |
4956 | 4962 | ||
4957 | if (!status) { | 4963 | if (!status) { |
4964 | /* use the most recent implementation id */ | ||
4965 | kfree(clp->impl_id); | ||
4966 | clp->impl_id = res.impl_id; | ||
4967 | } else | ||
4968 | kfree(res.impl_id); | ||
4969 | |||
4970 | if (!status) { | ||
4958 | if (clp->server_scope && | 4971 | if (clp->server_scope && |
4959 | !nfs41_same_server_scope(clp->server_scope, | 4972 | !nfs41_same_server_scope(clp->server_scope, |
4960 | res.server_scope)) { | 4973 | res.server_scope)) { |
@@ -4970,8 +4983,16 @@ int nfs4_proc_exchange_id(struct nfs_client *clp, struct rpc_cred *cred) | |||
4970 | goto out; | 4983 | goto out; |
4971 | } | 4984 | } |
4972 | } | 4985 | } |
4986 | |||
4987 | out_server_scope: | ||
4973 | kfree(res.server_scope); | 4988 | kfree(res.server_scope); |
4974 | out: | 4989 | out: |
4990 | if (clp->impl_id) | ||
4991 | dprintk("%s: Server Implementation ID: " | ||
4992 | "domain: %s, name: %s, date: %llu,%u\n", | ||
4993 | __func__, clp->impl_id->domain, clp->impl_id->name, | ||
4994 | clp->impl_id->date.seconds, | ||
4995 | clp->impl_id->date.nseconds); | ||
4975 | dprintk("<-- %s status= %d\n", __func__, status); | 4996 | dprintk("<-- %s status= %d\n", __func__, status); |
4976 | return status; | 4997 | return status; |
4977 | } | 4998 | } |