[PVFS2-CVS] commit by neill in pvfs2-1/src/kernel/linux-2.6: dcache.c file.c inode.c pvfs2-cache.c pvfs2-kernel.h pvfs2-utils.c super.c

CVS commit program cvs at parl.clemson.edu
Mon Feb 23 13:19:46 EST 2004


Update of /projects/cvsroot/pvfs2-1/src/kernel/linux-2.6
In directory parlweb:/tmp/cvs-serv31824/src/kernel/linux-2.6

Modified Files:
	dcache.c file.c inode.c pvfs2-cache.c pvfs2-kernel.h 
	pvfs2-utils.c super.c 
Log Message:
- clear op fields on free
- cleanups


Index: dcache.c
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/kernel/linux-2.6/dcache.c,v
diff -p -u -r1.13 -r1.14
--- dcache.c	13 Feb 2004 19:37:26 -0000	1.13
+++ dcache.c	23 Feb 2004 18:19:45 -0000	1.14
@@ -33,7 +33,7 @@ int pvfs2_d_revalidate(
 	ret = ((pvfs2_inode_getattr(inode) == 0) ? 1 : 0);
         if (ret == 0)
         {
-            make_bad_inode(inode);
+            pvfs2_make_bad_inode(inode);
         }
     }
     return ret;

Index: file.c
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/kernel/linux-2.6/file.c,v
diff -p -u -r1.53 -r1.54
--- file.c	20 Feb 2004 23:13:46 -0000	1.53
+++ file.c	23 Feb 2004 18:19:45 -0000	1.54
@@ -424,7 +424,7 @@ loff_t pvfs2_file_llseek(struct file *fi
         ret = pvfs2_inode_getattr(inode);
         if (ret)
         {
-            make_bad_inode(inode);
+            pvfs2_make_bad_inode(inode);
             return ret;
         }
     }

Index: inode.c
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/kernel/linux-2.6/inode.c,v
diff -p -u -r1.31 -r1.32
--- inode.c	13 Feb 2004 19:37:26 -0000	1.31
+++ inode.c	23 Feb 2004 18:19:46 -0000	1.32
@@ -381,7 +381,7 @@ int pvfs2_getattr(
     else
     {
         /* assume an I/O error and flag inode as bad */
-        make_bad_inode(inode);
+        pvfs2_make_bad_inode(inode);
     }
     return ret;
 }

Index: pvfs2-cache.c
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/kernel/linux-2.6/pvfs2-cache.c,v
diff -p -u -r1.17 -r1.18
--- pvfs2-cache.c	16 Feb 2004 20:11:48 -0000	1.17
+++ pvfs2-cache.c	23 Feb 2004 18:19:46 -0000	1.18
@@ -41,14 +41,9 @@ static void op_cache_ctor(
 	spin_lock_init(&op->lock);
 	init_waitqueue_head(&op->waitq);
 
-        op->io_completed = 0;
         init_waitqueue_head(&op->io_completion_waitq);
 
-	op->upcall.type = PVFS2_VFS_OP_INVALID;
-	op->downcall.type = PVFS2_VFS_OP_INVALID;
-        op->downcall.status = -1;
-
-	op->op_state = PVFS2_VFS_STATE_UNKNOWN;
+        pvfs2_op_initialize(op);
 
         op->tag = (unsigned long)atomic_read(&next_tag_value);
         atomic_inc(&next_tag_value);
@@ -71,7 +66,7 @@ void op_cache_initialize(void)
 				 op_cache_ctor, NULL);
     if (!op_cache)
     {
-	panic("Cannot create pvfs2_op_cache");
+	panic("Cannot create pvfs2_op_cache\n");
     }
 
     /* initialize our atomic tag counter */
@@ -83,20 +78,18 @@ void op_cache_finalize(void)
     if (kmem_cache_destroy(op_cache) != 0)
     {
 #ifdef PVFS2_KERNEL_DEBUG
-	panic("Failed to destroy pvfs2_op_cache");
+	panic("Failed to destroy pvfs2_op_cache\n");
 #else
-        pvfs2_error("Failed to destroy pvfs2_op_cache");
+        pvfs2_error("Failed to destroy pvfs2_op_cache\n");
 #endif
     }
 }
 
 void op_release(void *op)
 {
-/*     pvfs2_kernel_op_t *pvfs2_op = (pvfs2_kernel_op_t *) op; */
-
-    /* need to free specific upcall/downcall fields here (if any) */
-/*     pvfs2_print("Freeing OP with tag %lu\n", pvfs2_op->tag); */
+    pvfs2_kernel_op_t *pvfs2_op = (pvfs2_kernel_op_t *)op;
 
+    pvfs2_op_initialize(pvfs2_op);
     kmem_cache_free(op_cache, op);
 }
 
@@ -125,7 +118,7 @@ void dev_req_cache_initialize(void)
 				      dev_req_cache_ctor, NULL);
     if (!dev_req_cache)
     {
-	panic("Cannot create pvfs2_dev_req_cache");
+	panic("Cannot create pvfs2_dev_req_cache\n");
     }
 }
 
@@ -134,9 +127,9 @@ void dev_req_cache_finalize(void)
     if (kmem_cache_destroy(dev_req_cache) != 0)
     {
 #ifdef PVFS2_KERNEL_DEBUG
-	panic("Failed to destroy pvfs2_dev_req_cache");
+	panic("Failed to destroy pvfs2_dev_req_cache\n");
 #else
-	pvfs2_error("Failed to destroy pvfs2_dev_req_cache");
+	pvfs2_error("Failed to destroy pvfs2_dev_req_cache\n");
 #endif
     }
 }
