patch-2.1.104 linux/fs/coda/cnode.c

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

diff -u --recursive --new-file v2.1.103/linux/fs/coda/cnode.c linux/fs/coda/cnode.c
@@ -15,7 +15,7 @@
 
 /* cnode.c */
 
-static void coda_fill_inode (struct inode *inode, struct coda_vattr *attr)
+static void coda_fill_inode(struct inode *inode, struct coda_vattr *attr)
 {
         CDEBUG(D_SUPER, "ino: %ld\n", inode->i_ino);
 
@@ -54,8 +54,8 @@
         ENTRY;
 
         /* 
-        * We get inode numbers from Venus -- see venus source
-	*/
+	 * We get inode numbers from Venus -- see venus source
+	 */
 
 	error = venus_getattr(sb, fid, &attr);
 	if ( error ) {
@@ -82,16 +82,26 @@
 		INIT_LIST_HEAD(&(cnp->c_cnhead));
 		INIT_LIST_HEAD(&(cnp->c_volrootlist));
 	} else {
-		printk("coda_cnode make on initialized inode %ld, %s!\n",
+	        cnp->c_flags = 0;
+		CDEBUG(D_CNODE, "coda_cnode make on initialized"
+		       "inode %ld, %s!\n",
 		       (*inode)->i_ino, coda_f2s(&cnp->c_fid));
 	}
 
 	/* fill in the inode attributes */
-	if ( coda_fid_is_volroot(fid) ) 
+	if ( coda_f2i(fid) != ino ) {
+	        if ( !coda_fid_is_weird(fid) ) 
+		        printk("Coda: unknown weird fid: ino %ld, fid %s."
+			       "Tell Peter.", ino, coda_f2s(&cnp->c_fid));
 		list_add(&cnp->c_volrootlist, &sbi->sbi_volroothead);
+		CDEBUG(D_CNODE, "Added %ld ,%s to volroothead\n",
+		       ino, coda_f2s(&cnp->c_fid));
+	}
 
         coda_fill_inode(*inode, &attr);
-	CDEBUG(D_CNODE, "Done linking: ino %ld,  at 0x%x with cnp 0x%x, cnp->c_vnode 0x%x\n", (*inode)->i_ino, (int) (*inode), (int) cnp, (int)cnp->c_vnode);
+	CDEBUG(D_CNODE, "Done linking: ino %ld,  at 0x%x with cnp 0x%x,"
+	       "cnp->c_vnode 0x%x\n", (*inode)->i_ino, (int) (*inode), 
+	       (int) cnp, (int)cnp->c_vnode);
 
         EXIT;
         return 0;
@@ -132,7 +142,7 @@
 	}
 
 
-	if ( coda_fid_is_volroot(fid) ) {
+	if ( coda_fid_is_weird(fid) ) {
 		struct coda_inode_info *cii;
 		struct list_head *lh, *le;
 		struct coda_sb_info *sbi = coda_sbp(sb);
@@ -141,7 +151,7 @@
 		while ( (le = le->next) != lh ) {
 			cii = list_entry(le, struct coda_inode_info, 
 					 c_volrootlist);
-			if ( cii->c_fid.Volume == fid->Volume) {
+			if ( coda_fideq(&cii->c_fid, fid) ) {
 				inode = cii->c_vnode;
 				CDEBUG(D_INODE, "volume root, found %ld\n", cii->c_vnode->i_ino);
 				return cii->c_vnode;
@@ -151,7 +161,7 @@
 		return NULL;
 	}
 
-	/* fid is not volume root, hence ino is computable */
+	/* fid is not weird: ino should be computable */
 	nr = coda_f2i(fid);
 	inode = iget(sb, nr);
 	if ( !inode ) {
@@ -173,9 +183,9 @@
 	   These have the same inode as the root of the volume they
 	   mount, but the fid will be wrong. 
 	*/
-	if ( !coda_fideq(fid, &(cnp->c_fid)) && 
-	     !coda_fid_is_volroot(&(cnp->c_fid))) {
-		printk("coda_fid2inode: bad cnode! Tell Peter.\n");
+	if ( !coda_fideq(fid, &(cnp->c_fid)) ) {
+		printk("coda_fid2inode: bad cnode (ino %ld, fid %s)"
+		       "Tell Peter.\n", nr, coda_f2s(fid));
 		iput(inode);
 		return NULL;
 	}

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