From 3be36675d41a30ed3b192f92684f1417aa0f8bfe Mon Sep 17 00:00:00 2001 From: Andrew Victor Date: Wed, 9 Feb 2005 09:09:05 +0000 Subject: [JFFS2] Core changes required to support JFFS2-on-Dataflash devices. DataFlash page-sizes are not a power of two (they're multiples of 528 bytes). There are a few places in JFFS2 code where sector_size is used as a bitmask. A new macro (SECTOR_ADDR) was defined to calculate these sector addresses. For non-DataFlash devices, the original (faster) bitmask operation is still used. In scan.c, the EMPTY_SCAN_SIZE was a constant of 1024. Since this could be larger than the sector size of the DataFlash, this is now basically set to MIN(sector_size, 1024). Addition of a jffs2_is_writebuffered() macro. Signed-off-by: Andrew Victor Signed-off-by: Thomas Gleixner --- fs/jffs2/os-linux.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'fs/jffs2/os-linux.h') diff --git a/fs/jffs2/os-linux.h b/fs/jffs2/os-linux.h index 03b0acc37b73..0412416d1f2d 100644 --- a/fs/jffs2/os-linux.h +++ b/fs/jffs2/os-linux.h @@ -7,7 +7,7 @@ * * For licensing information, see the file 'LICENCE' in this directory. * - * $Id: os-linux.h,v 1.51 2004/11/16 20:36:11 dwmw2 Exp $ + * $Id: os-linux.h,v 1.52 2005/02/09 09:09:01 pavlov Exp $ * */ @@ -97,7 +97,10 @@ static inline void jffs2_init_inode_info(struct jffs2_inode_info *f) #endif } +#define SECTOR_ADDR(x) ( ((unsigned long)(x) & ~(c->sector_size-1)) ) + #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) #define jffs2_can_mark_obsolete(c) (1) -- cgit