@@ -194,7 +187,7 @@ void pvfs2_inode_cache_initialize(void)
                                           pvfs2_inode_cache_dtor);
     if (!pvfs2_inode_cache)
     {
-	panic("Cannot create pvfs2_inode_cache");
+	panic("Cannot create pvfs2_inode_cache\n");
     }
 }
 
@@ -203,9 +196,9 @@ void pvfs2_inode_cache_finalize(void)
     if (kmem_cache_destroy(pvfs2_inode_cache) != 0)
     {
 #ifdef PVFS2_KERNEL_DEBUG
-	panic("Failed to destroy pvfs2_inode_cache");
+	panic("Failed to destroy pvfs2_inode_cache\n");
 #else
-	pvfs2_error("Failed to destroy pvfs2_inode_cache");
+	pvfs2_error("Failed to destroy pvfs2_inode_cache\n");
 #endif
     }
 }

Index: pvfs2-kernel.h
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/kernel/linux-2.6/pvfs2-kernel.h,v
diff -p -u -r1.36 -r1.37
--- pvfs2-kernel.h	16 Feb 2004 20:11:48 -0000	1.36
+++ pvfs2-kernel.h	23 Feb 2004 18:19:46 -0000	1.37
@@ -394,6 +394,12 @@ int pvfs2_kernel_error_code_convert(
 void pvfs2_inode_initialize(
     pvfs2_inode_t *pvfs2_inode);
 
+void pvfs2_op_initialize(
+    pvfs2_kernel_op_t *op);
+
+void pvfs2_make_bad_inode(
+    struct inode *inode);
+
 #endif /* __PVFS2KERNEL_H */
 
 /*

Index: pvfs2-utils.c
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/kernel/linux-2.6/pvfs2-utils.c,v
diff -p -u -r1.51 -r1.52
--- pvfs2-utils.c	16 Feb 2004 16:51:40 -0000	1.51
+++ pvfs2-utils.c	23 Feb 2004 18:19:46 -0000	1.52
@@ -16,6 +16,7 @@
 #include "pvfs2-bufmap.h"
 
 extern kmem_cache_t *op_cache;
+extern kmem_cache_t *pvfs2_inode_cache;
 extern struct list_head pvfs2_request_list;
 extern spinlock_t pvfs2_request_list_lock;
 extern wait_queue_head_t pvfs2_request_list_waitq;
@@ -942,6 +943,24 @@ void pvfs2_inode_initialize(pvfs2_inode_
     pvfs2_inode->link_target = NULL;
     pvfs2_inode->last_failed_block_index_read = 0;
     pvfs2_inode->readdir_token_adjustment = 0;
+}
+
+void pvfs2_op_initialize(pvfs2_kernel_op_t *op)
+{
+    op->io_completed = 0;
+
+    op->upcall.type = PVFS2_VFS_OP_INVALID;
+    op->downcall.type = PVFS2_VFS_OP_INVALID;
+    op->downcall.status = -1;
+
+    op->op_state = PVFS2_VFS_STATE_UNKNOWN;
+    op->tag = 0;
+}
+
+void pvfs2_make_bad_inode(struct inode *inode)
+{
+    pvfs2_print("*** making bad inode %lu\n", inode->i_ino);
+    make_bad_inode(inode);
 }
 
 /*

Index: super.c
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/kernel/linux-2.6/super.c,v
diff -p -u -r1.25 -r1.26
--- super.c	20 Feb 2004 23:13:46 -0000	1.25
+++ super.c	23 Feb 2004 18:19:46 -0000	1.26
@@ -55,10 +55,13 @@ static struct inode *pvfs2_alloc_inode(
 static void pvfs2_destroy_inode(
     struct inode *inode)
 {
-    /* free pvfs2 specific (private) inode data */
+    pvfs2_inode_t *pvfs2_inode = PVFS2_I(inode);
+
     pvfs2_print("pvfs2_destroy_inode: destroying inode %d\n",
                 (int)inode->i_ino);
-    kmem_cache_free(pvfs2_inode_cache, PVFS2_I(inode));
+
+    pvfs2_inode_initialize(pvfs2_inode);
+    kmem_cache_free(pvfs2_inode_cache, pvfs2_inode);
 }
 
 static void pvfs2_read_inode(
@@ -66,8 +69,8 @@ static void pvfs2_read_inode(
 {
     pvfs2_inode_t *pvfs2_inode = PVFS2_I(inode);
 
-    pvfs2_print("pvfs2: pvfs2_read_inode called (inode = %d | "
-                "ct = %d)\n", (int)inode->i_ino,
+    pvfs2_print("pvfs2: pvfs2_read_inode called (inode = %lu | "
+                "ct = %d)\n", inode->i_ino,
                 (int)atomic_read(&inode->i_count));
 
     /*
@@ -90,7 +93,7 @@ static void pvfs2_read_inode(
     if (pvfs2_inode_getattr(inode) != 0)
     {
         /* assume an I/O error and flag inode as bad */
-        make_bad_inode(inode);
+        pvfs2_make_bad_inode(inode);
     }
 }
 



More information about the PVFS2-CVS mailing list