linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Banks <gnb@sgi.com>
To: "J. Bruce Fields" <bfields@fieldses.org>
Cc: Linux NFS ML <linux-nfs@vger.kernel.org>
Subject: [patch 11/29] knfsd: Update per-client & per-export stats from NFSv2
Date: Wed, 01 Apr 2009 07:28:11 +1100	[thread overview]
Message-ID: <20090331202941.779324000@sgi.com> (raw)
In-Reply-To: 20090331202800.739621000@sgi.com

Add instrumentation to the NFSv2 server procedures.

Signed-off-by: Greg Banks <gnb@sgi.com>
---

 fs/nfsd/nfs2acl.c |    2 ++
 fs/nfsd/nfsproc.c |   28 ++++++++++++++++++++++++++++
 2 files changed, 30 insertions(+)

Index: bfields/fs/nfsd/nfsproc.c
===================================================================
--- bfields.orig/fs/nfsd/nfsproc.c
+++ bfields/fs/nfsd/nfsproc.c
@@ -34,6 +34,7 @@ typedef struct svc_buf	svc_buf;
 static __be32
 nfsd_proc_null(struct svc_rqst *rqstp, void *argp, void *resp)
 {
+	nfsd_stats_update(rqstp, NULL, NFSD_STATS_OP_GETATTR);
 	return nfs_ok;
 }
 
@@ -67,6 +68,8 @@ nfsd_proc_getattr(struct svc_rqst *rqstp
 	fh_copy(&resp->fh, &argp->fh);
 	nfserr = fh_verify(rqstp, &resp->fh, 0,
 			NFSD_MAY_NOP | NFSD_MAY_BYPASS_GSS_ON_ROOT);
+	if (!nfserr)
+		nfsd_stats_update(rqstp, &resp->fh, NFSD_STATS_OP_GETATTR);
 	return nfsd_return_attrs(nfserr, resp);
 }
 
@@ -85,6 +88,8 @@ nfsd_proc_setattr(struct svc_rqst *rqstp
 
 	fh_copy(&resp->fh, &argp->fh);
 	nfserr = nfsd_setattr(rqstp, &resp->fh, &argp->attrs,0, (time_t)0);
+	if (!nfserr)
+		nfsd_stats_update(rqstp, &resp->fh, NFSD_STATS_OP_GETATTR);
 	return nfsd_return_attrs(nfserr, resp);
 }
 
@@ -107,6 +112,7 @@ nfsd_proc_lookup(struct svc_rqst *rqstp,
 	nfserr = nfsd_lookup(rqstp, &argp->fh, argp->name, argp->len,
 				 &resp->fh);
 
+	nfsd_stats_update(rqstp, &argp->fh, NFSD_STATS_OP_LOOKUP);
 	fh_put(&argp->fh);
 	return nfsd_return_dirop(nfserr, resp);
 }
@@ -126,6 +132,7 @@ nfsd_proc_readlink(struct svc_rqst *rqst
 	resp->len = NFS_MAXPATHLEN;
 	nfserr = nfsd_readlink(rqstp, &argp->fh, argp->buffer, &resp->len);
 
+	nfsd_stats_update_read(rqstp, &argp->fh, resp->len);
 	fh_put(&argp->fh);
 	return nfserr;
 }
@@ -163,6 +170,7 @@ nfsd_proc_read(struct svc_rqst *rqstp, s
 				  argp->offset,
 			   	  rqstp->rq_vec, argp->vlen,
 				  &resp->count);
+	nfsd_stats_update_read(rqstp, &resp->fh, resp->count);
 
 	if (nfserr) return nfserr;
 	return nfserrno(vfs_getattr(resp->fh.fh_export->ex_path.mnt,
@@ -191,6 +199,7 @@ nfsd_proc_write(struct svc_rqst *rqstp, 
 				   rqstp->rq_vec, argp->vlen,
 			           &cnt,
 				   &stable);
+	nfsd_stats_update_write(rqstp, &resp->fh, cnt, stable);
 	return nfsd_return_attrs(nfserr, resp);
 }
 
@@ -349,6 +358,8 @@ out_unlock:
 	fh_unlock(dirfhp);
 
 done:
+	if (!nfserr)
+		nfsd_stats_update(rqstp, dirfhp, NFSD_STATS_OP_MKINODE);
 	fh_put(dirfhp);
 	return nfsd_return_dirop(nfserr, resp);
 }
@@ -364,6 +375,8 @@ nfsd_proc_remove(struct svc_rqst *rqstp,
 
 	/* Unlink. -SIFDIR means file must not be a directory */
 	nfserr = nfsd_unlink(rqstp, &argp->fh, -S_IFDIR, argp->name, argp->len);
+	if (!nfserr)
+		nfsd_stats_update(rqstp, &argp->fh, NFSD_STATS_OP_REMOVE);
 	fh_put(&argp->fh);
 	return nfserr;
 }
