mtd/fs/jffs2 nodelist.h,1.87,1.88 scan.c,1.95,1.96 nodemgmt.c,1.86,1.87
David Woodhouse
dwmw2 at infradead.org
Thu Jan 9 08:56:29 EST 2003
Update of /home/cvs/mtd/fs/jffs2
In directory phoenix.infradead.org:/tmp/cvs-serv28199
Modified Files:
nodelist.h scan.c nodemgmt.c
Log Message:
eCos support
Index: nodelist.h
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/nodelist.h,v
retrieving revision 1.87
retrieving revision 1.88
diff -u -r1.87 -r1.88
--- nodelist.h 12 Nov 2002 13:36:18 -0000 1.87
+++ nodelist.h 9 Jan 2003 13:56:27 -0000 1.88
@@ -17,11 +17,15 @@
#include <linux/config.h>
#include <linux/fs.h>
-#include <linux/mtd/compatmac.h> /* For min/max in older kernels */
#include <linux/jffs2.h>
#include <linux/jffs2_fs_sb.h>
#include <linux/jffs2_fs_i.h>
+#ifdef __ECOS
+#include "os-ecos.h"
+#else
+#include <linux/mtd/compatmac.h> /* For min/max in older kernels */
#include "os-linux.h"
+#endif
#ifndef CONFIG_JFFS2_FS_DEBUG
#define CONFIG_JFFS2_FS_DEBUG 2
Index: scan.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/scan.c,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -r1.95 -r1.96
--- scan.c 25 Nov 2002 21:14:10 -0000 1.95
+++ scan.c 9 Jan 2003 13:56:27 -0000 1.96
@@ -11,6 +11,7 @@
*
*/
#include <linux/kernel.h>
+#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/mtd/mtd.h>
#include <linux/pagemap.h>
@@ -70,12 +71,9 @@
uint32_t empty_blocks = 0, bad_blocks = 0;
unsigned char *flashbuf = NULL;
uint32_t buf_size = 0;
+#ifndef __ECOS
size_t pointlen;
- if (!c->blocks) {
- printk(KERN_WARNING "EEEK! c->blocks is NULL!\n");
- return -EINVAL;
- }
if (c->mtd->point) {
ret = c->mtd->point (c->mtd, 0, c->mtd->size, &pointlen, &flashbuf);
if (!ret && pointlen < c->mtd->size) {
@@ -87,6 +85,7 @@
if (ret)
D1(printk(KERN_DEBUG "MTD point failed %d\n", ret));
}
+#endif
if (!flashbuf) {
/* For NAND it's quicker to read a whole eraseblock at a time,
apparently */
@@ -237,9 +236,10 @@
}
if (buf_size)
kfree(flashbuf);
+#ifndef __ECOS
else
c->mtd->unpoint(c->mtd, flashbuf, 0, c->mtd->size);
-
+#endif
return 0;
}
Index: nodemgmt.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/nodemgmt.c,v
retrieving revision 1.86
retrieving revision 1.87
diff -u -r1.86 -r1.87
--- nodemgmt.c 25 Nov 2002 20:09:38 -0000 1.86
+++ nodemgmt.c 9 Jan 2003 13:56:27 -0000 1.87
@@ -16,6 +16,7 @@
#include <linux/mtd/mtd.h>
#include <linux/interrupt.h>
#include <linux/compiler.h>
+#include <linux/sched.h> /* For cond_resched() */
#include "nodelist.h"
/**
@@ -204,6 +205,11 @@
}
/* Make sure this can't deadlock. Someone has to start the erases
of erase_pending blocks */
+#ifdef __ECOS
+ /* In eCos, we don't have a handy kernel thread doing the erases for
+ us. We do them ourselves right now. */
+ jffs2_erase_pending_blocks(c);
+#else
set_current_state(TASK_INTERRUPTIBLE);
add_wait_queue(&c->erase_wait, &wait);
D1(printk(KERN_DEBUG "Waiting for erases to complete. erasing_blocks is %d. (erasableempty: %s, erasingempty: %s, erasependingempty: %s)\n",
@@ -220,6 +226,7 @@
if (signal_pending(current)) {
return -EINTR;
}
+#endif
/* An erase may have failed, decreasing the
amount of free space available. So we must
restart from the beginning */
More information about the linux-mtd-cvs
mailing list