mtd/fs/jffs2/ecos/src fs-ecos.c,1.35,1.36
gthomas at infradead.org
gthomas at infradead.org
Wed Mar 31 22:39:57 EST 2004
Update of /home/cvs/mtd/fs/jffs2/ecos/src
In directory phoenix.infradead.org:/tmp/cvs-serv15789/fs/jffs2/ecos/src
Modified Files:
fs-ecos.c
Log Message:
Merge changes from eCos CVS - see ChangeLog
Index: fs-ecos.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/ecos/src/fs-ecos.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- fs-ecos.c 31 Mar 2004 14:10:28 -0000 1.35
+++ fs-ecos.c 1 Apr 2004 03:39:55 -0000 1.36
@@ -263,7 +263,8 @@
while (*n != '\0' && *n != '/')
n++, namelen++;
- // If we terminated on a NUL, set last flag.
+ // Check if this is the last path element.
+ while( *n == '/') n++;
if (*n == '\0')
ds->last = true;
@@ -353,7 +354,7 @@
// Update dirsearch object to search next directory.
d->dir = d->node;
d->path += d->namelen;
- if (*(d->path) == '/')
+ while (*(d->path) == '/')
d->path++; // skip dirname separators
}
}
@@ -591,6 +592,7 @@
struct _inode *root = (struct _inode *) mte->root;
struct super_block *jffs2_sb = root->i_sb;
struct jffs2_sb_info *c = JFFS2_SB_INFO(jffs2_sb);
+ struct jffs2_full_dirent *fd, *next;
D2(printf("jffs2_umount\n"));
@@ -634,6 +636,13 @@
jffs2_stop_garbage_collect_thread(c);
#endif
jffs2_iput(root); // Time to free the root inode
+
+ // free directory entries
+ for (fd = root->jffs2_i.dents; fd; fd = next) {
+ next=fd->next;
+ free(fd);
+ }
+
free(root);
//Clear root inode
//root_i = NULL;
@@ -726,7 +735,7 @@
return EISDIR;
}
-#ifndef CYGOPT_FS_JFFS2_WRITE
+#ifdef CYGOPT_FS_JFFS2_WRITE
if (mode & O_TRUNC) {
struct jffs2_inode_info *f = JFFS2_INODE_INFO(node);
struct jffs2_sb_info *c = JFFS2_SB_INFO(node->i_sb);
@@ -991,7 +1000,6 @@
// Allow through links to non-existing terminal objects
if (ds2.last && err == ENOENT) {
- jffs2_iput(ds2.node);
ds2.node = NULL;
err = ENOERR;
}
More information about the linux-mtd-cvs
mailing list