|
@@ -7,7 +7,7 @@
|
|
*
|
|
*
|
|
* For licensing information, see the file 'LICENCE' in this directory.
|
|
* For licensing information, see the file 'LICENCE' in this directory.
|
|
*
|
|
*
|
|
- * $Id: scan.c,v 1.117 2005/02/09 09:17:41 pavlov Exp $
|
|
|
|
|
|
+ * $Id: scan.c,v 1.118 2005/02/09 09:23:53 pavlov Exp $
|
|
*
|
|
*
|
|
*/
|
|
*/
|
|
#include <linux/kernel.h>
|
|
#include <linux/kernel.h>
|
|
@@ -68,7 +68,7 @@ static int jffs2_scan_dirent_node(struct jffs2_sb_info *c, struct jffs2_eraseblo
|
|
static inline int min_free(struct jffs2_sb_info *c)
|
|
static inline int min_free(struct jffs2_sb_info *c)
|
|
{
|
|
{
|
|
uint32_t min = 2 * sizeof(struct jffs2_raw_inode);
|
|
uint32_t min = 2 * sizeof(struct jffs2_raw_inode);
|
|
-#if defined CONFIG_JFFS2_FS_NAND || defined CONFIG_JFFS2_FS_NOR_ECC || defined CONFIG_JFFS2_FS_DATAFLASH
|
|
|
|
|
|
+#ifdef CONFIG_JFFS2_FS_WRITEBUFFER
|
|
if (!jffs2_can_mark_obsolete(c) && min < c->wbuf_pagesize)
|
|
if (!jffs2_can_mark_obsolete(c) && min < c->wbuf_pagesize)
|
|
return c->wbuf_pagesize;
|
|
return c->wbuf_pagesize;
|
|
#endif
|
|
#endif
|
|
@@ -228,7 +228,7 @@ int jffs2_scan_medium(struct jffs2_sb_info *c)
|
|
c->dirty_size -= c->nextblock->dirty_size;
|
|
c->dirty_size -= c->nextblock->dirty_size;
|
|
c->nextblock->dirty_size = 0;
|
|
c->nextblock->dirty_size = 0;
|
|
}
|
|
}
|
|
-#if defined CONFIG_JFFS2_FS_NAND || defined CONFIG_JFFS2_FS_NOR_ECC || defined CONFIG_JFFS2_FS_DATAFLASH
|
|
|
|
|
|
+#ifdef CONFIG_JFFS2_FS_WRITEBUFFER
|
|
if (!jffs2_can_mark_obsolete(c) && c->nextblock && (c->nextblock->free_size & (c->wbuf_pagesize-1))) {
|
|
if (!jffs2_can_mark_obsolete(c) && c->nextblock && (c->nextblock->free_size & (c->wbuf_pagesize-1))) {
|
|
/* If we're going to start writing into a block which already
|
|
/* If we're going to start writing into a block which already
|
|
contains data, and the end of the data isn't page-aligned,
|
|
contains data, and the end of the data isn't page-aligned,
|
|
@@ -294,7 +294,7 @@ static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblo
|
|
uint32_t hdr_crc, buf_ofs, buf_len;
|
|
uint32_t hdr_crc, buf_ofs, buf_len;
|
|
int err;
|
|
int err;
|
|
int noise = 0;
|
|
int noise = 0;
|
|
-#ifdef CONFIG_JFFS2_FS_NAND
|
|
|
|
|
|
+#ifdef CONFIG_JFFS2_FS_WRITEBUFFER
|
|
int cleanmarkerfound = 0;
|
|
int cleanmarkerfound = 0;
|
|
#endif
|
|
#endif
|
|
|
|
|
|
@@ -303,7 +303,7 @@ static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblo
|
|
|
|
|
|
D1(printk(KERN_DEBUG "jffs2_scan_eraseblock(): Scanning block at 0x%x\n", ofs));
|
|
D1(printk(KERN_DEBUG "jffs2_scan_eraseblock(): Scanning block at 0x%x\n", ofs));
|
|
|
|
|
|
-#ifdef CONFIG_JFFS2_FS_NAND
|
|
|
|
|
|
+#ifdef CONFIG_JFFS2_FS_WRITEBUFFER
|
|
if (jffs2_cleanmarker_oob(c)) {
|
|
if (jffs2_cleanmarker_oob(c)) {
|
|
int ret = jffs2_check_nand_cleanmarker(c, jeb);
|
|
int ret = jffs2_check_nand_cleanmarker(c, jeb);
|
|
D2(printk(KERN_NOTICE "jffs_check_nand_cleanmarker returned %d\n",ret));
|
|
D2(printk(KERN_NOTICE "jffs_check_nand_cleanmarker returned %d\n",ret));
|
|
@@ -338,7 +338,7 @@ static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblo
|
|
ofs += 4;
|
|
ofs += 4;
|
|
|
|
|
|
if (ofs == EMPTY_SCAN_SIZE(c->sector_size)) {
|
|
if (ofs == EMPTY_SCAN_SIZE(c->sector_size)) {
|
|
-#ifdef CONFIG_JFFS2_FS_NAND
|
|
|
|
|
|
+#ifdef CONFIG_JFFS2_FS_WRITEBUFFER
|
|
if (jffs2_cleanmarker_oob(c)) {
|
|
if (jffs2_cleanmarker_oob(c)) {
|
|
/* scan oob, take care of cleanmarker */
|
|
/* scan oob, take care of cleanmarker */
|
|
int ret = jffs2_check_oob_empty(c, jeb, cleanmarkerfound);
|
|
int ret = jffs2_check_oob_empty(c, jeb, cleanmarkerfound);
|