Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2f82ce1e authored by Andrew Victor's avatar Andrew Victor Committed by Thomas Gleixner
Browse files

[JFFS2] Use a single config option for write buffer support



This patch replaces the current CONFIG_JFFS2_FS_NAND, CONFIG_JFFS2_FS_NOR_ECC
and CONFIG_JFFS2_FS_DATAFLASH with a single configuration option -
CONFIG_JFFS2_FS_WRITEBUFFER.

The only functional change of this patch is that the slower div/mod
calculations for SECTOR_ADDR(), PAGE_DIV() and PAGE_MOD() are now always
used when CONFIG_JFFS2_FS_WRITEBUFFER is enabled.

Signed-off-by: default avatarAndrew Victor <andrew@sanpeople.com>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 8f15fd55
Loading
Loading
Loading
Loading
+9 −24
Original line number Diff line number Diff line
@@ -1063,33 +1063,18 @@ config JFFS2_FS_DEBUG
	  If reporting bugs, please try to have available a full dump of the
	  messages at debug level 1 while the misbehaviour was occurring.

config JFFS2_FS_NAND
	bool "JFFS2 support for NAND flash"
config JFFS2_FS_WRITEBUFFER
	bool "JFFS2 write-buffering support"
	depends on JFFS2_FS
	default n
	help
	  This enables the support for NAND flash in JFFS2. NAND is a newer
	  type of flash chip design than the traditional NOR flash, with
	  higher density but a handful of characteristics which make it more
	  interesting for the file system to use.

	  Say 'N' unless you have NAND flash.

config JFFS2_FS_NOR_ECC
        bool "JFFS2 support for ECC'd NOR flash (EXPERIMENTAL)"
        depends on JFFS2_FS && EXPERIMENTAL
        default n
	default y
	help
          This enables the experimental support for NOR flash with transparent
          ECC for JFFS2. This type of flash chip is not common, however it is
          available from ST Microelectronics.
	  This enables the write-buffering support in JFFS2.

config JFFS2_FS_DATAFLASH
	bool "JFFS2 support for DataFlash (EXPERIMENTAL)"
	depends on JFFS2_FS && EXPERIMENTAL
	default n
	help
	  This enables the experimental support for JFFS2 on DataFlash devices.
	  This functionality is required to support JFFS2 on the following
	  types of flash devices:
	    - NAND flash
	    - NOR flash with transparent ECC
	    - DataFlash

config JFFS2_COMPRESSION_OPTIONS
	bool "Advanced compression options for JFFS2"
+2 −4
Original line number Diff line number Diff line
#
# Makefile for the Linux Journalling Flash File System v2 (JFFS2)
#
# $Id: Makefile.common,v 1.8 2005/02/09 09:17:40 pavlov Exp $
# $Id: Makefile.common,v 1.9 2005/02/09 09:23:53 pavlov Exp $
#

obj-$(CONFIG_JFFS2_FS) += jffs2.o
@@ -11,9 +11,7 @@ jffs2-y += read.o nodemgmt.o readinode.o write.o scan.o gc.o
jffs2-y	+= symlink.o build.o erase.o background.o fs.o writev.o
jffs2-y	+= super.o

jffs2-$(CONFIG_JFFS2_FS_NAND)	+= wbuf.o
jffs2-$(CONFIG_JFFS2_FS_NOR_ECC) += wbuf.o
jffs2-$(CONFIG_JFFS2_FS_DATAFLASH) += wbuf.o
jffs2-$(CONFIG_JFFS2_FS_WRITEBUFFER)	+= wbuf.o
jffs2-$(CONFIG_JFFS2_RUBIN)	+= compr_rubin.o
jffs2-$(CONFIG_JFFS2_RTIME)	+= compr_rtime.o
jffs2-$(CONFIG_JFFS2_ZLIB)	+= compr_zlib.o
+2 −4
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@
 *
 * For licensing information, see the file 'LICENCE' in this directory.
 *
 * $Id: fs.c,v 1.52 2005/02/09 09:17:40 pavlov Exp $
 * $Id: fs.c,v 1.53 2005/02/09 09:23:53 pavlov Exp $
 *
 */

@@ -450,13 +450,11 @@ int jffs2_do_fill_super(struct super_block *sb, void *data, int silent)

	c = JFFS2_SB_INFO(sb);

#ifndef CONFIG_JFFS2_FS_NAND
#ifndef CONFIG_JFFS2_FS_WRITEBUFFER
	if (c->mtd->type == MTD_NANDFLASH) {
		printk(KERN_ERR "jffs2: Cannot operate on NAND flash unless jffs2 NAND support is compiled in.\n");
		return -EINVAL;
	}
