patch-2.1.100 linux/fs/coda/dir.c

Next file: linux/fs/coda/file.c
Previous file: linux/fs/coda/coda_linux.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.99/linux/fs/coda/dir.c linux/fs/coda/dir.c
@@ -23,6 +23,7 @@
 #include <linux/coda_psdev.h>
 #include <linux/coda_fs_i.h>
 #include <linux/coda_cache.h>
+#include <linux/coda_proc.h>
 
 /* dir inode-ops */
 static int coda_create(struct inode *dir, struct dentry *new, int mode);
@@ -179,6 +180,8 @@
         int error;
  
         ENTRY;
+	coda_vfs_stat.permission++;
+	coda_permission_stat.count++;
 
         if ( mask == 0 ) {
                 EXIT;
@@ -187,6 +190,7 @@
 
 	if ( coda_access_cache == 1 ) {
 		if ( coda_cache_check(inode, mask) ) {
+			coda_permission_stat.hit_count++;
 			return 0; 
 		}
 	}
@@ -221,6 +225,8 @@
 	struct ViceFid newfid;
 	struct coda_vattr attrs;
 
+	coda_vfs_stat.create++;
+
 	CDEBUG(D_INODE, "name: %s, length %d, mode %o\n",name, length, mode);
 
         if (!dir || !S_ISDIR(dir->i_mode)) {
@@ -274,6 +280,8 @@
 	struct ViceFid newfid;
 
 
+	coda_vfs_stat.mkdir++;
+
 	if (!dir || !S_ISDIR(dir->i_mode)) {
 		printk("coda_mkdir: inode is NULL or not a directory\n");
 		return -ENOENT;
@@ -329,6 +337,7 @@
 	int error;
 
         ENTRY;
+	coda_vfs_stat.link++;
 
 	if (coda_isroot(dir_inode) && coda_iscontrol(name, len))
 		return -EPERM;
@@ -373,6 +382,7 @@
         int error=0;
         
         ENTRY;
+	coda_vfs_stat.symlink++;
 
 	if (coda_isroot(dir_inode) && coda_iscontrol(name, len))
 		return -EPERM;
@@ -414,6 +424,7 @@
 	int len = de->d_name.len;
 
 	ENTRY;
+	coda_vfs_stat.unlink++;
 
         dircnp = ITOC(dir);
         CHECK_CNODE(dircnp);
@@ -446,6 +457,8 @@
 	int len = de->d_name.len;
         int error, rehash = 0;
 
+	coda_vfs_stat.rmdir++;
+
 	if (!dir || !S_ISDIR(dir->i_mode)) {
 		printk("coda_rmdir: inode is NULL or not a directory\n");
 		return -ENOENT;
@@ -502,6 +515,8 @@
         struct coda_inode_info *new_cnp, *old_cnp;
         int error, rehash = 0, update = 1;
 ENTRY;
+	coda_vfs_stat.rename++;
+
         old_cnp = ITOC(old_dir);
         CHECK_CNODE(old_cnp);
         new_cnp = ITOC(new_dir);
@@ -565,6 +580,7 @@
 	struct inode *inode=file->f_dentry->d_inode;
 
         ENTRY;
+	coda_vfs_stat.readdir++;
 
         if (!inode || !inode->i_sb || !S_ISDIR(inode->i_mode)) {
                 printk("coda_readdir: inode is NULL or not a directory\n");
@@ -606,6 +622,7 @@
 	unsigned short coda_flags = coda_flags_to_cflags(flags);
 
         ENTRY;
+	coda_vfs_stat.open++;
         
         CDEBUG(D_SPECIAL, "OPEN inode number: %ld, flags %o.\n", 
 	       f->f_dentry->d_inode->i_ino, flags);
@@ -659,6 +676,7 @@
 	unsigned short cflags = coda_flags_to_cflags(flags);
 
         ENTRY;
+	coda_vfs_stat.release++;
 
         cnp =ITOC(i);
         CHECK_CNODE(cnp);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov