aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/dir.c
diff options
context:
space:
mode:
authorChuck Lever <cel@netapp.com>2006-03-20 13:44:14 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-03-20 13:44:14 -0500
commit91d5b47023b608227d605d1e916b29dd0215bff7 (patch)
tree31dbb285639ea68db3abc0c4129988f02d50f11a /fs/nfs/dir.c
parentd9ef5a8c26aab09762afce43df64736720b4860e (diff)
NFS: add I/O performance counters
Invoke the byte and event counter macros where we want to count bytes and events. Clean-up: fix a possible NULL dereference in nfs_lock, and simplify nfs_file_open. Test-plan: fsx and iozone on UP and SMP systems, with and without pre-emption. Watch for memory overwrite bugs, and performance loss (significantly more CPU required per op). Signed-off-by: Chuck Lever <cel@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/dir.c')
-rw-r--r--fs/nfs/dir.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index a1554bead692..151b8dd0ac3b 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -34,6 +34,7 @@
34 34
35#include "nfs4_fs.h" 35#include "nfs4_fs.h"
36#include "delegation.h" 36#include "delegation.h"
37#include "iostat.h"
37 38
38#define NFS_PARANOIA 1 39#define NFS_PARANOIA 1
39/* #define NFS_DEBUG_VERBOSE 1 */ 40/* #define NFS_DEBUG_VERBOSE 1 */
@@ -507,6 +508,8 @@ static int nfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
507 struct nfs_fattr fattr; 508 struct nfs_fattr fattr;
508 long res; 509 long res;
509 510
511 nfs_inc_stats(inode, NFSIOS_VFSGETDENTS);
512
510 lock_kernel(); 513 lock_kernel();
511 514
512 res = nfs_revalidate_inode(NFS_SERVER(inode), inode); 515 res = nfs_revalidate_inode(NFS_SERVER(inode), inode);
@@ -713,6 +716,7 @@ static int nfs_lookup_revalidate(struct dentry * dentry, struct nameidata *nd)
713 parent = dget_parent(dentry); 716 parent = dget_parent(dentry);
714 lock_kernel(); 717 lock_kernel();
715 dir = parent->d_inode; 718 dir = parent->d_inode;
719 nfs_inc_stats(dir, NFSIOS_DENTRYREVALIDATE);
716 inode = dentry->d_inode; 720 inode = dentry->d_inode;
717 721
718 if (!inode) { 722 if (!inode) {
@@ -844,6 +848,7 @@ static struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, stru
844 848
845 dfprintk(VFS, "NFS: lookup(%s/%s)\n", 849 dfprintk(VFS, "NFS: lookup(%s/%s)\n",
846 dentry->d_parent->d_name.name, dentry->d_name.name); 850 dentry->d_parent->d_name.name, dentry->d_name.name);
851 nfs_inc_stats(dir, NFSIOS_VFSLOOKUP);
847 852
848 res = ERR_PTR(-ENAMETOOLONG); 853 res = ERR_PTR(-ENAMETOOLONG);
849 if (dentry->d_name.len > NFS_SERVER(dir)->namelen) 854 if (dentry->d_name.len > NFS_SERVER(dir)->namelen)
@@ -1241,6 +1246,7 @@ static int nfs_sillyrename(struct inode *dir, struct dentry *dentry)
1241 dfprintk(VFS, "NFS: silly-rename(%s/%s, ct=%d)\n", 1246 dfprintk(VFS, "NFS: silly-rename(%s/%s, ct=%d)\n",
1242 dentry->d_parent->d_name.name, dentry->d_name.name, 1247 dentry->d_parent->d_name.name, dentry->d_name.name,
1243 atomic_read(&dentry->d_count)); 1248 atomic_read(&dentry->d_count));
1249 nfs_inc_stats(dir, NFSIOS_SILLYRENAME);
1244 1250
1245#ifdef NFS_PARANOIA 1251#ifdef NFS_PARANOIA
1246if (!dentry->d_inode) 1252if (!dentry->d_inode)
@@ -1640,6 +1646,8 @@ int nfs_permission(struct inode *inode, int mask, struct nameidata *nd)
1640 struct rpc_cred *cred; 1646 struct rpc_cred *cred;
1641 int res = 0; 1647 int res = 0;
1642 1648
1649 nfs_inc_stats(inode, NFSIOS_VFSACCESS);
1650
1643 if (mask == 0) 1651 if (mask == 0)
1644 goto out; 1652 goto out;
1645 /* Is this sys_access() ? */ 1653 /* Is this sys_access() ? */