mtd/fs/jffs2/ecos/src fs-ecos.c,1.32,1.33

David Woodhouse dwmw2 at infradead.org
Tue Dec 2 05:43:05 EST 2003


Update of /home/cvs/mtd/fs/jffs2/ecos/src
In directory phoenix.infradead.org:/tmp/cvs-serv21112

Modified Files:
	fs-ecos.c 
Log Message:
Work around strangeness in eCos current directory handling

Index: fs-ecos.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/ecos/src/fs-ecos.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- fs-ecos.c	28 Nov 2003 11:16:32 -0000	1.32
+++ fs-ecos.c	2 Dec 2003 10:43:03 -0000	1.33
@@ -580,6 +580,7 @@
 }
 
 extern cyg_dir cyg_cdir_dir;
+extern cyg_mtab_entry *cyg_cdir_mtab_entry;
 
 // -------------------------------------------------------------------------
 // jffs2_umount()
@@ -608,6 +609,7 @@
 			return EBUSY;
                 }
 		if (root->i_count == 2 &&
+		    cyg_cdir_mtab_entry == mte &&
 		    cyg_cdir_dir == (cyg_dir)root &&
 		    !strcmp(mte->name, "/")) {
 			/* If we were mounted on root, there's no
@@ -619,6 +621,10 @@
 			cyg_cdir_dir = CYG_DIR_NULL;
 			jffs2_iput(root);
 		}
+		/* Argh. The fileio code sets this; never clears it */
+		if (cyg_cdir_mtab_entry == mte)
+			cyg_cdir_mtab_entry = NULL;
+
 		if (root->i_count != 1) {
 			printf("Ino #1 has use count %d\n",
 			       root->i_count);
@@ -665,6 +671,12 @@
 	int err;
 
 	D2(printf("jffs2_open\n"));
+
+	/* If no chdir has been called and we were the first file system
+	   mounted, we get called with dir == NULL. Deal with it */
+	if (!dir)
+		dir = mte->root;
+
 #ifndef CYGOPT_FS_JFFS2_WRITE
 	if (mode & (O_CREAT|O_TRUNC|O_WRONLY))
 		return EROFS;




More information about the linux-mtd-cvs mailing list