#endif
#ifndef CONFIG_JFFS2_FS_DATAFLASH
	if (c->mtd->type == MTD_DATAFLASH) {
		printk(KERN_ERR "jffs2: Cannot operate on DataFlash unless jffs2 DataFlash support is compiled in.\n");
		return -EINVAL;
+2 −2
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@
 *
 * For licensing information, see the file 'LICENCE' in this directory.
 *
 * $Id: nodelist.h,v 1.126 2004/11/19 15:06:29 dedekind Exp $
 * $Id: nodelist.h,v 1.127 2005/02/09 09:23:53 pavlov Exp $
 *
 */

@@ -462,7 +462,7 @@ int jffs2_do_mount_fs(struct jffs2_sb_info *c);
/* erase.c */
void jffs2_erase_pending_blocks(struct jffs2_sb_info *c, int count);

#ifdef CONFIG_JFFS2_FS_NAND
#ifdef CONFIG_JFFS2_FS_WRITEBUFFER
/* wbuf.c */
int jffs2_flush_wbuf_gc(struct jffs2_sb_info *c, uint32_t ino);
int jffs2_flush_wbuf_pad(struct jffs2_sb_info *c);
+8 −20
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@
 *
 * For licensing information, see the file 'LICENCE' in this directory.
 *
 * $Id: os-linux.h,v 1.53 2005/02/09 09:17:41 pavlov Exp $
 * $Id: os-linux.h,v 1.54 2005/02/09 09:23:53 pavlov Exp $
 *
 */

@@ -97,16 +97,12 @@ static inline void jffs2_init_inode_info(struct jffs2_inode_info *f)
#endif
}

#ifdef CONFIG_JFFS2_FS_DATAFLASH
#define SECTOR_ADDR(x) ( ((unsigned long)(x) / (unsigned long)(c->sector_size)) * c->sector_size )
#else
#define SECTOR_ADDR(x) ( ((unsigned long)(x) & ~(c->sector_size-1)) )
#endif

#define jffs2_is_readonly(c) (OFNI_BS_2SFFJ(c)->s_flags & MS_RDONLY)
#define jffs2_is_writebuffered(c) (c->wbuf != NULL)

#if (!defined CONFIG_JFFS2_FS_NAND && !defined CONFIG_JFFS2_FS_NOR_ECC && !defined CONFIG_JFFS2_FS_DATAFLASH)
#ifndef CONFIG_JFFS2_FS_WRITEBUFFER
#define SECTOR_ADDR(x) ( ((unsigned long)(x) & ~(c->sector_size-1)) )
#define jffs2_can_mark_obsolete(c) (1)
#define jffs2_cleanmarker_oob(c) (0)
#define jffs2_write_nand_cleanmarker(c,jeb) (-EIO)
@@ -129,6 +125,7 @@ static inline void jffs2_init_inode_info(struct jffs2_inode_info *f)

#else /* NAND and/or ECC'd NOR support present */

#define SECTOR_ADDR(x) ( ((unsigned long)(x) / (unsigned long)(c->sector_size)) * c->sector_size )
#define jffs2_can_mark_obsolete(c) ((c->mtd->type == MTD_NORFLASH && !(c->mtd->flags & MTD_ECC)) || c->mtd->type == MTD_RAM)
#define jffs2_cleanmarker_oob(c) (c->mtd->type == MTD_NANDFLASH)

@@ -150,25 +147,16 @@ int jffs2_flush_wbuf_gc(struct jffs2_sb_info *c, uint32_t ino);
int jffs2_flush_wbuf_pad(struct jffs2_sb_info *c);
int jffs2_nand_flash_setup(struct jffs2_sb_info *c);
void jffs2_nand_flash_cleanup(struct jffs2_sb_info *c);
#ifdef CONFIG_JFFS2_FS_NOR_ECC

#define jffs2_nor_ecc(c) (c->mtd->type == MTD_NORFLASH && (c->mtd->flags & MTD_ECC))
int jffs2_nor_ecc_flash_setup(struct jffs2_sb_info *c);
void jffs2_nor_ecc_flash_cleanup(struct jffs2_sb_info *c);
#else
#define jffs2_nor_ecc(c) (0)
#define jffs2_nor_ecc_flash_setup(c) (0)
#define jffs2_nor_ecc_flash_cleanup(c) do {} while (0)
#endif /* NOR ECC */
#ifdef CONFIG_JFFS2_FS_DATAFLASH

#define jffs2_dataflash(c) (c->mtd->type == MTD_DATAFLASH)
int jffs2_dataflash_setup(struct jffs2_sb_info *c);
void jffs2_dataflash_cleanup(struct jffs2_sb_info *c);
#else
#define jffs2_dataflash(c) (0)
#define jffs2_dataflash_setup(c) (0)
#define jffs2_dataflash_cleanup(c) do {} while (0)
#endif /* DATAFLASH */
#endif /* NAND */

#endif /* WRITEBUFFER */

/* erase.c */
static inline void jffs2_erase_pending_trigger(struct jffs2_sb_info *c)
Loading