patch-2.1.104 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.103/linux/fs/coda/dir.c linux/fs/coda/dir.c
@@ -167,8 +167,10 @@
 	entry->d_time = 0;
 	entry->d_op = &coda_dentry_operations;
 	d_add(entry, res_inode);
-	if ( dropme ) 
+	if ( dropme ) {
 		d_drop(entry);
+		ITOC(res_inode)->c_flags |= C_VATTR;
+	}
         EXIT;
         return 0;
 }
@@ -264,7 +266,7 @@
 	}
 
 	/* invalidate the directory cnode's attributes */
-	dircnp->c_flags &= ~C_VATTR;
+	dircnp->c_flags |= C_VATTR;
 	d_instantiate(de, result);
         return 0;
 }			     
@@ -320,7 +322,7 @@
 	}
 	
 	/* invalidate the directory cnode's attributes */
-	dircnp->c_flags &= ~C_VATTR;
+	dircnp->c_flags |= C_VATTR;
 	dir->i_nlink++;
 	d_instantiate(de, inode);
         return 0;
@@ -359,7 +361,7 @@
 			   (const char *)name, len);
 
 	if (  ! error ) { 
-		dir_cnp->c_flags &= ~C_VATTR;
+		dir_cnp->c_flags |= C_VATTR;
 		inode->i_nlink++;
 		d_instantiate(de, inode);
 	} else {
@@ -442,7 +444,7 @@
         }
 
         /* cache management */
-	dircnp->c_flags &= ~C_VATTR;
+	dircnp->c_flags |= C_VATTR;
 	
 	de->d_inode->i_nlink--;
 	d_delete(de);
@@ -814,7 +816,7 @@
 		if (is_bad_inode(inode))
 			return 0;
 		cii = ITOC(de->d_inode);
-		if (cii->c_flags & C_PURGE) 
+		if (cii->c_flags & (C_PURGE | C_VATTR)) 
 			valid = 0;
 	}
 	return valid ||  coda_isroot(de->d_inode);
@@ -838,7 +840,7 @@
 	}
 
 	/* this baby may be lost if:
-	   - it's type changed
+            - it's type changed
             - it's ino changed 
 	*/
 	old_mode = inode->i_mode;
@@ -852,7 +854,7 @@
 		return -EIO;
 	}
 	
-	cii->c_flags &= ~C_VATTR;
+	cii->c_flags &= ~(C_VATTR | C_PURGE);
 	return 0;
 }
 

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