mtd/fs/jffs2/ecos/src fs-ecos.c,1.9,1.10 os-ecos.h,1.6,1.7
David Woodhouse
dwmw2 at infradead.org
Thu Nov 20 04:33:34 EST 2003
Update of /home/cvs/mtd/fs/jffs2/ecos/src
In directory phoenix.infradead.org:/tmp/cvs-serv28574
Modified Files:
fs-ecos.c os-ecos.h
Log Message:
Import cleanups from ecos tree
Index: fs-ecos.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/ecos/src/fs-ecos.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- fs-ecos.c 15 Jul 2003 20:42:33 -0000 1.9
+++ fs-ecos.c 20 Nov 2003 09:33:31 -0000 1.10
@@ -28,6 +28,12 @@
#include <cyg/io/config_keys.h>
#include <cyg/io/flash.h>
+#if (__GNUC__ == 3) && (__GNUC_MINOR__ == 2) && (__GNUC_PATCHLEVEL__ == 1) && \
+ defined (__ARM_ARCH_4__)
+#error This compiler is known to be broken. Please see:
+#error http://ecos.sourceware.org/ml/ecos-patches/2003-08/msg00006.html
+#endif
+
//==========================================================================
// Forward definitions
@@ -584,17 +590,12 @@
D2(printf("jffs2_umount\n"));
- // Decrement the mount count
- jffs2_sb->s_mount_count--;
-
// Only really umount if this is the only mount
- if (jffs2_sb->s_mount_count == 0) {
+ if (jffs2_sb->s_mount_count == 1) {
- // Check for open/inuse root or any cached inodes
-//if( root->i_count != 1 || root->i_cache_next != NULL) // root icount was set to 1 on mount
if (root->i_cache_next != NULL) // root icount was set to 1 on mount
return EBUSY;
-
+
dec_refcnt(root); // Time to free the root inode
//Clear root inode
@@ -606,13 +607,16 @@
free(c->blocks);
free(c->inocache_list);
free(jffs2_sb);
- // Clear root pointer
+ // Clear superblock & root pointer
mte->root = CYG_DIR_NULL;
+ mte->data = 0;
mte->fs->data = 0; // fstab entry, visible to all mounts. No current mount
// That's all folks.
D2(printf("jffs2_umount No current mounts\n"));
- }
-
+ } else {
+ jffs2_sb->s_mount_count--;
+ }
+
return ENOERR;
}
@@ -1022,7 +1026,7 @@
this.len = hashname - (const char *) this.name;
this.hash = end_name_hash(hash);
- err = jffs2_link(ds2.dir, ds1.node, &this);
+ err = jffs2_link(ds1.node, ds2.dir, &this);
if (err == 0)
ds1.node->i_ctime =
@@ -1143,7 +1147,7 @@
// Fill in the status
buf->st_mode = ds.node->i_mode;
- buf->st_ino = (ino_t) ds.node;
+ buf->st_ino = ds.node->i_ino;
buf->st_dev = 0;
buf->st_nlink = ds.node->i_nlink;
buf->st_uid = 0;
@@ -1460,7 +1464,7 @@
// Fill in the status
buf->st_mode = node->i_mode;
- buf->st_ino = (ino_t) node;
+ buf->st_ino = node->i_ino;
buf->st_dev = 0;
buf->st_nlink = node->i_nlink;
buf->st_uid = 0;
@@ -1823,7 +1827,7 @@
err = cyg_io_bread(sb->s_dev, write_buffer, &len, read_buffer_offset);
*return_size = (size_t) len;
- return (err != ENOERR);
+ return ((err == ENOERR) ? ENOERR : -EIO);
}
cyg_bool jffs2_flash_write(struct jffs2_sb_info * c,
@@ -1843,7 +1847,7 @@
err = cyg_io_bwrite(sb->s_dev, read_buffer, &len, write_buffer_offset);
*return_size = (size_t) len;
- return (err != ENOERR);
+ return ((err == ENOERR) ? ENOERR : -EIO);
}
int
Index: os-ecos.h
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/ecos/src/os-ecos.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- os-ecos.h 20 Nov 2003 09:19:11 -0000 1.6
+++ os-ecos.h 20 Nov 2003 09:33:31 -0000 1.7
@@ -14,14 +14,16 @@
#ifndef __JFFS2_OS_ECOS_H__
#define __JFFS2_OS_ECOS_H__
-#include <pkgconf/fs_jffs2.h>
#include <cyg/io/io.h>
#include <sys/types.h>
#include <asm/atomic.h>
#include <linux/stat.h>
+#include <linux/compiler.h>
#include "jffs2port.h"
-#define CONFIG_JFFS2_FS_DEBUG 0
+#ifndef CONFIG_JFFS2_FS_DEBUG
+# define CONFIG_JFFS2_FS_DEBUG 0
+#endif
static inline uint32_t os_to_jffs2_mode(uint32_t osmode)
{
@@ -234,6 +236,9 @@
#define jffs2_flush_wbuf(c, flag) do { ; } while(0)
#define jffs2_nand_read_failcnt(c,jeb) do { ; } while(0)
#define jffs2_write_nand_badblock(c,jeb) do { ; } while(0)
+#define jffs2_nand_flash_setup(c) (0)
+#define jffs2_nand_flash_cleanup(c) do {} while(0)
+#define jffs2_wbuf_dirty(c) (0)
#define jffs2_flash_writev jffs2_flash_writev
#define jffs2_wbuf_timeout NULL
#define jffs2_wbuf_process NULL
More information about the linux-mtd-cvs
mailing list