patch-2.1.89 linux/fs/coda/super.c

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

diff -u --recursive --new-file v2.1.88/linux/fs/coda/super.c linux/fs/coda/super.c
@@ -33,7 +33,7 @@
 #include <linux/coda.h>
 #include <linux/coda_linux.h>
 #include <linux/coda_psdev.h>
-#include <linux/coda_cnode.h>
+#include <linux/coda_fs_i.h>
 #include <linux/coda_cache.h>
 
 
@@ -119,7 +119,7 @@
 	        unlock_super(sb);
 		goto error;
 	}	  
-	printk("coda_read_super: rootfid is %s\n", coda_f2s(&fid, str));
+	printk("coda_read_super: rootfid is %s\n", coda_f2s(&fid));
 	
 	/* make root inode */
         error = coda_cnode_make(&root, &fid, sb);
@@ -130,8 +130,8 @@
 	    goto error;
 	} 
 
-	printk("coda_read_super: rootinode is %ld dev %s\n", 
-	       root->i_ino, kdevname(root->i_dev));
+	printk("coda_read_super: rootinode is %ld dev %d\n", 
+	       root->i_ino, root->i_dev);
 	sbi->sbi_root = root;
 	sb->s_root = d_alloc_root(root, NULL);
 	unlock_super(sb);
@@ -151,7 +151,6 @@
 	}
         if (root) {
                 iput(root);
-                coda_cnode_free(ITOC(root));
         }
         sb->s_dev = 0;
         return NULL;
@@ -181,8 +180,10 @@
 /* all filling in of inodes postponed until lookup */
 static void coda_read_inode(struct inode *inode)
 {
+	struct coda_inode_info *cnp;
 	ENTRY;
-	inode->u.generic_ip =  NULL;
+	cnp = ITOC(inode);
+	cnp->c_magic = 0;
 	return;
 }
 
@@ -190,24 +191,28 @@
 {
 	ENTRY;
 
-        CDEBUG(D_INODE,"ino: %ld, cnp: %p\n", in->i_ino, in->u.generic_ip);
+        CDEBUG(D_INODE,"ino: %ld, count %d\n", in->i_ino, in->i_count);
+
+	if ( in->i_count == 1 ) 
+		in->i_nlink = 0;
+		
 }
 
 static void coda_delete_inode(struct inode *inode)
 {
-        struct cnode *cnp;
+        struct coda_inode_info *cnp;
         struct inode *open_inode;
 
         ENTRY;
         CDEBUG(D_SUPER, " inode->ino: %ld, count: %d\n", 
 	       inode->i_ino, inode->i_count);        
 
-	if ( inode->i_ino == CTL_INO ) {
+        cnp = ITOC(inode);
+	if ( inode->i_ino == CTL_INO || cnp->c_magic != CODA_CNODE_MAGIC ) {
 	        clear_inode(inode);
 		return;
 	}
 
-        cnp = ITOC(inode);
 
 	if ( coda_fid_is_volroot(&cnp->c_fid) )
 		list_del(&cnp->c_volrootlist);
@@ -223,7 +228,6 @@
 	coda_cache_clear_cnp(cnp);
 
 	inode->u.generic_ip = NULL;
-        coda_cnode_free(cnp);
         clear_inode(inode);
 	EXIT;
 }
@@ -231,7 +235,7 @@
 static int  coda_notify_change(struct dentry *de, struct iattr *iattr)
 {
 	struct inode *inode = de->d_inode;
-        struct cnode *cnp;
+        struct coda_inode_info *cnp;
         struct coda_vattr vattr;
         int error;
 	
@@ -350,7 +354,7 @@
 
         if (MINOR(psdev->i_rdev) >= MAX_CODADEVS) { 
 		printk("minor %d not an allocated Coda PSDEV\n", 
-		       MINOR(psdev->i_rdev));
+		       psdev->i_rdev);
 		return 1;
         }
 

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