[Ocfs2-commits] rev 744 - trunk/src

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Mon Mar 1 19:28:02 CST 2004


Author: mfasheh
Date: 2004-03-01 19:28:01 -0600 (Mon, 01 Mar 2004)
New Revision: 744

Modified:
   trunk/src/file.c
   trunk/src/namei.c
Log:
* remove the code related to parent inode incrementing. We know now that this is bad.


Modified: trunk/src/file.c
===================================================================
--- trunk/src/file.c	2004-03-02 00:07:50 UTC (rev 743)
+++ trunk/src/file.c	2004-03-02 01:28:01 UTC (rev 744)
@@ -103,11 +103,6 @@
 	LOG_ENTRY_ARGS ("(0x%08x, 0x%08x, '%*s')\n", inode, file, 
                         file->f_dentry->d_name.len, file->f_dentry->d_name.name);
 
-#ifdef DO_PARENT_INODE_INC
-	if (ocfs_inc_icount(parent) < 0)
-		BUG();
-#endif
-
 	osb = (ocfs_super *) OCFS_GENERIC_SB_P(parent->i_sb);
 
 	if (!ocfs_linux_get_inode_offset (parent, &parent_off, &ParentOin)) {
@@ -322,9 +317,6 @@
 			ret = -EACCES;
 		} else
 			ret = status;
-#ifdef DO_PARENT_INODE_INC
-		atomic_dec (&parent->i_count);
-#endif
 	} else {
 		ret = 0;
 	}
@@ -347,7 +339,6 @@
         ocfs_super * osb;
         ocfs_inode *oin = NULL;
         struct dentry *dentry;
-        struct inode *parent;
 	bool last_close = false;
 
 	LOG_ENTRY_ARGS ("(0x%08x, 0x%08x, '%*s')\n", inode, file,
@@ -389,7 +380,7 @@
 		oin = GET_INODE_OIN(inode);
 
 	if (oin == NULL)
-		goto do_parent_dec;
+		goto bail;
 	  
 	if (oin->obj_id.type != OCFS_TYPE_OIN ||
 	    oin->obj_id.size != sizeof (ocfs_inode) ||
@@ -402,7 +393,7 @@
 			printk("%03x ", ((char *)oin)[i]);
 		}
 		printk("\n");
-		goto do_parent_dec;
+		goto bail;
 	}
 		
 
@@ -413,7 +404,7 @@
 
         if (oin->oin_flags & OCFS_OIN_ROOT_DIRECTORY) {
                 ocfs_up_sem (&(oin->main_res));
-                goto do_parent_dec;
+                goto bail;
         }
                 
         LOG_TRACE_ARGS ("openhandles: %d / osbfiles: %d / refcount: %d\n",
@@ -430,7 +421,7 @@
                 if (oin->oin_flags & OCFS_OIN_NEEDS_DELETION ||
                     oin->oin_flags & OCFS_OIN_IN_USE) {
                         ocfs_up_sem (&(oin->main_res));
-                        goto do_parent_dec; 
+                        goto bail;
                 }
 		
                 ocfs_up_sem (&(oin->main_res));
@@ -447,16 +438,6 @@
 			ocfs_truncate_inode_pages(inode, 0);
 	}
 
-do_parent_dec:
-#ifdef DO_PARENT_INODE_INC
-        if (dentry && dentry->d_parent && 
-            dentry->d_parent->d_inode) {
-                parent = dentry->d_parent->d_inode;
-                if (parent)
-                        atomic_dec (&parent->i_count);
-        }
-#endif
-
 bail:
 	LOG_EXIT_LONG (0);
 	return 0;
@@ -1393,19 +1374,15 @@
 
 	if (!dentry->d_parent || !dentry->d_parent->d_inode) {
 		LOG_ERROR_STR ("bad inode or root inode");
-		goto bail2;
+		goto bail;
 	}
 	if (dentry == inode->i_sb->s_root) {
 		LOG_ERROR_STR("changes to root inode not allowed");
-		goto bail2;
+		goto bail;
 	}
 
 	parentInode = dentry->d_parent->d_inode;
 
-#ifdef DO_PARENT_INODE_INC
-	if (ocfs_inc_icount(parentInode) < 0)
-		BUG();
-#endif
 	newsize = attr->ia_size;
 
 	if (attr->ia_valid & ATTR_MODE)
@@ -1500,10 +1477,6 @@
 	inode_setattr (inode, attr);
 
 bail:
-#ifdef DO_PARENT_INODE_INC
-	atomic_dec (&parentInode->i_count);
-#endif
-bail2:
 	if (error < 0)
 		ocfs_bh_sem_hash_cleanup_pid(ocfs_getpid());
 

Modified: trunk/src/namei.c
===================================================================
--- trunk/src/namei.c	2004-03-02 00:07:50 UTC (rev 743)
+++ trunk/src/namei.c	2004-03-02 01:28:01 UTC (rev 744)
@@ -80,11 +80,6 @@
 	LOG_ENTRY_ARGS ("(0x%08x, 0x%08x, '%*s')\n", dir, dentry,
                         dentry->d_name.len, dentry->d_name.name);
 
-#ifdef DO_PARENT_INODE_INC
-	if (ocfs_inc_icount(dir) < 0)
-		BUG();
-#endif
-
 	if (dentry->d_name.len > OCFS_MAX_FILENAME_LENGTH) {
 		LOG_ERROR_STR ("name too long");
 		ret = ERR_PTR (-ENAMETOOLONG);
@@ -162,9 +157,6 @@
 	if (fe_bh)
 		brelse(fe_bh);
 	
-#ifdef DO_PARENT_INODE_INC
-	atomic_dec (&dir->i_count);
-#endif
 	LOG_EXIT_PTR (ret);
 	return ret;
 }				/* ocfs_lookup */
@@ -190,11 +182,6 @@
 	LOG_ENTRY_ARGS ("(0x%08x, 0x%08x, %d, %d, '%*s')\n", dir, dentry, mode,
 			dev, dentry->d_name.len, dentry->d_name.name);
 
-#ifdef DO_PARENT_INODE_INC
-	if (ocfs_inc_icount(dir) < 0)
-		BUG();	
-#endif
-
 	/* get our super block */
 	osb = (ocfs_super *) OCFS_GENERIC_SB_P(dir->i_sb);
 	if (osb->osb_flags & OCFS_OSB_FLAGS_SHUTDOWN) {
@@ -329,10 +316,6 @@
 	if (lock_bh != NULL) 
 		brelse(lock_bh);
 
-#ifdef DO_PARENT_INODE_INC
-	atomic_dec (&dir->i_count);
-#endif
-
 	if (status < 0)
 		ocfs_bh_sem_hash_cleanup_pid(ocfs_getpid());
 
@@ -1351,11 +1334,6 @@
 			dentry, symname, dentry->d_name.len, 
 			dentry->d_name.name);
 
-#ifdef DO_PARENT_INODE_INC
-	if (ocfs_inc_icount(dir) < 0)
-		BUG();
-#endif
-
 	inode = new_inode (dir->i_sb);
 	if (IS_ERR (inode)) {
 		status = PTR_ERR(inode);
@@ -1470,9 +1448,6 @@
 			OCFS_BH_PUT_DATA(new_fe_bh);
 		brelse(new_fe_bh);
 	}
-#ifdef DO_PARENT_INODE_INC
-	atomic_dec (&dir->i_count);
-#endif
 
 	if (status < 0)
 		ocfs_bh_sem_hash_cleanup_pid(ocfs_getpid());



More information about the Ocfs2-commits mailing list