@@ -381,6 +394,8 @@ nfsd_proc_rename(struct svc_rqst *rqstp,
 
 	nfserr = nfsd_rename(rqstp, &argp->ffh, argp->fname, argp->flen,
 				    &argp->tfh, argp->tname, argp->tlen);
+	if (!nfserr)
+		nfsd_stats_update(rqstp, &argp->ffh, NFSD_STATS_OP_MKINODE);
 	fh_put(&argp->ffh);
 	fh_put(&argp->tfh);
 	return nfserr;
@@ -401,6 +416,8 @@ nfsd_proc_link(struct svc_rqst *rqstp, s
 
 	nfserr = nfsd_link(rqstp, &argp->tfh, argp->tname, argp->tlen,
 				  &argp->ffh);
+	if (!nfserr)
+		nfsd_stats_update(rqstp, &argp->ffh, NFSD_STATS_OP_MKINODE);
 	fh_put(&argp->ffh);
 	fh_put(&argp->tfh);
 	return nfserr;
@@ -425,6 +442,8 @@ nfsd_proc_symlink(struct svc_rqst *rqstp
 						 argp->tname, argp->tlen,
 				 		 &newfh, &argp->attrs);
 
+	if (!nfserr)
+		nfsd_stats_update(rqstp, &argp->ffh, NFSD_STATS_OP_MKINODE);
 
 	fh_put(&argp->ffh);
 	fh_put(&newfh);
@@ -452,6 +471,8 @@ nfsd_proc_mkdir(struct svc_rqst *rqstp, 
 	fh_init(&resp->fh, NFS_FHSIZE);
 	nfserr = nfsd_create(rqstp, &argp->fh, argp->name, argp->len,
 				    &argp->attrs, S_IFDIR, 0, &resp->fh);
+	if (!nfserr)
+		nfsd_stats_update(rqstp, &argp->fh, NFSD_STATS_OP_MKINODE);
 	fh_put(&argp->fh);
 	return nfsd_return_dirop(nfserr, resp);
 }
@@ -468,6 +489,8 @@ nfsd_proc_rmdir(struct svc_rqst *rqstp, 
 	dprintk("nfsd: RMDIR    %s %.*s\n", SVCFH_fmt(&argp->fh), argp->len, argp->name);
 
 	nfserr = nfsd_unlink(rqstp, &argp->fh, S_IFDIR, argp->name, argp->len);
+	if (!nfserr)
+		nfsd_stats_update(rqstp, &argp->fh, NFSD_STATS_OP_RMDIR);
 	fh_put(&argp->fh);
 	return nfserr;
 }
@@ -508,6 +531,9 @@ nfsd_proc_readdir(struct svc_rqst *rqstp
 	if (resp->offset)
 		*resp->offset = htonl(offset);
 
+	if (!nfserr)
+		nfsd_stats_update(rqstp, &argp->fh, NFSD_STATS_OP_READDIR);
+
 	fh_put(&argp->fh);
 	return nfserr;
 }
@@ -525,6 +551,8 @@ nfsd_proc_statfs(struct svc_rqst * rqstp
 
 	nfserr = nfsd_statfs(rqstp, &argp->fh, &resp->stats,
 			NFSD_MAY_BYPASS_GSS_ON_ROOT);
+	if (!nfserr)
+		nfsd_stats_update(rqstp, &argp->fh, NFSD_STATS_OP_FSINFO);
 	fh_put(&argp->fh);
 	return nfserr;
 }
Index: bfields/fs/nfsd/nfs2acl.c
===================================================================
--- bfields.orig/fs/nfsd/nfs2acl.c
+++ bfields/fs/nfsd/nfs2acl.c
@@ -86,6 +86,7 @@ static __be32 nfsacld_proc_getacl(struct
 		resp->acl_default = acl;
 	}
 
+	nfsd_stats_update(rqstp, &resp->fh, NFSD_STATS_OP_XATTR);
 	/* resp->acl_{access,default} are released in nfssvc_release_getacl. */
 	RETURN_STATUS(0);
 
@@ -123,6 +124,7 @@ static __be32 nfsacld_proc_setacl(struct
 	   nfssvc_decode_setaclargs. */
 	posix_acl_release(argp->acl_access);
 	posix_acl_release(argp->acl_default);
+	nfsd_stats_update(rqstp, &resp->fh, NFSD_STATS_OP_XATTR);
 	return nfserr;
 }
 

--
Greg

  parent reply	other threads:[~2009-03-31 21:02 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-31 20:28 [patch 00/29] SGI enhancedNFS patches Greg Banks
2009-03-31 20:28 ` [patch 01/29] knfsd: Add infrastructure for measuring RPC service times Greg Banks
2009-04-25  2:13   ` J. Bruce Fields
2009-04-25  2:14     ` J. Bruce Fields
2009-04-25  2:52     ` Greg Banks
2009-03-31 20:28 ` [patch 02/29] knfsd: Add stats table infrastructure Greg Banks
2009-04-25  3:56   ` J. Bruce Fields
2009-04-26  4:12     ` Greg Banks
2009-03-31 20:28 ` [patch 03/29] knfsd: add userspace controls for stats tables Greg Banks
2009-04-25 21:57   ` J. Bruce Fields
2009-04-25 22:03     ` J. Bruce Fields
2009-04-27 16:06       ` Chuck Lever
2009-04-27 23:22         ` J. Bruce Fields
2009-04-28 15:37           ` Chuck Lever
2009-04-28 15:57             ` J. Bruce Fields
2009-04-28 16:03               ` Chuck Lever
2009-04-28 16:26                 ` J. Bruce Fields
2009-04-29  1:45               ` Greg Banks
     [not found]         ` <ac442c870904271827w6041a67ew82fe36a843beeac3@mail.gmail.com>
     [not found]           ` <ac442c870904271827w6041a67ew82fe36a843beeac3-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-04-28  1:31             ` Greg Banks
2009-04-26  4:14     ` Greg Banks
2009-03-31 20:28 ` [patch 04/29] knfsd: Add stats updating API Greg Banks
2009-03-31 20:28 ` [patch 05/29] knfsd: Infrastructure for providing stats to userspace Greg Banks
2009-04-01  0:28   ` J. Bruce Fields
2009-04-01  3:43     ` Greg Banks
2009-03-31 20:28 ` [patch 06/29] knfsd: Gather per-export stats Greg Banks
2009-03-31 20:28 ` [patch 07/29] knfsd: Prefetch the per-export stats entry Greg Banks
2009-03-31 20:28 ` [patch 08/29] knfsd: Gather per-client stats Greg Banks
2009-03-31 20:28 ` [patch 09/29] knfsd: Cache per-client stats entry on TCP transports Greg Banks
2009-03-31 20:28 ` [patch 10/29] knfsd: Update per-client & per-export stats from NFSv3 Greg Banks
2009-03-31 20:28 ` Greg Banks [this message]
2009-03-31 20:28 ` [patch 12/29] knfsd: Update per-client & per-export stats from NFSv4 Greg Banks
2009-03-31 20:28 ` [patch 13/29] knfsd: reply cache cleanups Greg Banks
2009-05-12 19:54   ` J. Bruce Fields
2009-03-31 20:28 ` [patch 14/29] knfsd: better hashing in the reply cache Greg Banks
2009-05-08 22:01   ` J. Bruce Fields
2009-03-31 20:28 ` [patch 15/29] knfsd: fix reply cache memory corruption Greg Banks
2009-05-12 19:55   ` J. Bruce Fields
2009-03-31 20:28 ` [patch 16/29] knfsd: use client IPv4 address in reply cache hash Greg Banks
2009-05-11 21:48   ` J. Bruce Fields
2009-03-31 20:28 ` [patch 17/29] knfsd: make the reply cache SMP-friendly Greg Banks
2009-03-31 20:28 ` [patch 18/29] knfsd: dynamically expand the reply cache Greg Banks
2009-05-26 18:57   ` J. Bruce Fields
2009-05-26 19:04     ` J. Bruce Fields
2009-05-26 21:24     ` Rob Gardner
2009-05-26 21:52       ` J. Bruce Fields
2009-05-27  0:28       ` Greg Banks
2009-03-31 20:28 ` [patch 19/29] knfsd: faster probing in " Greg Banks
2009-03-31 20:28 ` [patch 20/29] knfsd: add extended reply cache stats Greg Banks
2009-03-31 20:28 ` [patch 21/29] knfsd: remove unreported filehandle stats counters Greg Banks
2009-05-12 20:00   ` J. Bruce Fields
2009-03-31 20:28 ` [patch 22/29] knfsd: make svc_authenticate() scale Greg Banks
2009-05-12 21:24   ` J. Bruce Fields
2009-03-31 20:28 ` [patch 23/29] knfsd: introduce SVC_INC_STAT Greg Banks
2009-03-31 20:28 ` [patch 24/29] knfsd: remove the program field from struct svc_stat Greg Banks
2009-03-31 20:28 ` [patch 25/29] knfsd: allocate svc_serv.sv_stats dynamically Greg Banks
2009-03-31 20:28 ` [patch 26/29] knfsd: make svc_serv.sv_stats per-CPU Greg Banks
2009-03-31 20:28 ` [patch 27/29] knfsd: move hot procedure count field out of svc_procedure Greg Banks
2009-03-31 20:28 ` [patch 28/29] knfsd: introduce NFSD_INC_STAT() Greg Banks
2009-03-31 20:28 ` [patch 29/29] knfsd: make nfsdstats per-CPU Greg Banks
2009-04-01  0:23 ` [patch 00/29] SGI enhancedNFS patches J. Bruce Fields
2009-04-01  3:32   ` Greg Banks
     [not found]     ` <ac442c870903312032t34630c6dvdbb644cb510f8079-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-04-01  6:34       ` Jeff Garzik
2009-04-01  6:41         ` Greg Banks

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090331202941.779324000@sgi.com \
    --to=gnb@sgi.com \
    --cc=bfields@fieldses.org \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).