mtd/fs/jffs2 erase.c,1.45,1.46

David Woodhouse dwmw2 at infradead.org
Thu Jan 9 08:55:29 EST 2003


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

Modified Files:
	erase.c 
Log Message:
eCos support

Index: erase.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/erase.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- erase.c	9 Oct 2002 08:27:08 -0000	1.45
+++ erase.c	9 Jan 2003 13:55:26 -0000	1.46
@@ -17,6 +17,7 @@
 #include <linux/interrupt.h>
 #include <linux/compiler.h>
 #include <linux/crc32.h>
+#include <linux/sched.h>
 #include "nodelist.h"
 
 struct erase_priv_struct {
@@ -24,7 +25,9 @@
 	struct jffs2_sb_info *c;
 };
       
+#ifndef __ECOS
 static void jffs2_erase_callback(struct erase_info *);
+#endif
 static void jffs2_erase_succeeded(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb);
 static void jffs2_free_all_node_refs(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb);
 static void jffs2_mark_erased_block(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb);
@@ -32,6 +35,13 @@
 void jffs2_erase_block(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb)
 {
 	int ret;
+#ifdef __ECOS
+       ret = jffs2_flash_erase(c, jeb);
+       if (!ret) {
+               jffs2_erase_succeeded(c, jeb);
+               return;
+       }
+#else /* Linux */
 	struct erase_info *instr;
 
 	instr = kmalloc(sizeof(struct erase_info) + sizeof(struct erase_priv_struct), GFP_KERNEL);
@@ -65,6 +75,7 @@
 		return;
 
 	kfree(instr);
+#endif /* __ECOS */
 
 	if (ret == -ENOMEM || ret == -EAGAIN) {
 		/* Erase failed immediately. Refile it on the list */
@@ -156,7 +167,7 @@
 	jffs2_erase_pending_trigger(c);
 }
 
-
+#ifndef __ECOS
 static inline void jffs2_erase_failed(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb)
 {
 	 spin_lock(&c->erase_completion_lock);
@@ -181,6 +192,7 @@
 	}	
 	kfree(instr);
 }
+#endif /* !__ECOS */
 
 /* Hmmm. Maybe we should accept the extra space it takes and make
    this a standard doubly-linked list? */





More information about the linux-mtd-cvs mailing list