diff --git a/fs/yaffs2/Makefile b/fs/yaffs2/Makefile
index ab8b27f..a2ef5e2 100644
--- a/fs/yaffs2/Makefile
+++ b/fs/yaffs2/Makefile
@@ -31,7 +31,7 @@
 OBJS    := $(addprefix $(obj),$(COBJS-y))
 
 # -DCONFIG_YAFFS_NO_YAFFS1
-CFLAGS +=    -DCONFIG_YAFFS_DIRECT -DCONFIG_YAFFS_SHORT_NAMES_IN_RAM -DCONFIG_YAFFS_YAFFS2 -DNO_Y_INLINE -DLINUX_VERSION_CODE=0x20622 
+CFLAGS +=    -DCONFIG_YAFFS_DIRECT -DCONFIG_YAFFS_SHORT_NAMES_IN_RAM -DCONFIG_YAFFS_YAFFS2 -DNO_Y_INLINE -DLINUX_VERSION_CODE=0x20622
 
 all:  $(LIB)
 
@@ -53,4 +53,3 @@
 sinclude $(obj).depend
 
 #########################################################################
-
diff --git a/fs/yaffs2/README-linux b/fs/yaffs2/README-linux
index 589ae8d..3851e36 100644
--- a/fs/yaffs2/README-linux
+++ b/fs/yaffs2/README-linux
@@ -8,7 +8,7 @@
 
 A note on licencing
 -------------------
-YAFFS is available under the GPL and via alternative licensing 
+YAFFS is available under the GPL and via alternative licensing
 arrangements with Aleph One. If you're using YAFFS as a Linux kernel
 file system then it will be under the GPL. For use in other situations
 you should discuss licensing issues with Aleph One.
@@ -17,10 +17,10 @@
 Terminology
 -----------
 Page -  NAND addressable unit (normally 512b or 2Kbyte size) - can
-        be read, written, marked bad. Has associated OOB.
+	be read, written, marked bad. Has associated OOB.
 Block - Eraseable unit. 64 Pages. (128K on 2K NAND, 32K on 512b NAND)
 OOB -   'spare area' of each page for ECC, bad block marked and YAFFS
-        tags. 16 bytes per 512b - 64 bytes for 2K page size.
+	tags. 16 bytes per 512b - 64 bytes for 2K page size.
 Chunk - Basic YAFFS addressable unit. Same size as Page.
 Object - YAFFS Object: File, Directory, Link, Device etc.
 
@@ -48,28 +48,28 @@
 directory. These records are preserved until all the pages containing
 the object have been erased (We know when this happen by keeping a
 count of chunks remaining on the system for each object - when it
-reaches zero the object really is gone). 
+reaches zero the object really is gone).
 
 When data in a file is overwritten, the relevant chunks are replaced
 by writing new pages to flash containing the new data but the same
-tags. 
+tags.
 
-Pages are also marked with a short (2 bit) serial number that 
-increments each time the page at this position is incremented. The 
-reason for this is that if power loss/crash/other act of demonic 
-forces happens before the replaced page is marked as discarded, it is 
-possible to have two pages with the same tags. The serial number is 
+Pages are also marked with a short (2 bit) serial number that
+increments each time the page at this position is incremented. The
+reason for this is that if power loss/crash/other act of demonic
+forces happens before the replaced page is marked as discarded, it is
+possible to have two pages with the same tags. The serial number is
 used to arbitrate.
 
-A block containing only discarded pages (termed a dirty block) is an 
+A block containing only discarded pages (termed a dirty block) is an
 obvious candidate for garbage collection. Otherwise valid pages can be
-copied off a block thus rendering the whole block discarded and ready 
-for garbage collection.  
-          
+copied off a block thus rendering the whole block discarded and ready
+for garbage collection.
+
 In theory you don't need to hold the file structure in RAM... you
 could just scan the whole flash looking for pages when you need them.
 In practice though you'd want better file access times than that! The
-mechanism proposed here is to have a list of __u16 page addresses 
+mechanism proposed here is to have a list of __u16 page addresses
 associated with each file. Since there are 2^18 pages in a 128MB NAND,
 a __u16 is insufficient to uniquely identify a page but is does
 identify a group of 4 pages - a small enough region to search
@@ -77,17 +77,17 @@
 devices - within reason. The RAM overhead with this approach is approx
 2 bytes per page - 512kB of RAM for a whole 128MB NAND.
 
-Boot-time scanning to build the file structure lists only requires    
+Boot-time scanning to build the file structure lists only requires
 one pass reading NAND. If proper shutdowns happen the current RAM
 summary of the filesystem status is saved to flash, called
 'checkpointing'. This saves re-scanning the flash on startup, and gives
-huge boot/mount time savings. 
+huge boot/mount time savings.
 
 YAFFS regenerates its state by 'replaying the tape'  - i.e. by
 scanning the chunks in their allocation order (i.e. block sequence ID
 order), which is usually different form the media block order. Each
 block is still only read once - starting from the end of the media and
-working back. 
+working back.
 
 YAFFS tags in YAFFS1 mode:
 
@@ -109,27 +109,27 @@
  12 bytes ECC on data (3 bytes per 256 bytes of data)
 
 
-Page allocation and garbage collection       
-         
-Pages are allocated sequentially from the currently selected block.  
-When all the pages in the block are filled, another clean block is 
-selected for allocation. At least two or three clean blocks are 
-reserved for garbage collection purposes. If there are insufficient 
-clean blocks available, then a dirty block ( ie one containing only 
+Page allocation and garbage collection
+
+Pages are allocated sequentially from the currently selected block.
+When all the pages in the block are filled, another clean block is
+selected for allocation. At least two or three clean blocks are
+reserved for garbage collection purposes. If there are insufficient
+clean blocks available, then a dirty block ( ie one containing only
 discarded pages) is erased to free it up as a clean block. If no dirty
-blocks are available, then the dirtiest block is selected for garbage 
-collection.  
-          
-Garbage collection is performed by copying the valid data pages into 
-new data pages thus rendering all the pages in this block dirty and 
-freeing it up for erasure. I also like the idea of selecting a block 
+blocks are available, then the dirtiest block is selected for garbage
+collection.
+
+Garbage collection is performed by copying the valid data pages into
+new data pages thus rendering all the pages in this block dirty and
+freeing it up for erasure. I also like the idea of selecting a block
 at random some small percentage of the time - thus reducing the chance
 of wear differences.
 
 YAFFS is single-threaded. Garbage-collection is done as a parasitic
 task of writing data. So each time some data is written, a bit of
 pending garbage collection is done. More pages are garbage-collected
-when free space is tight. 
+when free space is tight.
 
 
 Flash writing
@@ -143,7 +143,7 @@
 always written on the next free block, so they are all used equally.
 Blocks containing data that is written but never erased will not get
 back into the free list, so wear is levelled over only blocks which
-are free or become free, not blocks which never change. 
+are free or become free, not blocks which never change.
 
 
 
@@ -183,7 +183,7 @@
 
 Option 3 is hardest as the image creator needs to know exactly what
 ECC bytes, endianness and algorithm to use as well as which bytes are
-available to YAFFS. 
+available to YAFFS.
 
 mkyaffs2image creates an image suitable for option 3 for the
 particular case of yaffs2 on 2K page NAND with default MTD layout.
@@ -195,7 +195,7 @@
 -----------
 
 A bootloader using YAFFS needs to know how MTD is laying out the OOB
-so that it can skip bad blocks. 
+so that it can skip bad blocks.
 
 YAFFS Tracing
 -------------
diff --git a/fs/yaffs2/devextras.h b/fs/yaffs2/devextras.h
index 9acda79..f6e5361 100644
--- a/fs/yaffs2/devextras.h
+++ b/fs/yaffs2/devextras.h
@@ -1,5 +1,5 @@
 /*
- * YAFFS: Yet another Flash File System . A NAND-flash specific file system. 
+ * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
  *
  * Copyright (C) 2002-2007 Aleph One Ltd.
  *   for Toby Churchill Ltd and Brightstar Engineering
@@ -15,7 +15,7 @@
 
 /*
  * This file is just holds extra declarations used during development.
- * Most of these are from kernel includes placed here so we can use them in 
+ * Most of these are from kernel includes placed here so we can use them in
  * applications.
  *
  */
@@ -192,7 +192,7 @@
  */
 #define list_for_each(pos, head) \
 	for (pos = (head)->next, prefetch(pos->next); pos != (head); \
-        	pos = pos->next, prefetch(pos->next))
+		pos = pos->next, prefetch(pos->next))
 
 /**
  * list_for_each_safe	-	iterate over a list safe against removal
diff --git a/fs/yaffs2/yaffs_checkptrw.c b/fs/yaffs2/yaffs_checkptrw.c
index f97ba4b..230f78f 100644
--- a/fs/yaffs2/yaffs_checkptrw.c
+++ b/fs/yaffs2/yaffs_checkptrw.c
@@ -26,27 +26,27 @@
 {
 
 	int blocksAvailable = dev->nErasedBlocks - dev->nReservedBlocks;
-	
+
 	T(YAFFS_TRACE_CHECKPOINT,
 		(TSTR("checkpt blocks available = %d" TENDSTR),
 		blocksAvailable));
-		
-	
+
+
 	return (blocksAvailable <= 0) ? 0 : 1;
 }
 
 
 static int yaffs_CheckpointErase(yaffs_Device *dev)
 {
-	
+
 	int i;
-	
 
-	if(!dev->eraseBlockInNAND)	
+
+	if(!dev->eraseBlockInNAND)
 		return 0;
 	T(YAFFS_TRACE_CHECKPOINT,(TSTR("checking blocks %d to %d"TENDSTR),
 		dev->internalStartBlock,dev->internalEndBlock));
-		
+
 	for(i = dev->internalStartBlock; i <= dev->internalEndBlock; i++) {
 		yaffs_BlockInfo *bi = yaffs_GetBlockInfo(dev,i);
 		if(bi->blockState == YAFFS_BLOCK_STATE_CHECKPOINT){
@@ -62,9 +62,9 @@
 			}
 		}
 	}
-	
+
 	dev->blocksInCheckpoint = 0;
-	
+
 	return 1;
 }
 
@@ -76,11 +76,11 @@
 	T(YAFFS_TRACE_CHECKPOINT,
 		(TSTR("allocating checkpt block: erased %d reserved %d avail %d next %d "TENDSTR),
 		dev->nErasedBlocks,dev->nReservedBlocks,blocksAvailable,dev->checkpointNextBlock));
-		
+
 	if(dev->checkpointNextBlock >= 0 &&
 	   dev->checkpointNextBlock <= dev->internalEndBlock &&
 	   blocksAvailable > 0){
-	
+
 		for(i = dev->checkpointNextBlock; i <= dev->internalEndBlock; i++){
 			yaffs_BlockInfo *bi = yaffs_GetBlockInfo(dev,i);
 			if(bi->blockState == YAFFS_BLOCK_STATE_EMPTY){
@@ -92,7 +92,7 @@
 		}
 	}
 	T(YAFFS_TRACE_CHECKPOINT,(TSTR("out of checkpt blocks"TENDSTR)));
-	
+
 	dev->checkpointNextBlock = -1;
 	dev->checkpointCurrentBlock = -1;
 }
@@ -101,19 +101,19 @@
 {
 	int  i;
 	yaffs_ExtendedTags tags;
-	
+
 	T(YAFFS_TRACE_CHECKPOINT,(TSTR("find next checkpt block: start:  blocks %d next %d" TENDSTR),
 		dev->blocksInCheckpoint, dev->checkpointNextBlock));
-		
-	if(dev->blocksInCheckpoint < dev->checkpointMaxBlocks) 
+
+	if(dev->blocksInCheckpoint < dev->checkpointMaxBlocks)
 		for(i = dev->checkpointNextBlock; i <= dev->internalEndBlock; i++){
 			int chunk = i * dev->nChunksPerBlock;
 			int realignedChunk = chunk - dev->chunkOffset;
 
 			dev->readChunkWithTagsFromNAND(dev,realignedChunk,NULL,&tags);
-			T(YAFFS_TRACE_CHECKPOINT,(TSTR("find next checkpt block: search: block %d oid %d seq %d eccr %d" TENDSTR), 
+			T(YAFFS_TRACE_CHECKPOINT,(TSTR("find next checkpt block: search: block %d oid %d seq %d eccr %d" TENDSTR),
 				i, tags.objectId,tags.sequenceNumber,tags.eccResult));
-						      
+
 			if(tags.sequenceNumber == YAFFS_SEQUENCE_CHECKPOINT_DATA){
 				/* Right kind of block */
 				dev->checkpointNextBlock = tags.objectId;
@@ -134,7 +134,7 @@
 
 int yaffs_CheckpointOpen(yaffs_Device *dev, int forWriting)
 {
-	
+
 	/* Got the functions we need? */
 	if (!dev->writeChunkWithTagsToNAND ||
 	    !dev->readChunkWithTagsFromNAND ||
@@ -144,31 +144,31 @@
 
 	if(forWriting && !yaffs_CheckpointSpaceOk(dev))
 		return 0;
-			
+
 	if(!dev->checkpointBuffer)
 		dev->checkpointBuffer = YMALLOC_DMA(dev->nDataBytesPerChunk);
 	if(!dev->checkpointBuffer)
 		return 0;
 
-	
+
 	dev->checkpointPageSequence = 0;
-	
+
 	dev->checkpointOpenForWrite = forWriting;
-	
+
 	dev->checkpointByteCount = 0;
 	dev->checkpointSum = 0;
 	dev->checkpointXor = 0;
 	dev->checkpointCurrentBlock = -1;
 	dev->checkpointCurrentChunk = -1;
 	dev->checkpointNextBlock = dev->internalStartBlock;
-	
+
 	/* Erase all the blocks in the checkpoint area */
 	if(forWriting){
 		memset(dev->checkpointBuffer,0,dev->nDataBytesPerChunk);
 		dev->checkpointByteOffset = 0;
 		return yaffs_CheckpointErase(dev);
-		
-		
+
+
 	} else {
 		int i;
 		/* Set to a value that will kick off a read */
@@ -181,7 +181,7 @@
 		for(i = 0; i < dev->checkpointMaxBlocks; i++)
 			dev->checkpointBlockList[i] = -1;
 	}
-	
+
 	return 1;
 }
 
@@ -200,15 +200,15 @@
 	int realignedChunk;
 
 	yaffs_ExtendedTags tags;
-	
+
 	if(dev->checkpointCurrentBlock < 0){
 		yaffs_CheckpointFindNextErasedBlock(dev);
 		dev->checkpointCurrentChunk = 0;
 	}
-	
+
 	if(dev->checkpointCurrentBlock < 0)
 		return 0;
-	
+
 	tags.chunkDeleted = 0;
 	tags.objectId = dev->checkpointNextBlock; /* Hint to next place to look */
 	tags.chunkId = dev->checkpointPageSequence + 1;
@@ -221,25 +221,25 @@
 		bi->blockState = YAFFS_BLOCK_STATE_CHECKPOINT;
 		dev->blocksInCheckpoint++;
 	}
-	
+
 	chunk = dev->checkpointCurrentBlock * dev->nChunksPerBlock + dev->checkpointCurrentChunk;
 
-	
+
 	T(YAFFS_TRACE_CHECKPOINT,(TSTR("checkpoint wite buffer nand %d(%d:%d) objid %d chId %d" TENDSTR),
-		chunk, dev->checkpointCurrentBlock, dev->checkpointCurrentChunk,tags.objectId,tags.chunkId)); 
-	
+		chunk, dev->checkpointCurrentBlock, dev->checkpointCurrentChunk,tags.objectId,tags.chunkId));
+
 	realignedChunk = chunk - dev->chunkOffset;
-	
+
 	dev->writeChunkWithTagsToNAND(dev,realignedChunk,dev->checkpointBuffer,&tags);
 	dev->checkpointByteOffset = 0;
-	dev->checkpointPageSequence++;	   
+	dev->checkpointPageSequence++;
 	dev->checkpointCurrentChunk++;
 	if(dev->checkpointCurrentChunk >= dev->nChunksPerBlock){
 		dev->checkpointCurrentChunk = 0;
 		dev->checkpointCurrentBlock = -1;
 	}
 	memset(dev->checkpointBuffer,0,dev->nDataBytesPerChunk);
-	
+
 	return 1;
 }
 
@@ -249,37 +249,37 @@
 	int i=0;
 	int ok = 1;
 
-	
+
 	__u8 * dataBytes = (__u8 *)data;
-	
-	
+
+
 
 	if(!dev->checkpointBuffer)
 		return 0;
-		
+
 	if(!dev->checkpointOpenForWrite)
 		return -1;
 
 	while(i < nBytes && ok) {
-		
 
-		
+
+
 		dev->checkpointBuffer[dev->checkpointByteOffset] = *dataBytes ;
 		dev->checkpointSum += *dataBytes;
 		dev->checkpointXor ^= *dataBytes;
-		 
+
 		dev->checkpointByteOffset++;
 		i++;
 		dataBytes++;
 		dev->checkpointByteCount++;
-		
-		
+
+
 		if(dev->checkpointByteOffset < 0 ||
-		   dev->checkpointByteOffset >= dev->nDataBytesPerChunk) 
+		   dev->checkpointByteOffset >= dev->nDataBytesPerChunk)
 			ok = yaffs_CheckpointFlushBuffer(dev);
 
 	}
-	
+
 	return 	i;
 }
 
@@ -289,12 +289,12 @@
 	int ok = 1;
 	yaffs_ExtendedTags tags;
 
-	
+
 	int chunk;
 	int realignedChunk;
 
 	__u8 *dataBytes = (__u8 *)data;
-		
+
 	if(!dev->checkpointBuffer)
 		return 0;
 
@@ -302,31 +302,31 @@
 		return -1;
 
 	while(i < nBytes && ok) {
-	
-	
+
+
 		if(dev->checkpointByteOffset < 0 ||
 		   dev->checkpointByteOffset >= dev->nDataBytesPerChunk) {
-		   
+
 		   	if(dev->checkpointCurrentBlock < 0){
 				yaffs_CheckpointFindNextCheckpointBlock(dev);
 				dev->checkpointCurrentChunk = 0;
 			}
-			
+
 			if(dev->checkpointCurrentBlock < 0)
 				ok = 0;
 			else {
-			
-				chunk = dev->checkpointCurrentBlock * dev->nChunksPerBlock + 
+
+				chunk = dev->checkpointCurrentBlock * dev->nChunksPerBlock +
 				          dev->checkpointCurrentChunk;
 
 				realignedChunk = chunk - dev->chunkOffset;
 
 	   			/* read in the next chunk */
 	   			/* printf("read checkpoint page %d\n",dev->checkpointPage); */
-				dev->readChunkWithTagsFromNAND(dev, realignedChunk, 
+				dev->readChunkWithTagsFromNAND(dev, realignedChunk,
 							       dev->checkpointBuffer,
 							      &tags);
-						      
+
 				if(tags.chunkId != (dev->checkpointPageSequence + 1) ||
 				   tags.sequenceNumber != YAFFS_SEQUENCE_CHECKPOINT_DATA)
 				   ok = 0;
@@ -334,12 +334,12 @@
 				dev->checkpointByteOffset = 0;
 				dev->checkpointPageSequence++;
 				dev->checkpointCurrentChunk++;
-			
+
 				if(dev->checkpointCurrentChunk >= dev->nChunksPerBlock)
 					dev->checkpointCurrentBlock = -1;
 			}
 		}
-		
+
 		if(ok){
 			*dataBytes = dev->checkpointBuffer[dev->checkpointByteOffset];
 			dev->checkpointSum += *dataBytes;
@@ -350,14 +350,14 @@
 			dev->checkpointByteCount++;
 		}
 	}
-	
+
 	return 	i;
 }
 
 int yaffs_CheckpointClose(yaffs_Device *dev)
 {
 
-	if(dev->checkpointOpenForWrite){	
+	if(dev->checkpointOpenForWrite){
 		if(dev->checkpointByteOffset != 0)
 			yaffs_CheckpointFlushBuffer(dev);
 	} else {
@@ -377,19 +377,19 @@
 	dev->nFreeChunks -= dev->blocksInCheckpoint * dev->nChunksPerBlock;
 	dev->nErasedBlocks -= dev->blocksInCheckpoint;
 
-		
+
 	T(YAFFS_TRACE_CHECKPOINT,(TSTR("checkpoint byte count %d" TENDSTR),
 			dev->checkpointByteCount));
-			
+
 	if(dev->checkpointBuffer){
-		/* free the buffer */	
+		/* free the buffer */
 		YFREE(dev->checkpointBuffer);
 		dev->checkpointBuffer = NULL;
 		return 1;
 	}
 	else
 		return 0;
-	
+
 }
 
 int yaffs_CheckpointInvalidateStream(yaffs_Device *dev)
diff --git a/fs/yaffs2/yaffs_checkptrw.h b/fs/yaffs2/yaffs_checkptrw.h
index f4b0c7d..e59d151 100644
--- a/fs/yaffs2/yaffs_checkptrw.h
+++ b/fs/yaffs2/yaffs_checkptrw.h
@@ -1,5 +1,5 @@
 /*
- * YAFFS: Yet another Flash File System . A NAND-flash specific file system. 
+ * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
  *
  * Copyright (C) 2002-2007 Aleph One Ltd.
  *   for Toby Churchill Ltd and Brightstar Engineering
@@ -32,4 +32,3 @@
 
 
 #endif
-
diff --git a/fs/yaffs2/yaffs_ecc.c b/fs/yaffs2/yaffs_ecc.c
index a05a6b5..1b4a05d 100644
--- a/fs/yaffs2/yaffs_ecc.c
+++ b/fs/yaffs2/yaffs_ecc.c
@@ -14,9 +14,9 @@
 /*
  * This code implements the ECC algorithm used in SmartMedia.
  *
- * The ECC comprises 22 bits of parity information and is stuffed into 3 bytes. 
+ * The ECC comprises 22 bits of parity information and is stuffed into 3 bytes.
  * The two unused bit are set to 1.
- * The ECC can correct single bit errors in a 256-byte page of data. Thus, two such ECC 
+ * The ECC can correct single bit errors in a 256-byte page of data. Thus, two such ECC
  * blocks are used on a 512-byte NAND page.
  *
  */
@@ -231,8 +231,8 @@
 		return 1; /* Corrected the error */
 	}
 
-	if ((yaffs_CountBits(d0) + 
-	     yaffs_CountBits(d1) + 
+	if ((yaffs_CountBits(d0) +
+	     yaffs_CountBits(d1) +
 	     yaffs_CountBits(d2)) ==  1) {
 		/* Reccoverable error in ecc */
 
@@ -242,7 +242,7 @@
 
 		return 1; /* Corrected the error */
 	}
-	
+
 	/* Unrecoverable error */
 
 	return -1;
@@ -296,7 +296,7 @@
 	if ((cDelta | lDelta | lDeltaPrime) == 0)
 		return 0; /* no error */
 
-	if (lDelta == ~lDeltaPrime && 
+	if (lDelta == ~lDeltaPrime &&
 	    (((cDelta ^ (cDelta >> 1)) & 0x15) == 0x15))
 	{
 		/* Single bit (recoverable) error in data */
@@ -312,7 +312,7 @@
 
 		if(lDelta >= nBytes)
 			return -1;
-			
+
 		data[lDelta] ^= (1 << bit);
 
 		return 1; /* corrected */
diff --git a/fs/yaffs2/yaffs_ecc.h b/fs/yaffs2/yaffs_ecc.h
index 40fd02b..79bc3d1 100644
--- a/fs/yaffs2/yaffs_ecc.h
+++ b/fs/yaffs2/yaffs_ecc.h
@@ -1,5 +1,5 @@
 /*
- * YAFFS: Yet another Flash File System . A NAND-flash specific file system. 
+ * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
  *
  * Copyright (C) 2002-2007 Aleph One Ltd.
  *   for Toby Churchill Ltd and Brightstar Engineering
@@ -16,9 +16,9 @@
  /*
   * This code implements the ECC algorithm used in SmartMedia.
   *
-  * The ECC comprises 22 bits of parity information and is stuffed into 3 bytes. 
+  * The ECC comprises 22 bits of parity information and is stuffed into 3 bytes.
   * The two unused bit are set to 1.
-  * The ECC can correct single bit errors in a 256-byte page of data. Thus, two such ECC 
+  * The ECC can correct single bit errors in a 256-byte page of data. Thus, two such ECC
   * blocks are used on a 512-byte NAND page.
   *
   */
diff --git a/fs/yaffs2/yaffs_flashif.h b/fs/yaffs2/yaffs_flashif.h
index f7f4e42..4e5157e 100644
--- a/fs/yaffs2/yaffs_flashif.h
+++ b/fs/yaffs2/yaffs_flashif.h
@@ -1,5 +1,5 @@
 /*
- * YAFFS: Yet another Flash File System . A NAND-flash specific file system. 
+ * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
  *
  * Copyright (C) 2002-2007 Aleph One Ltd.
  *   for Toby Churchill Ltd and Brightstar Engineering
diff --git a/fs/yaffs2/yaffs_guts.c b/fs/yaffs2/yaffs_guts.c
index 7dc62ef..b368844 100644
--- a/fs/yaffs2/yaffs_guts.c
+++ b/fs/yaffs2/yaffs_guts.c
@@ -146,71 +146,71 @@
 		YBUG();
 }
 
-/* Function to return the number of shifts for a power of 2 greater than or equal 
+/* Function to return the number of shifts for a power of 2 greater than or equal
  * to the given number
  * Note we don't try to cater for all possible numbers and this does not have to
  * be hellishly efficient.
  */
- 
+
 static __u32 ShiftsGE(__u32 x)
 {
 	int extraBits;
 	int nShifts;
-	
+
 	nShifts = extraBits = 0;
-	
+
 	while(x>1){
 		if(x & 1) extraBits++;
 		x>>=1;
 		nShifts++;
 	}
 
-	if(extraBits) 
+	if(extraBits)
 		nShifts++;
-		
+
 	return nShifts;
 }
 
 /* Function to return the number of shifts to get a 1 in bit 0
  */
- 
+
 static __u32 ShiftDiv(__u32 x)
 {
 	int nShifts;
-	
+
 	nShifts =  0;
-	
+
 	if(!x) return 0;
-	
+
 	while( !(x&1)){
 		x>>=1;
 		nShifts++;
 	}
-		
+
 	return nShifts;
 }
 
 
 
-/* 
+/*
  * Temporary buffer manipulations.
  */
 
-static int yaffs_InitialiseTempBuffers(yaffs_Device *dev)	
+static int yaffs_InitialiseTempBuffers(yaffs_Device *dev)
 {
 	int i;
 	__u8 *buf = (__u8 *)1;
-		
+
 	memset(dev->tempBuffer,0,sizeof(dev->tempBuffer));
-		
+
 	for (i = 0; buf && i < YAFFS_N_TEMP_BUFFERS; i++) {
 		dev->tempBuffer[i].line = 0;	/* not in use */
 		dev->tempBuffer[i].buffer = buf =
 		    YMALLOC_DMA(dev->nDataBytesPerChunk);
 	}
-		
+
 	return buf ? YAFFS_OK : YAFFS_FAIL;
-	
+
 }
 
 static __u8 *yaffs_GetTempBuffer(yaffs_Device * dev, int lineNo)
@@ -283,8 +283,8 @@
 	}
 
     for (i = 0; i < dev->nShortOpCaches; i++) {
-        if( dev->srCache[i].data == buffer )
-            return 1;
+	if( dev->srCache[i].data == buffer )
+	    return 1;
 
     }
 
@@ -343,7 +343,7 @@
 static Y_INLINE void yaffs_SetChunkBit(yaffs_Device * dev, int blk, int chunk)
 {
 	__u8 *blkBits = yaffs_BlockBits(dev, blk);
-	
+
 	yaffs_VerifyChunkBitId(dev,blk,chunk);
 
 	blkBits[chunk / 8] |= (1 << (chunk & 7));
@@ -381,16 +381,16 @@
 				n++;
 			x >>=1;
 		}
-			
+
 		blkBits++;
 	}
 	return n;
 }
 
-/* 
+/*
  * Verification code
  */
- 
+
 static int yaffs_SkipVerification(yaffs_Device *dev)
 {
 	return !(yaffs_traceMask & (YAFFS_TRACE_VERIFY | YAFFS_TRACE_VERIFY_FULL));
@@ -423,14 +423,14 @@
 {
 	int actuallyUsed;
 	int inUse;
-	
+
 	if(yaffs_SkipVerification(dev))
 		return;
-		
+
 	/* Report illegal runtime states */
 	if(bi->blockState <0 || bi->blockState >= YAFFS_NUMBER_OF_BLOCK_STATES)
 		T(YAFFS_TRACE_VERIFY,(TSTR("Block %d has undefined state %d"TENDSTR),n,bi->blockState));
-		
+
 	switch(bi->blockState){
 	 case YAFFS_BLOCK_STATE_UNKNOWN:
 	 case YAFFS_BLOCK_STATE_SCANNING:
@@ -438,42 +438,42 @@
 		T(YAFFS_TRACE_VERIFY,(TSTR("Block %d has bad run-state %s"TENDSTR),
 		n,blockStateName[bi->blockState]));
 	}
-	
+
 	/* Check pages in use and soft deletions are legal */
-	
+
 	actuallyUsed = bi->pagesInUse - bi->softDeletions;
-	
+
 	if(bi->pagesInUse < 0 || bi->pagesInUse > dev->nChunksPerBlock ||
 	   bi->softDeletions < 0 || bi->softDeletions > dev->nChunksPerBlock ||
 	   actuallyUsed < 0 || actuallyUsed > dev->nChunksPerBlock)
 		T(YAFFS_TRACE_VERIFY,(TSTR("Block %d has illegal values pagesInUsed %d softDeletions %d"TENDSTR),
 		n,bi->pagesInUse,bi->softDeletions));
-	
-		
+
+
 	/* Check chunk bitmap legal */
 	inUse = yaffs_CountChunkBits(dev,n);
 	if(inUse != bi->pagesInUse)
 		T(YAFFS_TRACE_VERIFY,(TSTR("Block %d has inconsistent values pagesInUse %d counted chunk bits %d"TENDSTR),
 			n,bi->pagesInUse,inUse));
-	
+
 	/* Check that the sequence number is valid.
-	 * Ten million is legal, but is very unlikely 
+	 * Ten million is legal, but is very unlikely
 	 */
-	if(dev->isYaffs2 && 
+	if(dev->isYaffs2 &&
 	   (bi->blockState == YAFFS_BLOCK_STATE_ALLOCATING || bi->blockState == YAFFS_BLOCK_STATE_FULL) &&
 	   (bi->sequenceNumber < YAFFS_LOWEST_SEQUENCE_NUMBER || bi->sequenceNumber > 10000000 ))
 		T(YAFFS_TRACE_VERIFY,(TSTR("Block %d has suspect sequence number of %d"TENDSTR),
 		n,bi->sequenceNumber));
-		
+
 }
 
 static void yaffs_VerifyCollectedBlock(yaffs_Device *dev,yaffs_BlockInfo *bi,int n)
 {
 	yaffs_VerifyBlock(dev,bi,n);
-	
+
 	/* After collection the block should be in the erased state */
 	/* TODO: This will need to change if we do partial gc */
-	
+
 	if(bi->blockState != YAFFS_BLOCK_STATE_EMPTY){
 		T(YAFFS_TRACE_ERROR,(TSTR("Block %d is in state %d after gc, should be erased"TENDSTR),
 			n,bi->blockState));
@@ -485,14 +485,14 @@
 	int i;
 	int nBlocksPerState[YAFFS_NUMBER_OF_BLOCK_STATES];
 	int nIllegalBlockStates = 0;
-	
+
 
 	if(yaffs_SkipVerification(dev))
 		return;
 
 	memset(nBlocksPerState,0,sizeof(nBlocksPerState));
 
-		
+
 	for(i = dev->internalStartBlock; i <= dev->internalEndBlock; i++){
 		yaffs_BlockInfo *bi = yaffs_GetBlockInfo(dev,i);
 		yaffs_VerifyBlock(dev,bi,i);
@@ -501,12 +501,12 @@
 			nBlocksPerState[bi->blockState]++;
 		else
 			nIllegalBlockStates++;
-					
+
 	}
-	
+
 	T(YAFFS_TRACE_VERIFY,(TSTR(""TENDSTR)));
 	T(YAFFS_TRACE_VERIFY,(TSTR("Block summary"TENDSTR)));
-	
+
 	T(YAFFS_TRACE_VERIFY,(TSTR("%d blocks have illegal states"TENDSTR),nIllegalBlockStates));
 	if(nBlocksPerState[YAFFS_BLOCK_STATE_ALLOCATING] > 1)
 		T(YAFFS_TRACE_VERIFY,(TSTR("Too many allocating blocks"TENDSTR)));
@@ -515,17 +515,17 @@
 		T(YAFFS_TRACE_VERIFY,
 		  (TSTR("%s %d blocks"TENDSTR),
 		  blockStateName[i],nBlocksPerState[i]));
-	
+
 	if(dev->blocksInCheckpoint != nBlocksPerState[YAFFS_BLOCK_STATE_CHECKPOINT])
 		T(YAFFS_TRACE_VERIFY,
 		 (TSTR("Checkpoint block count wrong dev %d count %d"TENDSTR),
 		 dev->blocksInCheckpoint, nBlocksPerState[YAFFS_BLOCK_STATE_CHECKPOINT]));
-		 
+
 	if(dev->nErasedBlocks != nBlocksPerState[YAFFS_BLOCK_STATE_EMPTY])
 		T(YAFFS_TRACE_VERIFY,
 		 (TSTR("Erased block count wrong dev %d count %d"TENDSTR),
 		 dev->nErasedBlocks, nBlocksPerState[YAFFS_BLOCK_STATE_EMPTY]));
-		 
+
 	if(nBlocksPerState[YAFFS_BLOCK_STATE_COLLECTING] > 1)
 		T(YAFFS_TRACE_VERIFY,
 		 (TSTR("Too many collecting blocks %d (max is 1)"TENDSTR),
@@ -543,47 +543,47 @@
 {
 	if(yaffs_SkipVerification(obj->myDev))
 		return;
-		
+
 	if(!(tags && obj && oh)){
-	 	T(YAFFS_TRACE_VERIFY,
-		 		(TSTR("Verifying object header tags %x obj %x oh %x"TENDSTR),
-		 		(__u32)tags,(__u32)obj,(__u32)oh));
+		T(YAFFS_TRACE_VERIFY,
+				(TSTR("Verifying object header tags %x obj %x oh %x"TENDSTR),
+				(__u32)tags,(__u32)obj,(__u32)oh));
 		return;
 	}
-	
+
 	if(oh->type <= YAFFS_OBJECT_TYPE_UNKNOWN ||
 	   oh->type > YAFFS_OBJECT_TYPE_MAX)
-	 	T(YAFFS_TRACE_VERIFY,
+		T(YAFFS_TRACE_VERIFY,
 		 (TSTR("Obj %d header type is illegal value 0x%x"TENDSTR),
 		 tags->objectId, oh->type));
 
 	if(tags->objectId != obj->objectId)
-	 	T(YAFFS_TRACE_VERIFY,
+		T(YAFFS_TRACE_VERIFY,
 		 (TSTR("Obj %d header mismatch objectId %d"TENDSTR),
 		 tags->objectId, obj->objectId));
 
 
 	/*
 	 * Check that the object's parent ids match if parentCheck requested.
-	 * 
+	 *
 	 * Tests do not apply to the root object.
 	 */
-	
+
 	if(parentCheck && tags->objectId > 1 && !obj->parent)
-	 	T(YAFFS_TRACE_VERIFY,
+		T(YAFFS_TRACE_VERIFY,
 		 (TSTR("Obj %d header mismatch parentId %d obj->parent is NULL"TENDSTR),
-	 	 tags->objectId, oh->parentObjectId));
-		
-	
+		 tags->objectId, oh->parentObjectId));
+
+
 	if(parentCheck && obj->parent &&
-	   oh->parentObjectId != obj->parent->objectId && 
+	   oh->parentObjectId != obj->parent->objectId &&
 	   (oh->parentObjectId != YAFFS_OBJECTID_UNLINKED ||
 	    obj->parent->objectId != YAFFS_OBJECTID_DELETED))
-	 	T(YAFFS_TRACE_VERIFY,
+		T(YAFFS_TRACE_VERIFY,
 		 (TSTR("Obj %d header mismatch parentId %d parentObjectId %d"TENDSTR),
-	 	 tags->objectId, oh->parentObjectId, obj->parent->objectId));
-		
-	
+		 tags->objectId, oh->parentObjectId, obj->parent->objectId));
+
+
 	if(tags->objectId > 1 && oh->name[0] == 0) /* Null name */
 		T(YAFFS_TRACE_VERIFY,
 		(TSTR("Obj %d header name is NULL"TENDSTR),
@@ -598,7 +598,7 @@
 
 
 static int yaffs_VerifyTnodeWorker(yaffs_Object * obj, yaffs_Tnode * tn,
-				  	__u32 level, int chunkOffset)
+					__u32 level, int chunkOffset)
 {
 	int i;
 	yaffs_Device *dev = obj->myDev;
@@ -619,12 +619,12 @@
 			int i;
 			yaffs_ExtendedTags tags;
 			__u32 objectId = obj->objectId;
-			
+
 			chunkOffset <<=  YAFFS_TNODES_LEVEL0_BITS;
-			
+
 			for(i = 0; i < YAFFS_NTNODES_LEVEL0; i++){
 				__u32 theChunk = yaffs_GetChunkGroupBase(dev,tn,i);
-				
+
 				if(theChunk > 0){
 					/* T(~0,(TSTR("verifying (%d:%d) %d"TENDSTR),tags.objectId,tags.chunkId,theChunk)); */
 					yaffs_ReadChunkWithTagsFromNAND(dev,theChunk,NULL, &tags);
@@ -655,13 +655,13 @@
 	yaffs_ExtendedTags tags;
 	yaffs_Tnode *tn;
 	__u32 objectId;
-	
+
 	if(obj && yaffs_SkipVerification(obj->myDev))
 		return;
-	
+
 	dev = obj->myDev;
 	objectId = obj->objectId;
-	
+
 	/* Check file size is consistent with tnode depth */
 	lastChunk =  obj->variant.fileVariant.fileSize / dev->nDataBytesPerChunk + 1;
 	x = lastChunk >> YAFFS_TNODES_LEVEL0_BITS;
@@ -670,23 +670,23 @@
 		x >>= YAFFS_TNODES_INTERNAL_BITS;
 		requiredTallness++;
 	}
-	
+
 	actualTallness = obj->variant.fileVariant.topLevel;
-	
+
 	if(requiredTallness > actualTallness )
 		T(YAFFS_TRACE_VERIFY,
 		(TSTR("Obj %d had tnode tallness %d, needs to be %d"TENDSTR),
 		 obj->objectId,actualTallness, requiredTallness));
-	
-	
-	/* Check that the chunks in the tnode tree are all correct. 
+
+
+	/* Check that the chunks in the tnode tree are all correct.
 	 * We do this by scanning through the tnode tree and
 	 * checking the tags for every chunk match.
 	 */
 
 	if(yaffs_SkipNANDVerification(dev))
 		return;
-		
+
 	for(i = 1; i <= lastChunk; i++){
 		tn = yaffs_FindLevel0Tnode(dev, &obj->variant.fileVariant,i);
 
@@ -711,14 +711,14 @@
 {
 	if(obj && yaffs_SkipVerification(obj->myDev))
 		return;
-	
+
 }
 
 static void yaffs_VerifyHardLink(yaffs_Object *obj)
 {
 	if(obj && yaffs_SkipVerification(obj->myDev))
 		return;
-		
+
 	/* Verify sane equivalent object */
 }
 
@@ -726,7 +726,7 @@
 {
 	if(obj && yaffs_SkipVerification(obj->myDev))
 		return;
-		
+
 	/* Verify symlink string */
 }
 
@@ -739,32 +739,32 @@
 static void yaffs_VerifyObject(yaffs_Object *obj)
 {
 	yaffs_Device *dev;
-	
+
 	__u32 chunkMin;
 	__u32 chunkMax;
-	
+
 	__u32 chunkIdOk;
 	__u32 chunkIsLive;
-	
+
 	if(!obj)
 		return;
-	
+
 	dev = obj->myDev;
-	
+
 	if(yaffs_SkipVerification(dev))
 		return;
-		
+
 	/* Check sane object header chunk */
-	
+
 	chunkMin = dev->internalStartBlock * dev->nChunksPerBlock;
 	chunkMax = (dev->internalEndBlock+1) * dev->nChunksPerBlock - 1;
-	
+
 	chunkIdOk = (obj->chunkId >= chunkMin && obj->chunkId <= chunkMax);
-	chunkIsLive = chunkIdOk && 
-			yaffs_CheckChunkBit(dev, 
+	chunkIsLive = chunkIdOk &&
+			yaffs_CheckChunkBit(dev,
 					    obj->chunkId / dev->nChunksPerBlock,
 					    obj->chunkId % dev->nChunksPerBlock);
-	if(!obj->fake && 
+	if(!obj->fake &&
 	    (!chunkIdOk || !chunkIsLive)) {
 	   T(YAFFS_TRACE_VERIFY,
 	   (TSTR("Obj %d has chunkId %d %s %s"TENDSTR),
@@ -772,36 +772,36 @@
 	   chunkIdOk ? "" : ",out of range",
 	   chunkIsLive || !chunkIdOk ? "" : ",marked as deleted"));
 	}
-	
+
 	if(chunkIdOk && chunkIsLive &&!yaffs_SkipNANDVerification(dev)) {
 		yaffs_ExtendedTags tags;
 		yaffs_ObjectHeader *oh;
 		__u8 *buffer = yaffs_GetTempBuffer(dev,__LINE__);
-		
+
 		oh = (yaffs_ObjectHeader *)buffer;
-		
+
 		yaffs_ReadChunkWithTagsFromNAND(dev, obj->chunkId,buffer, &tags);
-		
+
 		yaffs_VerifyObjectHeader(obj,oh,&tags,1);
-		
+
 		yaffs_ReleaseTempBuffer(dev,buffer,__LINE__);
 	}
-	
+
 	/* Verify it has a parent */
 	if(obj && !obj->fake &&
 	   (!obj->parent || obj->parent->myDev != dev)){
 	   T(YAFFS_TRACE_VERIFY,
 	   (TSTR("Obj %d has parent pointer %p which does not look like an object"TENDSTR),
-	   obj->objectId,obj->parent));	   
+	   obj->objectId,obj->parent));
 	}
-	
+
 	/* Verify parent is a directory */
 	if(obj->parent && obj->parent->variantType != YAFFS_OBJECT_TYPE_DIRECTORY){
 	   T(YAFFS_TRACE_VERIFY,
 	   (TSTR("Obj %d's parent is not a directory (type %d)"TENDSTR),
-	   obj->objectId,obj->parent->variantType));	   
+	   obj->objectId,obj->parent->variantType));
 	}
-	
+
 	switch(obj->variantType){
 	case YAFFS_OBJECT_TYPE_FILE:
 		yaffs_VerifyFile(obj);
@@ -822,11 +822,11 @@
 	default:
 		T(YAFFS_TRACE_VERIFY,
 		(TSTR("Obj %d has illegaltype %d"TENDSTR),
-		obj->objectId,obj->variantType));	   
+		obj->objectId,obj->variantType));
 		break;
 	}
-	
-	
+
+
 }
 
 static void yaffs_VerifyObjects(yaffs_Device *dev)
@@ -837,11 +837,11 @@
 
 	if(yaffs_SkipVerification(dev))
 		return;
-	
+
 	/* Iterate through the objects in each hash entry */
-	 
+
 	 for(i = 0; i <  YAFFS_NOBJECT_BUCKETS; i++){
-	 	list_for_each(lh, &dev->objectBucket[i].list) {
+		list_for_each(lh, &dev->objectBucket[i].list) {
 			if (lh) {
 				obj = list_entry(lh, yaffs_Object, hashLink);
 				yaffs_VerifyObject(obj);
@@ -855,7 +855,7 @@
 /*
  *  Simple hash function. Needs to have a reasonable spread
  */
- 
+
 static Y_INLINE int yaffs_HashFunction(int n)
 {
 /* XXX U-BOOT XXX */
@@ -868,7 +868,7 @@
 /*
  * Access functions to useful fake objects
  */
- 
+
 yaffs_Object *yaffs_Root(yaffs_Device * dev)
 {
 	return dev->rootDir;
@@ -883,7 +883,7 @@
 /*
  *  Erased NAND checking functions
  */
- 
+
 int yaffs_CheckFF(__u8 * buffer, int nBytes)
 {
 	/* Horrible, slow implementation */
@@ -905,10 +905,10 @@
 	int result;
 
 	result = yaffs_ReadChunkWithTagsFromNAND(dev, chunkInNAND, data, &tags);
-	
+
 	if(tags.eccResult > YAFFS_ECC_RESULT_NO_ERROR)
 		retval = YAFFS_FAIL;
-		
+
 
 	if (!yaffs_CheckFF(data, dev->nDataBytesPerChunk) || tags.chunkUsed) {
 		T(YAFFS_TRACE_NANDACCESS,
@@ -998,9 +998,9 @@
 		/* Copy the data into the robustification buffer */
 		yaffs_HandleWriteChunkOk(dev, chunk, data, tags);
 
+	} while (writeOk != YAFFS_OK &&
+		(yaffs_wr_attempts <= 0 || attempts <= yaffs_wr_attempts));
+
-	} while (writeOk != YAFFS_OK && 
-	        (yaffs_wr_attempts <= 0 || attempts <= yaffs_wr_attempts));
-	
 	if(!writeOk)
 		chunk = -1;
 
@@ -1018,13 +1018,13 @@
 /*
  * Block retiring for handling a broken block.
  */
- 
+
 static void yaffs_RetireBlock(yaffs_Device * dev, int blockInNAND)
 {
 	yaffs_BlockInfo *bi = yaffs_GetBlockInfo(dev, blockInNAND);
 
 	yaffs_InvalidateCheckpoint(dev);
-	
+
 	yaffs_MarkBlockBad(dev, blockInNAND);
 
 	bi->blockState = YAFFS_BLOCK_STATE_DEAD;
@@ -1038,7 +1038,7 @@
  * Functions for robustisizing TODO
  *
  */
- 
+
 static void yaffs_HandleWriteChunkOk(yaffs_Device * dev, int chunkInNAND,
 				     const __u8 * data,
 				     const yaffs_ExtendedTags * tags)
@@ -1056,13 +1056,13 @@
 		bi->gcPrioritise = 1;
 		dev->hasPendingPrioritisedGCs = 1;
 		bi->chunkErrorStrikes ++;
-		
+
 		if(bi->chunkErrorStrikes > 3){
 			bi->needsRetiring = 1; /* Too many stikes, so retire this */
 			T(YAFFS_TRACE_ALWAYS, (TSTR("yaffs: Block struck out" TENDSTR)));
 
 		}
-		
+
 	}
 }
 
@@ -1073,23 +1073,23 @@
 	yaffs_BlockInfo *bi = yaffs_GetBlockInfo(dev, blockInNAND);
 
 	yaffs_HandleChunkError(dev,bi);
-		
-	
+
+
 	if(erasedOk ) {
 		/* Was an actual write failure, so mark the block for retirement  */
 		bi->needsRetiring = 1;
 		T(YAFFS_TRACE_ERROR | YAFFS_TRACE_BAD_BLOCKS,
 		  (TSTR("**>> Block %d needs retiring" TENDSTR), blockInNAND));
 
+
-		
 	}
-	
+
 	/* Delete the chunk */
 	yaffs_DeleteChunk(dev, chunkInNAND, 1, __LINE__);
 }
 
 
-/*---------------- Name handling functions ------------*/ 
+/*---------------- Name handling functions ------------*/
 
 static __u16 yaffs_CalcNameSum(const YCHAR * name)
 {
@@ -1130,7 +1130,7 @@
  * The list is hooked together using the first pointer
  * in the tnode.
  */
- 
+
 /* yaffs_CreateTnodes creates a bunch more tnodes and
  * adds them to the tnode free list.
  * Don't use this function directly
@@ -1148,7 +1148,7 @@
 
 	if (nTnodes < 1)
 		return YAFFS_OK;
-		
+
 	/* Calculate the tnode size in bytes for variable width tnode support.
 	 * Must be a multiple of 32-bits  */
 	tnodeSize = (dev->tnodeWidth * YAFFS_NTNODES_LEVEL0)/8;
@@ -1185,7 +1185,7 @@
 		next = (yaffs_Tnode *) &mem[(i+1) * tnodeSize];
 		curr->internal[0] = next;
 	}
-	
+
 	curr = (yaffs_Tnode *) &mem[(nTnodes - 1) * tnodeSize];
 	curr->internal[0] = dev->freeTnodes;
 	dev->freeTnodes = (yaffs_Tnode *)mem;
@@ -1200,7 +1200,7 @@
 	 * NB If we can't add this to the management list it isn't fatal
 	 * but it just means we can't free this bunch of tnodes later.
 	 */
-	 
+
 	tnl = YMALLOC(sizeof(yaffs_TnodeList));
 	if (!tnl) {
 		T(YAFFS_TRACE_ERROR,
@@ -1249,11 +1249,11 @@
 static yaffs_Tnode *yaffs_GetTnode(yaffs_Device * dev)
 {
 	yaffs_Tnode *tn = yaffs_GetTnodeRaw(dev);
-	
+
 	if(tn)
 		memset(tn, 0, (dev->tnodeWidth * YAFFS_NTNODES_LEVEL0)/8);
 
-	return tn;	
+	return tn;
 }
 
 /* FreeTnode frees up a tnode and puts it back on the free list */
@@ -1309,19 +1309,19 @@
   __u32 bitInWord;
   __u32 wordInMap;
   __u32 mask;
-  
+
   pos &= YAFFS_TNODES_LEVEL0_MASK;
   val >>= dev->chunkGroupBits;
-  
+
   bitInMap = pos * dev->tnodeWidth;
   wordInMap = bitInMap /32;
   bitInWord = bitInMap & (32 -1);
-  
+
   mask = dev->tnodeMask << bitInWord;
-  
+
   map[wordInMap] &= ~mask;
   map[wordInMap] |= (mask & (val << bitInWord));
-  
+
   if(dev->tnodeWidth > (32-bitInWord)) {
     bitInWord = (32 - bitInWord);
     wordInMap++;;
@@ -1338,24 +1338,24 @@
   __u32 bitInWord;
   __u32 wordInMap;
   __u32 val;
-  
+
   pos &= YAFFS_TNODES_LEVEL0_MASK;
-  
+
   bitInMap = pos * dev->tnodeWidth;
   wordInMap = bitInMap /32;
   bitInWord = bitInMap & (32 -1);
-  
+
   val = map[wordInMap] >> bitInWord;
-  
+
   if(dev->tnodeWidth > (32-bitInWord)) {
     bitInWord = (32 - bitInWord);
     wordInMap++;;
     val |= (map[wordInMap] << bitInWord);
   }
-  
+
   val &= dev->tnodeMask;
   val <<= dev->chunkGroupBits;
-  
+
   return val;
 }
 
@@ -1404,9 +1404,9 @@
 	while (level > 0 && tn) {
 		tn = tn->
 		    internal[(chunkId >>
-			       ( YAFFS_TNODES_LEVEL0_BITS + 
-			         (level - 1) *
-			         YAFFS_TNODES_INTERNAL_BITS)
+			       ( YAFFS_TNODES_LEVEL0_BITS +
+				 (level - 1) *
+				 YAFFS_TNODES_INTERNAL_BITS)
 			      ) &
 			     YAFFS_TNODES_INTERNAL_MASK];
 		level--;
@@ -1426,7 +1426,7 @@
  *  If the tn argument is NULL, then a fresh tnode will be added otherwise the specified tn will
  *  be plugged into the ttree.
  */
- 
+
 static yaffs_Tnode *yaffs_AddOrFindLevel0Tnode(yaffs_Device * dev,
 					       yaffs_FileStructure * fStruct,
 					       __u32 chunkId,
@@ -1463,7 +1463,7 @@
 	if (requiredTallness > fStruct->topLevel) {
 		/* Not tall enough,gotta make the tree taller */
 		for (i = fStruct->topLevel; i < requiredTallness; i++) {
-		
+
 			tn = yaffs_GetTnode(dev);
 
 			if (tn) {
@@ -1482,7 +1482,7 @@
 
 	l = fStruct->topLevel;
 	tn = fStruct->top;
-	
+
 	if(l > 0) {
 		while (l > 0 && tn) {
 			x = (chunkId >>
@@ -1497,18 +1497,18 @@
 
 			} else if(l == 1) {
 				/* Looking from level 1 at level 0 */
-			 	if (passedTn) {
+				if (passedTn) {
 					/* If we already have one, then release it.*/
 					if(tn->internal[x])
 						yaffs_FreeTnode(dev,tn->internal[x]);
 					tn->internal[x] = passedTn;
-			
+
 				} else if(!tn->internal[x]) {
 					/* Don't have one, none passed in */
 					tn->internal[x] = yaffs_GetTnode(dev);
 				}
 			}
-		
+
 			tn = tn->internal[x];
 			l--;
 		}
@@ -1549,7 +1549,7 @@
 
 /* DeleteWorker scans backwards through the tnode tree and deletes all the
  * chunks and tnodes in the file
- * Returns 1 if the tree was deleted. 
+ * Returns 1 if the tree was deleted.
  * Returns 0 if it stopped early due to hitting the limit and the delete is incomplete.
  */
 
@@ -1602,7 +1602,7 @@
 
 			for (i = YAFFS_NTNODES_LEVEL0 - 1; i >= 0 && !hitLimit;
 			     i--) {
-			        theChunk = yaffs_GetChunkGroupBase(dev,tn,i);
+				theChunk = yaffs_GetChunkGroupBase(dev,tn,i);
 				if (theChunk) {
 
 					chunkInInode =
@@ -1663,7 +1663,7 @@
  * of the tnode.
  * Thus, essentially this is the same as DeleteWorker except that the chunks are soft deleted.
  */
- 
+
 static int yaffs_SoftDeleteWorker(yaffs_Object * in, yaffs_Tnode * tn,
 				  __u32 level, int chunkOffset)
 {
@@ -1704,7 +1704,7 @@
 				theChunk = yaffs_GetChunkGroupBase(dev,tn,i);
 				if (theChunk) {
 					/* Note this does not find the real chunk, only the chunk group.
-					 * We make an assumption that a chunk group is not larger than 
+					 * We make an assumption that a chunk group is not larger than
 					 * a block.
 					 */
 					yaffs_SoftDeleteChunk(dev, theChunk);
@@ -1806,7 +1806,7 @@
 		/* Now we have a tree with all the non-zero branches NULL but the height
 		 * is the same as it was.
 		 * Let's see if we can trim internal tnodes to shorten the tree.
-		 * We can do this if only the 0th element in the tnode is in use 
+		 * We can do this if only the 0th element in the tnode is in use
 		 * (ie all the non-zero are NULL)
 		 */
 
@@ -1860,7 +1860,7 @@
 		  (TSTR("yaffs: Could not allocate more objects" TENDSTR)));
 		return YAFFS_FAIL;
 	}
-	
+
 	/* Hook them into the free list */
 	for (i = 0; i < nObjects - 1; i++) {
 		newObjects[i].siblings.next =
@@ -2149,7 +2149,7 @@
 	theObject = yaffs_AllocateEmptyObject(dev);
 	if(!theObject)
 		return NULL;
-		
+
 	if(type == YAFFS_OBJECT_TYPE_FILE){
 		tn = yaffs_GetTnode(dev);
 		if(!tn){
@@ -2157,8 +2157,8 @@
 			return NULL;
 		}
 	}
-		
-	
+
+
 
 	if (theObject) {
 		theObject->fake = 0;
@@ -2222,7 +2222,7 @@
 	return theObject;
 
 }
-			
+
 
 static YCHAR *yaffs_CloneString(const YCHAR * str)
 {
@@ -2244,7 +2244,7 @@
  * aliasString only has meaning for a sumlink.
  * rdev only has meaning for devices (a subset of special objects)
  */
- 
+
 static yaffs_Object *yaffs_MknodObject(yaffs_ObjectType type,
 				       yaffs_Object * parent,
 				       const YCHAR * name,
@@ -2265,7 +2265,7 @@
 	}
 
 	in = yaffs_CreateNewObject(dev, -1, type);
-	
+
 	if(type == YAFFS_OBJECT_TYPE_SYMLINK){
 		str = yaffs_CloneString(aliasString);
 		if(!str){
@@ -2273,8 +2273,8 @@
 			return NULL;
 		}
 	}
-	
-	
+
+
 
 	if (in) {
 		in->chunkId = -1;
@@ -2315,7 +2315,7 @@
 			    equivalentObject->objectId;
 			list_add(&in->hardLinks, &equivalentObject->hardLinks);
 			break;
-		case YAFFS_OBJECT_TYPE_FILE:	
+		case YAFFS_OBJECT_TYPE_FILE:
 		case YAFFS_OBJECT_TYPE_DIRECTORY:
 		case YAFFS_OBJECT_TYPE_SPECIAL:
 		case YAFFS_OBJECT_TYPE_UNKNOWN:
@@ -2399,7 +2399,7 @@
 		    TENDSTR)));
 		YBUG();
 	}
-	
+
 	/* TODO: Do we need this different handling for YAFFS2 and YAFFS1?? */
 	if (obj->myDev->isYaffs2) {
 		unlinkOp = (newDir == obj->myDev->unlinkedDir);
@@ -2412,9 +2412,9 @@
 
 	existingTarget = yaffs_FindObjectByName(newDir, newName);
 
-	/* If the object is a file going into the unlinked directory, 
+	/* If the object is a file going into the unlinked directory,
 	 *   then it is OK to just stuff it in since duplicate names are allowed.
-	 *   else only proceed if the new name does not exist and if we're putting 
+	 *   else only proceed if the new name does not exist and if we're putting
 	 *   it into a directory.
 	 */
 	if ((unlinkOp ||
@@ -2478,7 +2478,7 @@
 			/* There is a target that is a non-empty directory, so we fail */
 			return YAFFS_FAIL;	/* EEXIST or ENOTEMPTY */
 		} else if (existingTarget && existingTarget != obj) {
-			/* Nuke the target first, using shadowing, 
+			/* Nuke the target first, using shadowing,
 			 * but only if it isn't the same object
 			 */
 			yaffs_ChangeObjectName(obj, newDir, newName, force,
@@ -2496,10 +2496,10 @@
 static int yaffs_InitialiseBlocks(yaffs_Device * dev)
 {
 	int nBlocks = dev->internalEndBlock - dev->internalStartBlock + 1;
-	
+
 	dev->blockInfo = NULL;
 	dev->chunkBits = NULL;
-	
+
 	dev->allocationBlock = -1;	/* force it to get a new one */
 
 	/* If the first allocation strategy fails, thry the alternate one */
@@ -2510,9 +2510,9 @@
 	}
 	else
 		dev->blockInfoAlt = 0;
-		
+
 	if(dev->blockInfo){
-	
+
 		/* Set up dynamic blockinfo stuff. */
 		dev->chunkBitmapStride = (dev->nChunksPerBlock + 7) / 8; /* round up bytes */
 		dev->chunkBits = YMALLOC(dev->chunkBitmapStride * nBlocks);
@@ -2523,7 +2523,7 @@
 		else
 			dev->chunkBitsAlt = 0;
 	}
-	
+
 	if (dev->blockInfo && dev->chunkBits) {
 		memset(dev->blockInfo, 0, nBlocks * sizeof(yaffs_BlockInfo));
 		memset(dev->chunkBits, 0, dev->chunkBitmapStride * nBlocks);
@@ -2544,7 +2544,7 @@
 	dev->blockInfoAlt = 0;
 
 	dev->blockInfo = NULL;
-	
+
 	if(dev->chunkBitsAlt && dev->chunkBits)
 		YFREE_ALT(dev->chunkBits);
 	else if(dev->chunkBits)
@@ -2608,14 +2608,14 @@
 	int prioritised=0;
 	yaffs_BlockInfo *bi;
 	int pendingPrioritisedExist = 0;
-	
+
 	/* First let's see if we need to grab a prioritised block */
 	if(dev->hasPendingPrioritisedGCs){
 		for(i = dev->internalStartBlock; i < dev->internalEndBlock && !prioritised; i++){
 
 			bi = yaffs_GetBlockInfo(dev, i);
 			//yaffs_VerifyBlock(dev,bi,i);
-			
+
 			if(bi->gcPrioritise) {
 				pendingPrioritisedExist = 1;
 				if(bi->blockState == YAFFS_BLOCK_STATE_FULL &&
@@ -2627,7 +2627,7 @@
 				}
 			}
 		}
-		
+
 		if(!pendingPrioritisedExist) /* None found, so we can clear this */
 			dev->hasPendingPrioritisedGCs = 0;
 	}
@@ -2646,7 +2646,7 @@
 
 	if(!prioritised)
 		pagesInUse =
-	    		(aggressive) ? dev->nChunksPerBlock : YAFFS_PASSIVE_GC_CHUNKS + 1;
+			(aggressive) ? dev->nChunksPerBlock : YAFFS_PASSIVE_GC_CHUNKS + 1;
 
 	if (aggressive) {
 		iterations =
@@ -2679,12 +2679,12 @@
 			dirtiest = b;
 			pagesInUse = 0;
 		}
-		else 
+		else
 #endif
 
 		if (bi->blockState == YAFFS_BLOCK_STATE_FULL &&
 		       (bi->pagesInUse - bi->softDeletions) < pagesInUse &&
-		        yaffs_BlockNotDisqualifiedFromGC(dev, bi)) {
+			yaffs_BlockNotDisqualifiedFromGC(dev, bi)) {
 			dirtiest = b;
 			pagesInUse = (bi->pagesInUse - bi->softDeletions);
 		}
@@ -2716,11 +2716,11 @@
 	/* If the block is still healthy erase it and mark as clean.
 	 * If the block has had a data failure, then retire it.
 	 */
-	 
+
 	T(YAFFS_TRACE_GC | YAFFS_TRACE_ERASE,
 		(TSTR("yaffs_BlockBecameDirty block %d state %d %s"TENDSTR),
 		blockNo, bi->blockState, (bi->needsRetiring) ? "needs retiring" : ""));
-		
+
 	bi->blockState = YAFFS_BLOCK_STATE_DIRTY;
 
 	if (!bi->needsRetiring) {
@@ -2733,7 +2733,7 @@
 		}
 	}
 
-	if (erasedOk && 
+	if (erasedOk &&
 	    ((yaffs_traceMask & YAFFS_TRACE_ERASE) || !yaffs_SkipVerification(dev))) {
 		int i;
 		for (i = 0; i < dev->nChunksPerBlock; i++) {
@@ -2784,7 +2784,7 @@
 
 		return -1;
 	}
-	
+
 	/* Find an empty block. */
 
 	for (i = dev->internalStartBlock; i <= dev->internalEndBlock; i++) {
@@ -2825,13 +2825,13 @@
 	int reservedChunks;
 	int reservedBlocks = dev->nReservedBlocks;
 	int checkpointBlocks;
-	
+
 	checkpointBlocks =  dev->nCheckpointReservedBlocks - dev->blocksInCheckpoint;
 	if(checkpointBlocks < 0)
 		checkpointBlocks = 0;
-	
+
 	reservedChunks = ((reservedBlocks + checkpointBlocks) * dev->nChunksPerBlock);
-	
+
 	return (dev->nFreeChunks > reservedChunks);
 }
 
@@ -2878,10 +2878,10 @@
 
 		if(blockUsedPtr)
 			*blockUsedPtr = bi;
-			
+
 		return retVal;
 	}
-	
+
 	T(YAFFS_TRACE_ERROR,
 	  (TSTR("!!!!!!!!! Allocator out !!!!!!!!!!!!!!!!!" TENDSTR)));
 
@@ -2924,7 +2924,7 @@
 	yaffs_Object *object;
 
 	isCheckpointBlock = (bi->blockState == YAFFS_BLOCK_STATE_CHECKPOINT);
-	
+
 	bi->blockState = YAFFS_BLOCK_STATE_COLLECTING;
 
 	T(YAFFS_TRACE_TRACING,
@@ -2952,7 +2952,7 @@
 	} else {
 
 		__u8 *buffer = yaffs_GetTempBuffer(dev, __LINE__);
-		
+
 		yaffs_VerifyBlock(dev,bi,block);
 
 		for (chunkInBlock = 0, oldChunk = block * dev->nChunksPerBlock;
@@ -2979,7 +2979,7 @@
 				   ("Collecting page %d, %d %d %d " TENDSTR),
 				   chunkInBlock, tags.objectId, tags.chunkId,
 				   tags.byteCount));
-				   
+
 				if(object && !yaffs_SkipVerification(dev)){
 					if(tags.chunkId == 0)
 						matchingChunk = object->chunkId;
@@ -2987,12 +2987,12 @@
 						matchingChunk = oldChunk; /* Defeat the test */
 					else
 						matchingChunk = yaffs_FindChunkInFile(object,tags.chunkId,NULL);
-					
+
 					if(oldChunk != matchingChunk)
 						T(YAFFS_TRACE_ERROR,
 						  (TSTR("gc: page in gc mismatch: %d %d %d %d"TENDSTR),
 						  oldChunk,matchingChunk,tags.objectId, tags.chunkId));
-						
+
 				}
 
 				if (!object) {
@@ -3007,7 +3007,7 @@
 				    && tags.chunkId != 0) {
 					/* Data chunk in a deleted file, throw it away
 					 * It's a soft deleted data chunk,
-					 * No need to copy this, just forget about it and 
+					 * No need to copy this, just forget about it and
 					 * fix up the object.
 					 */
 
@@ -3057,7 +3057,7 @@
 						oh->shadowsObject = -1;
 						tags.extraShadows = 0;
 						tags.extraIsShrinkHeader = 0;
-						
+
 						yaffs_VerifyObjectHeader(object,oh,&tags,1);
 					}
 
@@ -3116,7 +3116,7 @@
 	}
 
 	yaffs_VerifyCollectedBlock(dev,bi,block);
-	  
+
 	if (chunksBefore >= (chunksAfter = yaffs_GetErasedChunks(dev))) {
 		T(YAFFS_TRACE_GC,
 		  (TSTR
@@ -3144,21 +3144,21 @@
 	int aggressive;
 	int gcOk = YAFFS_OK;
 	int maxTries = 0;
-	
+
 	int checkpointBlockAdjust;
 
 	if (dev->isDoingGC) {
 		/* Bail out so we don't get recursive gc */
 		return YAFFS_OK;
 	}
-	
+
 	/* This loop should pass the first time.
 	 * We'll only see looping here if the erase of the collected block fails.
 	 */
 
 	do {
 		maxTries++;
-		
+
 		checkpointBlockAdjust = (dev->nCheckpointReservedBlocks - dev->blocksInCheckpoint);
 		if(checkpointBlockAdjust < 0)
 			checkpointBlockAdjust = 0;
@@ -3343,11 +3343,11 @@
 static int yaffs_PutChunkIntoFile(yaffs_Object * in, int chunkInInode,
 				  int chunkInNAND, int inScan)
 {
-	/* NB inScan is zero unless scanning. 
-	 * For forward scanning, inScan is > 0; 
+	/* NB inScan is zero unless scanning.
+	 * For forward scanning, inScan is > 0;
 	 * for backward scanning inScan is < 0
 	 */
-	 
+
 	yaffs_Tnode *tn;
 	yaffs_Device *dev = in->myDev;
 	int existingChunk;
@@ -3371,7 +3371,7 @@
 		return YAFFS_OK;
 	}
 
-	tn = yaffs_AddOrFindLevel0Tnode(dev, 
+	tn = yaffs_AddOrFindLevel0Tnode(dev,
 					&in->variant.fileVariant,
 					chunkInInode,
 					NULL);
@@ -3383,7 +3383,7 @@
 
 	if (inScan != 0) {
 		/* If we're scanning then we need to test for duplicates
-		 * NB This does not need to be efficient since it should only ever 
+		 * NB This does not need to be efficient since it should only ever
 		 * happen when the power fails during a write, then only one
 		 * chunk should ever be affected.
 		 *
@@ -3424,7 +3424,7 @@
 
 			}
 
-			/* NB The deleted flags should be false, otherwise the chunks will 
+			/* NB The deleted flags should be false, otherwise the chunks will
 			 * not be loaded during a scan
 			 */
 
@@ -3435,7 +3435,7 @@
 			    (in->myDev->isYaffs2 ||
 			     existingChunk <= 0 ||
 			     ((existingSerial + 1) & 3) == newSerial)) {
-				/* Forward scanning.                            
+				/* Forward scanning.
 				 * Use new
 				 * Delete the old one and drop through to update the tnode
 				 */
@@ -3476,7 +3476,7 @@
 		  (TSTR("Chunk %d not found zero instead" TENDSTR),
 		   chunkInNAND));
 		/* get sane (zero) data if you read a hole */
-		memset(buffer, 0, in->myDev->nDataBytesPerChunk);	
+		memset(buffer, 0, in->myDev->nDataBytesPerChunk);
 		return 0;
 	}
 
@@ -3491,7 +3491,7 @@
 
 	if (chunkId <= 0)
 		return;
-		
+
 
 	dev->nDeletions++;
 	block = chunkId / dev->nChunksPerBlock;
@@ -3500,8 +3500,8 @@
 
 	if(!yaffs_CheckChunkBit(dev,block,page))
 		T(YAFFS_TRACE_VERIFY,
-		 	(TSTR("Deleting invalid chunk %d"TENDSTR),
-		 	 chunkId));
+			(TSTR("Deleting invalid chunk %d"TENDSTR),
+			 chunkId));
 
 	bi = yaffs_GetBlockInfo(dev, block);
 
@@ -3619,7 +3619,7 @@
 	YCHAR oldName[YAFFS_MAX_NAME_LENGTH + 1];
 
 	yaffs_ObjectHeader *oh = NULL;
-	
+
 	yaffs_strcpy(oldName,"silly old name");
 
 	if (!in->fake || force) {
@@ -3635,9 +3635,9 @@
 		if (prevChunkId >= 0) {
 			result = yaffs_ReadChunkWithTagsFromNAND(dev, prevChunkId,
 							buffer, &oldTags);
-			
+
 			yaffs_VerifyObjectHeader(in,oh,&oldTags,0);
-										
+
 			memcpy(oldName, oh->name, sizeof(oh->name));
 		}
 
@@ -3765,11 +3765,11 @@
 
 /*------------------------ Short Operations Cache ----------------------------------------
  *   In many situations where there is no high level buffering (eg WinCE) a lot of
- *   reads might be short sequential reads, and a lot of writes may be short 
+ *   reads might be short sequential reads, and a lot of writes may be short
  *   sequential writes. eg. scanning/writing a jpeg file.
- *   In these cases, a short read/write cache can provide a huge perfomance benefit 
+ *   In these cases, a short read/write cache can provide a huge perfomance benefit
  *   with dumb-as-a-rock code.
- *   In Linux, the page cache provides read buffering aand the short op cache provides write 
+ *   In Linux, the page cache provides read buffering aand the short op cache provides write
  *   buffering.
  *
  *   There are a limited number (~10) of cache chunks per device so that we don't
@@ -3782,14 +3782,14 @@
 	int i;
 	yaffs_ChunkCache *cache;
 	int nCaches = obj->myDev->nShortOpCaches;
-	
+
 	for(i = 0; i < nCaches; i++){
 		cache = &dev->srCache[i];
 		if (cache->object == obj &&
 		    cache->dirty)
 			return 1;
 	}
-	
+
 	return 0;
 }
 
@@ -3855,7 +3855,7 @@
 	yaffs_Object *obj;
 	int nCaches = dev->nShortOpCaches;
 	int i;
-	
+
 	/* Find a dirty object in the cache and flush it...
 	 * until there are no further dirty objects.
 	 */
@@ -3865,18 +3865,18 @@
 			if (dev->srCache[i].object &&
 			    dev->srCache[i].dirty)
 				obj = dev->srCache[i].object;
-			    
+
 		}
 		if(obj)
 			yaffs_FlushFilesChunkCache(obj);
-			
+
 	} while(obj);
-	
+
 }
 
 
 /* Grab us a cache chunk for use.
- * First look for an empty one. 
+ * First look for an empty one.
  * Then look for the least recently used non-dirty one.
  * Then look for the least recently used dirty one...., flush and look again.
  */
@@ -3888,7 +3888,7 @@
 
 	if (dev->nShortOpCaches > 0) {
 		for (i = 0; i < dev->nShortOpCaches; i++) {
-			if (!dev->srCache[i].object) 
+			if (!dev->srCache[i].object)
 				return &dev->srCache[i];
 		}
 
@@ -4049,14 +4049,14 @@
 static int yaffs_WriteCheckpointValidityMarker(yaffs_Device *dev,int head)
 {
 	yaffs_CheckpointValidity cp;
-	
+
 	memset(&cp,0,sizeof(cp));
-	
+
 	cp.structType = sizeof(cp);
 	cp.magic = YAFFS_MAGIC;
 	cp.version = YAFFS_CHECKPOINT_VERSION;
 	cp.head = (head) ? 1 : 0;
-	
+
 	return (yaffs_CheckpointWrite(dev,&cp,sizeof(cp)) == sizeof(cp))?
 		1 : 0;
 }
@@ -4065,9 +4065,9 @@
 {
 	yaffs_CheckpointValidity cp;
 	int ok;
-	
+
 	ok = (yaffs_CheckpointRead(dev,&cp,sizeof(cp)) == sizeof(cp));
-	
+
 	if(ok)
 		ok = (cp.structType == sizeof(cp)) &&
 		     (cp.magic == YAFFS_MAGIC) &&
@@ -4076,20 +4076,20 @@
 	return ok ? 1 : 0;
 }
 
-static void yaffs_DeviceToCheckpointDevice(yaffs_CheckpointDevice *cp, 
+static void yaffs_DeviceToCheckpointDevice(yaffs_CheckpointDevice *cp,
 					   yaffs_Device *dev)
 {
 	cp->nErasedBlocks = dev->nErasedBlocks;
 	cp->allocationBlock = dev->allocationBlock;
 	cp->allocationPage = dev->allocationPage;
 	cp->nFreeChunks = dev->nFreeChunks;
-	
+
 	cp->nDeletedFiles = dev->nDeletedFiles;
 	cp->nUnlinkedFiles = dev->nUnlinkedFiles;
 	cp->nBackgroundDeletions = dev->nBackgroundDeletions;
 	cp->sequenceNumber = dev->sequenceNumber;
 	cp->oldestDirtySequence = dev->oldestDirtySequence;
-	
+
 }
 
 static void yaffs_CheckpointDeviceToDevice(yaffs_Device *dev,
@@ -4099,7 +4099,7 @@
 	dev->allocationBlock = cp->allocationBlock;
 	dev->allocationPage = cp->allocationPage;
 	dev->nFreeChunks = cp->nFreeChunks;
-	
+
 	dev->nDeletedFiles = cp->nDeletedFiles;
 	dev->nUnlinkedFiles = cp->nUnlinkedFiles;
 	dev->nBackgroundDeletions = cp->nBackgroundDeletions;
@@ -4115,20 +4115,20 @@
 	__u32 nBlocks = (dev->internalEndBlock - dev->internalStartBlock + 1);
 
 	int ok;
-		
+
 	/* Write device runtime values*/
 	yaffs_DeviceToCheckpointDevice(&cp,dev);
 	cp.structType = sizeof(cp);
-	
+
 	ok = (yaffs_CheckpointWrite(dev,&cp,sizeof(cp)) == sizeof(cp));
-	
+
 	/* Write block info */
 	if(ok) {
 		nBytes = nBlocks * sizeof(yaffs_BlockInfo);
 		ok = (yaffs_CheckpointWrite(dev,dev->blockInfo,nBytes) == nBytes);
 	}
-		
-	/* Write chunk bits */		
+
+	/* Write chunk bits */
 	if(ok) {
 		nBytes = nBlocks * dev->chunkBitmapStride;
 		ok = (yaffs_CheckpointWrite(dev,dev->chunkBits,nBytes) == nBytes);
@@ -4143,28 +4143,28 @@
 	__u32 nBytes;
 	__u32 nBlocks = (dev->internalEndBlock - dev->internalStartBlock + 1);
 
+	int ok;
+
-	int ok;	
-	
 	ok = (yaffs_CheckpointRead(dev,&cp,sizeof(cp)) == sizeof(cp));
 	if(!ok)
 		return 0;
-		
+
 	if(cp.structType != sizeof(cp))
 		return 0;
-		
-	
+
+
 	yaffs_CheckpointDeviceToDevice(dev,&cp);
-	
+
 	nBytes = nBlocks * sizeof(yaffs_BlockInfo);
-	
+
 	ok = (yaffs_CheckpointRead(dev,dev->blockInfo,nBytes) == nBytes);
-	
+
 	if(!ok)
 		return 0;
 	nBytes = nBlocks * dev->chunkBitmapStride;
-	
+
 	ok = (yaffs_CheckpointRead(dev,dev->chunkBits,nBytes) == nBytes);
-	
+
 	return ok ? 1 : 0;
 }
 
@@ -4175,7 +4175,7 @@
 	cp->objectId = obj->objectId;
 	cp->parentId = (obj->parent) ? obj->parent->objectId : 0;
 	cp->chunkId = obj->chunkId;
-	cp->variantType = obj->variantType;			
+	cp->variantType = obj->variantType;
 	cp->deleted = obj->deleted;
 	cp->softDeleted = obj->softDeleted;
 	cp->unlinked = obj->unlinked;
@@ -4184,7 +4184,7 @@
 	cp->unlinkAllowed = obj->unlinkAllowed;
 	cp->serial = obj->serial;
 	cp->nDataChunks = obj->nDataChunks;
-	
+
 	if(obj->variantType == YAFFS_OBJECT_TYPE_FILE)
 		cp->fileSizeOrEquivalentObjectId = obj->variant.fileVariant.fileSize;
 	else if(obj->variantType == YAFFS_OBJECT_TYPE_HARDLINK)
@@ -4195,9 +4195,9 @@
 {
 
 	yaffs_Object *parent;
-	
+
 	obj->objectId = cp->objectId;
-	
+
 	if(cp->parentId)
 		parent = yaffs_FindOrCreateObjectByNumber(
 					obj->myDev,
@@ -4205,12 +4205,12 @@
 					YAFFS_OBJECT_TYPE_DIRECTORY);
 	else
 		parent = NULL;
-		
+
 	if(parent)
 		yaffs_AddObjectToDirectory(parent, obj);
-		
+
 	obj->chunkId = cp->chunkId;
-	obj->variantType = cp->variantType;			
+	obj->variantType = cp->variantType;
 	obj->deleted = cp->deleted;
 	obj->softDeleted = cp->softDeleted;
 	obj->unlinked = cp->unlinked;
@@ -4219,12 +4219,12 @@
 	obj->unlinkAllowed = cp->unlinkAllowed;
 	obj->serial = cp->serial;
 	obj->nDataChunks = cp->nDataChunks;
-	
+
 	if(obj->variantType == YAFFS_OBJECT_TYPE_FILE)
 		obj->variant.fileVariant.fileSize = cp->fileSizeOrEquivalentObjectId;
 	else if(obj->variantType == YAFFS_OBJECT_TYPE_HARDLINK)
 		obj->variant.hardLinkVariant.equivalentObjectId = cp->fileSizeOrEquivalentObjectId;
-		
+
 	if(obj->objectId >= YAFFS_NOBJECT_BUCKETS)
 		obj->lazyLoaded = 1;
 }
@@ -4232,7 +4232,7 @@
 
 
 static int yaffs_CheckpointTnodeWorker(yaffs_Object * in, yaffs_Tnode * tn,
-				  	__u32 level, int chunkOffset)
+					__u32 level, int chunkOffset)
 {
 	int i;
 	yaffs_Device *dev = in->myDev;
@@ -4267,17 +4267,17 @@
 {
 	__u32 endMarker = ~0;
 	int ok = 1;
-	
+
 	if(obj->variantType == YAFFS_OBJECT_TYPE_FILE){
 		ok = yaffs_CheckpointTnodeWorker(obj,
 					    obj->variant.fileVariant.top,
 					    obj->variant.fileVariant.topLevel,
 					    0);
 		if(ok)
-			ok = (yaffs_CheckpointWrite(obj->myDev,&endMarker,sizeof(endMarker)) == 
+			ok = (yaffs_CheckpointWrite(obj->myDev,&endMarker,sizeof(endMarker)) ==
 				sizeof(endMarker));
 	}
-	
+
 	return ok ? 1 : 0;
 }
 
@@ -4289,14 +4289,14 @@
 	yaffs_FileStructure *fileStructPtr = &obj->variant.fileVariant;
 	yaffs_Tnode *tn;
 	int nread = 0;
-	
+
 	ok = (yaffs_CheckpointRead(dev,&baseChunk,sizeof(baseChunk)) == sizeof(baseChunk));
-	
+
 	while(ok && (~baseChunk)){
 		nread++;
 		/* Read level 0 tnode */
-		
-		
+
+
 		/* printf("read  tnode at %d\n",baseChunk); */
 		tn = yaffs_GetTnodeRaw(dev);
 		if(tn)
@@ -4304,27 +4304,27 @@
 			      (dev->tnodeWidth * YAFFS_NTNODES_LEVEL0)/8);
 		else
 			ok = 0;
-			
+
 		if(tn && ok){
 			ok = yaffs_AddOrFindLevel0Tnode(dev,
-					       		fileStructPtr,
-					       		baseChunk,
-					       		tn) ? 1 : 0;
-					       		
+							fileStructPtr,
+							baseChunk,
+							tn) ? 1 : 0;
+
 		}
-			
+
 		if(ok)
 			ok = (yaffs_CheckpointRead(dev,&baseChunk,sizeof(baseChunk)) == sizeof(baseChunk));
-		
+
 	}
 
 	T(YAFFS_TRACE_CHECKPOINT,(
 		TSTR("Checkpoint read tnodes %d records, last %d. ok %d" TENDSTR),
 		nread,baseChunk,ok));
 
-	return ok ? 1 : 0;	
+	return ok ? 1 : 0;
 }
- 
+
 
 static int yaffs_WriteCheckpointObjects(yaffs_Device *dev)
 {
@@ -4334,13 +4334,13 @@
 	int ok = 1;
 	struct list_head *lh;
 
-	
+
 	/* Iterate through the objects in each hash entry,
 	 * dumping them to the checkpointing stream.
 	 */
-	 
+
 	 for(i = 0; ok &&  i <  YAFFS_NOBJECT_BUCKETS; i++){
-	 	list_for_each(lh, &dev->objectBucket[i].list) {
+		list_for_each(lh, &dev->objectBucket[i].list) {
 			if (lh) {
 				obj = list_entry(lh, yaffs_Object, hashLink);
 				if (!obj->deferedFree) {
@@ -4350,9 +4350,9 @@
 					T(YAFFS_TRACE_CHECKPOINT,(
 						TSTR("Checkpoint write object %d parent %d type %d chunk %d obj addr %x" TENDSTR),
 						cp.objectId,cp.parentId,cp.variantType,cp.chunkId,(unsigned) obj));
-						
+
 					ok = (yaffs_CheckpointWrite(dev,&cp,sizeof(cp)) == sizeof(cp));
-					
+
 					if(ok && obj->variantType == YAFFS_OBJECT_TYPE_FILE){
 						ok = yaffs_WriteCheckpointTnodes(obj);
 					}
@@ -4360,14 +4360,14 @@
 			}
 		}
 	 }
-	 
+
 	 /* Dump end of list */
 	memset(&cp,0xFF,sizeof(yaffs_CheckpointObject));
 	cp.structType = sizeof(cp);
-	
+
 	if(ok)
 		ok = (yaffs_CheckpointWrite(dev,&cp,sizeof(cp)) == sizeof(cp));
-		
+
 	return ok ? 1 : 0;
 }
 
@@ -4378,7 +4378,7 @@
 	int ok = 1;
 	int done = 0;
 	yaffs_Object *hardList = NULL;
-	
+
 	while(ok && !done) {
 		ok = (yaffs_CheckpointRead(dev,&cp,sizeof(cp)) == sizeof(cp));
 		if(cp.structType != sizeof(cp)) {
@@ -4386,10 +4386,10 @@
 				cp.structType,sizeof(cp),ok));
 			ok = 0;
 		}
-			
+
 		T(YAFFS_TRACE_CHECKPOINT,(TSTR("Checkpoint read object %d parent %d type %d chunk %d " TENDSTR),
 			cp.objectId,cp.parentId,cp.variantType,cp.chunkId));
-			
+
 		if(ok && cp.objectId == ~0)
 			done = 1;
 		else if(ok){
@@ -4404,14 +4404,14 @@
 						    hardList;
 					hardList = obj;
 				}
-			   
+
 			}
 		}
 	}
-	
+
 	if(ok)
 		yaffs_HardlinkFixup(dev,hardList);
-	
+
 	return ok ? 1 : 0;
 }
 
@@ -4419,14 +4419,14 @@
 {
 	__u32 checkpointSum;
 	int ok;
-	
+
 	yaffs_GetCheckpointSum(dev,&checkpointSum);
-	
+
 	ok = (yaffs_CheckpointWrite(dev,&checkpointSum,sizeof(checkpointSum)) == sizeof(checkpointSum));
-	
+
 	if(!ok)
 		return 0;
-	
+
 	return 1;
 }
 
@@ -4435,17 +4435,17 @@
 	__u32 checkpointSum0;
 	__u32 checkpointSum1;
 	int ok;
-	
+
 	yaffs_GetCheckpointSum(dev,&checkpointSum0);
-	
+
 	ok = (yaffs_CheckpointRead(dev,&checkpointSum1,sizeof(checkpointSum1)) == sizeof(checkpointSum1));
-	
+
 	if(!ok)
 		return 0;
-		
+
 	if(checkpointSum0 != checkpointSum1)
 		return 0;
-	
+
 	return 1;
 }
 
@@ -4454,15 +4454,15 @@
 {
 
 	int ok = 1;
-	
+
 	if(dev->skipCheckpointWrite || !dev->isYaffs2){
 		T(YAFFS_TRACE_CHECKPOINT,(TSTR("skipping checkpoint write" TENDSTR)));
 		ok = 0;
 	}
-		
+
 	if(ok)
 		ok = yaffs_CheckpointOpen(dev,1);
-	
+
 	if(ok){
 		T(YAFFS_TRACE_CHECKPOINT,(TSTR("write checkpoint validity" TENDSTR)));
 		ok = yaffs_WriteCheckpointValidityMarker(dev,1);
@@ -4479,19 +4479,19 @@
 		T(YAFFS_TRACE_CHECKPOINT,(TSTR("write checkpoint validity" TENDSTR)));
 		ok = yaffs_WriteCheckpointValidityMarker(dev,0);
 	}
-	
+
 	if(ok){
 		ok = yaffs_WriteCheckpointSum(dev);
 	}
-	
-	
+
+
 	if(!yaffs_CheckpointClose(dev))
 		 ok = 0;
-		 
+
 	if(ok)
-	    	dev->isCheckpointed = 1;
-	 else 
-	 	dev->isCheckpointed = 0;
+		dev->isCheckpointed = 1;
+	 else
+		dev->isCheckpointed = 0;
 
 	return dev->isCheckpointed;
 }
@@ -4499,17 +4499,17 @@
 static int yaffs_ReadCheckpointData(yaffs_Device *dev)
 {
 	int ok = 1;
-	
+
 	if(dev->skipCheckpointRead || !dev->isYaffs2){
 		T(YAFFS_TRACE_CHECKPOINT,(TSTR("skipping checkpoint read" TENDSTR)));
 		ok = 0;
 	}
-	
+
 	if(ok)
 		ok = yaffs_CheckpointOpen(dev,0); /* open for read */
-	
+
 	if(ok){
-		T(YAFFS_TRACE_CHECKPOINT,(TSTR("read checkpoint validity" TENDSTR)));	
+		T(YAFFS_TRACE_CHECKPOINT,(TSTR("read checkpoint validity" TENDSTR)));
 		ok = yaffs_ReadCheckpointValidityMarker(dev,1);
 	}
 	if(ok){
@@ -4517,14 +4517,14 @@
 		ok = yaffs_ReadCheckpointDevice(dev);
 	}
 	if(ok){
-		T(YAFFS_TRACE_CHECKPOINT,(TSTR("read checkpoint objects" TENDSTR)));	
+		T(YAFFS_TRACE_CHECKPOINT,(TSTR("read checkpoint objects" TENDSTR)));
 		ok = yaffs_ReadCheckpointObjects(dev);
 	}
 	if(ok){
 		T(YAFFS_TRACE_CHECKPOINT,(TSTR("read checkpoint validity" TENDSTR)));
 		ok = yaffs_ReadCheckpointValidityMarker(dev,0);
 	}
-	
+
 	if(ok){
 		ok = yaffs_ReadCheckpointSum(dev);
 		T(YAFFS_TRACE_CHECKPOINT,(TSTR("read checkpoint checksum %d" TENDSTR),ok));
@@ -4534,9 +4534,9 @@
 		ok = 0;
 
 	if(ok)
-	    	dev->isCheckpointed = 1;
-	 else 
-	 	dev->isCheckpointed = 0;
+		dev->isCheckpointed = 1;
+	 else
+		dev->isCheckpointed = 0;
 
 	return ok ? 1 : 0;
 
@@ -4544,7 +4544,7 @@
 
 static void yaffs_InvalidateCheckpoint(yaffs_Device *dev)
 {
-	if(dev->isCheckpointed || 
+	if(dev->isCheckpointed ||
 	   dev->blocksInCheckpoint > 0){
 		dev->isCheckpointed = 0;
 		yaffs_CheckpointInvalidateStream(dev);
@@ -4567,7 +4567,7 @@
 		yaffs_InvalidateCheckpoint(dev);
 		yaffs_WriteCheckpointData(dev);
 	}
-	
+
 	T(YAFFS_TRACE_ALWAYS,(TSTR("save exit: isCheckpointed %d"TENDSTR),dev->isCheckpointed));
 
 	return dev->isCheckpointed;
@@ -4577,7 +4577,7 @@
 {
 	int retval;
 	T(YAFFS_TRACE_CHECKPOINT,(TSTR("restore entry: isCheckpointed %d"TENDSTR),dev->isCheckpointed));
-		
+
 	retval = yaffs_ReadCheckpointData(dev);
 
 	if(dev->isCheckpointed){
@@ -4587,7 +4587,7 @@
 	}
 
 	T(YAFFS_TRACE_CHECKPOINT,(TSTR("restore exit: isCheckpointed %d"TENDSTR),dev->isCheckpointed));
-	
+
 	return retval;
 }
 
@@ -4623,7 +4623,7 @@
 		chunk++;
 
 		/* OK now check for the curveball where the start and end are in
-		 * the same chunk.      
+		 * the same chunk.
 		 */
 		if ((start + n) < dev->nDataBytesPerChunk) {
 			nToCopy = n;
@@ -4780,7 +4780,7 @@
 				yaffs_ChunkCache *cache;
 				/* If we can't find the data in the cache, then load the cache */
 				cache = yaffs_FindChunkCache(in, chunk);
-				
+
 				if (!cache
 				    && yaffs_CheckSpaceForAllocation(in->
 								     myDev)) {
@@ -4793,12 +4793,12 @@
 								      cache->
 								      data);
 				}
-				else if(cache && 
-				        !cache->dirty &&
+				else if(cache &&
+					!cache->dirty &&
 					!yaffs_CheckSpaceForAllocation(in->myDev)){
 					/* Drop the cache if it was a read cache item and
 					 * no space check has been made for it.
-					 */ 
+					 */
 					 cache = NULL;
 				}
 
@@ -4962,7 +4962,7 @@
 	int oldFileSize = in->variant.fileVariant.fileSize;
 	int newSizeOfPartialChunk;
 	int newFullChunks;
-	
+
 	yaffs_Device *dev = in->myDev;
 
 	yaffs_AddrToChunk(dev, newSize, &newFullChunks, &newSizeOfPartialChunk);
@@ -4986,7 +4986,7 @@
 
 		if (newSizeOfPartialChunk != 0) {
 			int lastChunk = 1 + newFullChunks;
-			
+
 			__u8 *localBuffer = yaffs_GetTempBuffer(dev, __LINE__);
 
 			/* Got to read and rewrite the last chunk with its new size and zero pad */
@@ -5010,8 +5010,8 @@
 		in->variant.fileVariant.fileSize = newSize;
 	}
 
-		
-	
+
+
 	/* Write a new object header.
 	 * show we've shrunk the file, if need be
 	 * Do this only if the file is not in the deleted directories.
@@ -5333,7 +5333,7 @@
 {
 	yaffs_Object *hl;
 	yaffs_Object *in;
-	
+
 	while (hardList) {
 		hl = hardList;
 		hardList = (yaffs_Object *) (hardList->hardLinks.next);
@@ -5369,9 +5369,9 @@
     register int ablock = ((yaffs_BlockIndex *)a)->block;
     register int bblock = ((yaffs_BlockIndex *)b)->block;
     if( aseq == bseq )
-        return ablock - bblock;
+	return ablock - bblock;
     else
-        return aseq - bseq;
+	return aseq - bseq;
 
 }
 
@@ -5396,9 +5396,9 @@
 	yaffs_Object *in;
 	yaffs_Object *parent;
 	int nBlocks = dev->internalEndBlock - dev->internalStartBlock + 1;
-	
+
 	int alloc_failed = 0;
-	
+
 
 	__u8 *chunkData;
 
@@ -5409,9 +5409,9 @@
 		  (TSTR("yaffs_Scan is not for YAFFS2!" TENDSTR)));
 		return YAFFS_FAIL;
 	}
-	
+
 	//TODO  Throw all the yaffs2 stuuf out of yaffs_Scan since it is only for yaffs1 format.
-	
+
 	T(YAFFS_TRACE_SCAN,
 	  (TSTR("yaffs_Scan starts  intstartblk %d intendblk %d..." TENDSTR),
 	   dev->internalStartBlock, dev->internalEndBlock));
@@ -5540,7 +5540,7 @@
 				/*T((" %d %d deleted\n",blk,c)); */
 			} else if (!tags.chunkUsed) {
 				/* An unassigned chunk in the block
-				 * This means that either the block is empty or 
+				 * This means that either the block is empty or
 				 * this is the one being allocated from
 				 */
 
@@ -5557,9 +5557,9 @@
 					state = YAFFS_BLOCK_STATE_ALLOCATING;
 					dev->allocationBlock = blk;
 					dev->allocationPage = c;
-					dev->allocationBlockFinder = blk;	
+					dev->allocationBlockFinder = blk;
 					/* Set it to here to encourage the allocator to go forth from here. */
-					
+
 					/* Yaffs2 sanity check:
 					 * This should be the one with the highest sequence number
 					 */
@@ -5589,7 +5589,7 @@
 				/* PutChunkIntoFile checks for a clash (two data chunks with
 				 * the same chunkId).
 				 */
-				 
+
 				if(!in)
 					alloc_failed = 1;
 
@@ -5597,11 +5597,11 @@
 					if(!yaffs_PutChunkIntoFile(in, tags.chunkId, chunk,1))
 						alloc_failed = 1;
 				}
-				
+
 				endpos =
 				    (tags.chunkId - 1) * dev->nDataBytesPerChunk +
 				    tags.byteCount;
-				if (in && 
+				if (in &&
 				    in->variantType == YAFFS_OBJECT_TYPE_FILE
 				    && in->variant.fileVariant.scannedFileSize <
 				    endpos) {
@@ -5633,7 +5633,7 @@
 							      tags.objectId);
 				if (in && in->variantType != oh->type) {
 					/* This should not happen, but somehow
-					 * Wev'e ended up with an objectId that has been reused but not yet 
+					 * Wev'e ended up with an objectId that has been reused but not yet
 					 * deleted, and worse still it has changed type. Delete the old object.
 					 */
 
@@ -5649,7 +5649,7 @@
 
 				if(!in)
 					alloc_failed = 1;
-					
+
 				if (in && oh->shadowsObject > 0) {
 					yaffs_HandleShadowedObject(dev,
 								   oh->
@@ -5772,11 +5772,11 @@
 					 * Since we might scan a hardlink before its equivalent object is scanned
 					 * we put them all in a list.
 					 * After scanning is complete, we should have all the objects, so we run through this
-					 * list and fix up all the chains.              
+					 * list and fix up all the chains.
 					 */
 
 					switch (in->variantType) {
-					case YAFFS_OBJECT_TYPE_UNKNOWN:	
+					case YAFFS_OBJECT_TYPE_UNKNOWN:
 						/* Todo got a problem */
 						break;
 					case YAFFS_OBJECT_TYPE_FILE:
@@ -5811,7 +5811,7 @@
 					case YAFFS_OBJECT_TYPE_SPECIAL:
 						/* Do nothing */
 						break;
-					case YAFFS_OBJECT_TYPE_SYMLINK:	
+					case YAFFS_OBJECT_TYPE_SYMLINK:
 						in->variant.symLinkVariant.alias =
 						    yaffs_CloneString(oh->alias);
 						if(!in->variant.symLinkVariant.alias)
@@ -5846,11 +5846,11 @@
 	if (blockIndex) {
 		YFREE(blockIndex);
 	}
-	
-	
+
+
 	/* Ok, we've done all the scanning.
 	 * Fix up the hard link chains.
-	 * We should now have scanned all the objects, now it's time to add these 
+	 * We should now have scanned all the objects, now it's time to add these
 	 * hardlinks.
 	 */
 
@@ -5880,9 +5880,9 @@
 	if(alloc_failed){
 		return YAFFS_FAIL;
 	}
-	
+
 	T(YAFFS_TRACE_SCAN, (TSTR("yaffs_Scan ends" TENDSTR)));
-	
+
 
 	return YAFFS_OK;
 }
@@ -5898,7 +5898,7 @@
 
 	if(!in)
 		return;
-		
+
 #if 0
 	T(YAFFS_TRACE_SCAN,(TSTR("details for object %d %s loaded" TENDSTR),
 		in->objectId,
@@ -5910,7 +5910,7 @@
 		chunkData = yaffs_GetTempBuffer(dev, __LINE__);
 
 		result = yaffs_ReadChunkWithTagsFromNAND(dev,in->chunkId,chunkData,&tags);
-		oh = (yaffs_ObjectHeader *) chunkData;		
+		oh = (yaffs_ObjectHeader *) chunkData;
 
 		in->yst_mode = oh->yst_mode;
 #ifdef CONFIG_YAFFS_WINCE
@@ -5927,17 +5927,17 @@
 		in->yst_mtime = oh->yst_mtime;
 		in->yst_ctime = oh->yst_ctime;
 		in->yst_rdev = oh->yst_rdev;
-		
+
 #endif
 		yaffs_SetObjectName(in, oh->name);
-		
+
 		if(in->variantType == YAFFS_OBJECT_TYPE_SYMLINK){
 			 in->variant.symLinkVariant.alias =
 						    yaffs_CloneString(oh->alias);
 			if(!in->variant.symLinkVariant.alias)
 				alloc_failed = 1; /* Not returned to caller */
 		}
-						    
+
 		yaffs_ReleaseTempBuffer(dev,chunkData, __LINE__);
 	}
 }
@@ -5965,13 +5965,13 @@
 	int nBlocks = dev->internalEndBlock - dev->internalStartBlock + 1;
 	int itsUnlinked;
 	__u8 *chunkData;
-	
+
 	int fileSize;
 	int isShrink;
 	int foundChunksInBlock;
 	int equivalentObjectId;
 	int alloc_failed = 0;
-	
+
 
 	yaffs_BlockIndex *blockIndex = NULL;
 	int altBlockIndex = 0;
@@ -5991,20 +5991,20 @@
 	dev->sequenceNumber = YAFFS_LOWEST_SEQUENCE_NUMBER;
 
 	blockIndex = YMALLOC(nBlocks * sizeof(yaffs_BlockIndex));
-	
+
 	if(!blockIndex) {
 		blockIndex = YMALLOC_ALT(nBlocks * sizeof(yaffs_BlockIndex));
 		altBlockIndex = 1;
 	}
-	
+
 	if(!blockIndex) {
 		T(YAFFS_TRACE_SCAN,
 		  (TSTR("yaffs_Scan() could not allocate block index!" TENDSTR)));
 		return YAFFS_FAIL;
 	}
-	
+
 	dev->blocksInCheckpoint = 0;
-	
+
 	chunkData = yaffs_GetTempBuffer(dev, __LINE__);
 
 	/* Scan all the blocks to determine their state */
@@ -6021,15 +6021,15 @@
 
 		if(bi->sequenceNumber == YAFFS_SEQUENCE_CHECKPOINT_DATA)
 			bi->blockState = state = YAFFS_BLOCK_STATE_CHECKPOINT;
-			
+
 		T(YAFFS_TRACE_SCAN_DEBUG,
 		  (TSTR("Block scanning block %d state %d seq %d" TENDSTR), blk,
 		   state, sequenceNumber));
 
-		
+
 		if(state == YAFFS_BLOCK_STATE_CHECKPOINT){
 			dev->blocksInCheckpoint++;
-			
+
 		} else if (state == YAFFS_BLOCK_STATE_DEAD) {
 			T(YAFFS_TRACE_BAD_BLOCKS,
 			  (TSTR("block %d is bad" TENDSTR), blk));
@@ -6079,8 +6079,8 @@
 	}
 #else
 	{
-	 	/* Dungy old bubble sort... */
-	 	
+		/* Dungy old bubble sort... */
+
 		yaffs_BlockIndex temp;
 		int i;
 		int j;
@@ -6097,7 +6097,7 @@
 
 	YYIELD();
 
-    	T(YAFFS_TRACE_SCAN, (TSTR("...done" TENDSTR)));
+	T(YAFFS_TRACE_SCAN, (TSTR("...done" TENDSTR)));
 
 	/* Now scan the blocks looking at the data. */
 	startIterator = 0;
@@ -6108,30 +6108,30 @@
 	/* For each block.... backwards */
 	for (blockIterator = endIterator; !alloc_failed && blockIterator >= startIterator;
 	     blockIterator--) {
-	        /* Cooperative multitasking! This loop can run for so
+		/* Cooperative multitasking! This loop can run for so
 		   long that watchdog timers expire. */
-	        YYIELD();
+		YYIELD();
 
 		/* get the block to scan in the correct order */
 		blk = blockIndex[blockIterator].block;
 
 		bi = yaffs_GetBlockInfo(dev, blk);
-		
-		
+
+
 		state = bi->blockState;
 
 		deleted = 0;
 
 		/* For each chunk in each block that needs scanning.... */
 		foundChunksInBlock = 0;
-		for (c = dev->nChunksPerBlock - 1; 
+		for (c = dev->nChunksPerBlock - 1;
 		     !alloc_failed && c >= 0 &&
 		     (state == YAFFS_BLOCK_STATE_NEEDS_SCANNING ||
 		      state == YAFFS_BLOCK_STATE_ALLOCATING); c--) {
-			/* Scan backwards... 
+			/* Scan backwards...
 			 * Read the tags and decide what to do
 			 */
-			
+
 			chunk = blk * dev->nChunksPerBlock + c;
 
 			result = yaffs_ReadChunkWithTagsFromNAND(dev, chunk, NULL,
@@ -6145,14 +6145,14 @@
 				 * it is a chunk that was skipped due to failing the erased
 				 * check. Just skip it so that it can be deleted.
 				 * But, more typically, We get here when this is an unallocated
-				 * chunk and his means that either the block is empty or 
+				 * chunk and his means that either the block is empty or
 				 * this is the one being allocated from
 				 */
 
 				if(foundChunksInBlock)
 				{
 					/* This is a chunk that was skipped due to failing the erased check */
-					
+
 				} else if (c == 0) {
 					/* We're looking at the first chunk in the block so the block is unused */
 					state = YAFFS_BLOCK_STATE_EMPTY;
@@ -6160,9 +6160,9 @@
 				} else {
 					if (state == YAFFS_BLOCK_STATE_NEEDS_SCANNING ||
 					    state == YAFFS_BLOCK_STATE_ALLOCATING) {
-					    	if(dev->sequenceNumber == bi->sequenceNumber) {
+						if(dev->sequenceNumber == bi->sequenceNumber) {
 							/* this is the block being allocated from */
-					    	
+
 							T(YAFFS_TRACE_SCAN,
 							  (TSTR
 							   (" Allocating from %d %d"
@@ -6171,34 +6171,34 @@
 							state = YAFFS_BLOCK_STATE_ALLOCATING;
 							dev->allocationBlock = blk;
 							dev->allocationPage = c;
-							dev->allocationBlockFinder = blk;	
+							dev->allocationBlockFinder = blk;
 						}
 						else {
 							/* This is a partially written block that is not
 							 * the current allocation block. This block must have
 							 * had a write failure, so set up for retirement.
 							 */
-						  
+
 							 bi->needsRetiring = 1;
 							 bi->gcPrioritise = 1;
-							 						 
+
 							 T(YAFFS_TRACE_ALWAYS,
 							 (TSTR("Partially written block %d being set for retirement" TENDSTR),
 							 blk));
 						}
 
 					}
-					 
+
 				}
 
 				dev->nFreeChunks++;
-				
+
 			} else if (tags.chunkId > 0) {
 				/* chunkId > 0 so it is a data chunk... */
 				unsigned int endpos;
 				__u32 chunkBase =
 				    (tags.chunkId - 1) * dev->nDataBytesPerChunk;
-								
+
 				foundChunksInBlock = 1;
 
 
@@ -6213,7 +6213,7 @@
 					/* Out of memory */
 					alloc_failed = 1;
 				}
-				
+
 				if (in &&
 				    in->variantType == YAFFS_OBJECT_TYPE_FILE
 				    && chunkBase <
@@ -6224,14 +6224,14 @@
 						alloc_failed = 1;
 					}
 
-					/* File size is calculated by looking at the data chunks if we have not 
+					/* File size is calculated by looking at the data chunks if we have not
 					 * seen an object header yet. Stop this practice once we find an object header.
 					 */
 					endpos =
 					    (tags.chunkId -
 					     1) * dev->nDataBytesPerChunk +
 					    tags.byteCount;
-					    
+
 					if (!in->valid &&	/* have not got an object header yet */
 					    in->variant.fileVariant.
 					    scannedFileSize < endpos) {
@@ -6277,7 +6277,7 @@
 				    ) {
 
 					/* If we don't have  valid info then we need to read the chunk
-					 * TODO In future we can probably defer reading the chunk and 
+					 * TODO In future we can probably defer reading the chunk and
 					 * living with invalid data until needed.
 					 */
 
@@ -6305,12 +6305,12 @@
 
 				if (in->valid) {
 					/* We have already filled this one.
-					 * We have a duplicate that will be discarded, but 
+					 * We have a duplicate that will be discarded, but
 					 * we first have to suck out resize info if it is a file.
 					 */
 
-					if ((in->variantType == YAFFS_OBJECT_TYPE_FILE) && 
-					     ((oh && 
+					if ((in->variantType == YAFFS_OBJECT_TYPE_FILE) &&
+					     ((oh &&
 					       oh-> type == YAFFS_OBJECT_TYPE_FILE)||
 					      (tags.extraHeaderInfoAvailable  &&
 					       tags.extraObjectType == YAFFS_OBJECT_TYPE_FILE))
@@ -6361,7 +6361,7 @@
 				     YAFFS_OBJECTID_LOSTNFOUND)) {
 					/* We only load some info, don't fiddle with directory structure */
 					in->valid = 1;
-					
+
 					if(oh) {
 						in->variantType = oh->type;
 
@@ -6380,13 +6380,13 @@
 						in->yst_mtime = oh->yst_mtime;
 						in->yst_ctime = oh->yst_ctime;
 						in->yst_rdev = oh->yst_rdev;
-		
+
 #endif
 					} else {
 						in->variantType = tags.extraObjectType;
 						in->lazyLoaded = 1;
 					}
-						
+
 					in->chunkId = chunk;
 
 				} else if (!in->valid) {
@@ -6394,7 +6394,7 @@
 
 					in->valid = 1;
 					in->chunkId = chunk;
-					
+
 					if(oh) {
 						in->variantType = oh->type;
 
@@ -6415,21 +6415,21 @@
 						in->yst_rdev = oh->yst_rdev;
 #endif
 
-						if (oh->shadowsObject > 0) 
+						if (oh->shadowsObject > 0)
 							yaffs_HandleShadowedObject(dev,
 									   oh->
 									   shadowsObject,
 									   1);
-					
+
 
 						yaffs_SetObjectName(in, oh->name);
 						parent =
 						    yaffs_FindOrCreateObjectByNumber
-					    		(dev, oh->parentObjectId,
-					     		 YAFFS_OBJECT_TYPE_DIRECTORY);
+							(dev, oh->parentObjectId,
+							 YAFFS_OBJECT_TYPE_DIRECTORY);
 
 						 fileSize = oh->fileSize;
- 						 isShrink = oh->isShrink;
+						 isShrink = oh->isShrink;
 						 equivalentObjectId = oh->equivalentObjectId;
 
 					}
@@ -6437,8 +6437,8 @@
 						in->variantType = tags.extraObjectType;
 						parent =
 						    yaffs_FindOrCreateObjectByNumber
-					    		(dev, tags.extraParentObjectId,
-					     		 YAFFS_OBJECT_TYPE_DIRECTORY);
+							(dev, tags.extraParentObjectId,
+							 YAFFS_OBJECT_TYPE_DIRECTORY);
 						 fileSize = tags.extraFileLength;
 						 isShrink = tags.extraIsShrinkHeader;
 						 equivalentObjectId = tags.extraEquivalentObjectId;
@@ -6488,11 +6488,11 @@
 					 * Since we might scan a hardlink before its equivalent object is scanned
 					 * we put them all in a list.
 					 * After scanning is complete, we should have all the objects, so we run
-					 * through this list and fix up all the chains.              
+					 * through this list and fix up all the chains.
 					 */
 
 					switch (in->variantType) {
-					case YAFFS_OBJECT_TYPE_UNKNOWN:	
+					case YAFFS_OBJECT_TYPE_UNKNOWN:
 						/* Todo got a problem */
 						break;
 					case YAFFS_OBJECT_TYPE_FILE:
@@ -6501,7 +6501,7 @@
 						    scannedFileSize < fileSize) {
 							/* This covers the case where the file size is greater
 							 * than where the data is
-							 * This will happen if the file is resized to be larger 
+							 * This will happen if the file is resized to be larger
 							 * than its current data extents.
 							 */
 							in->variant.fileVariant.fileSize = fileSize;
@@ -6536,13 +6536,13 @@
 						    yaffs_CloneString(oh->
 								      alias);
 						   if(!in->variant.symLinkVariant.alias)
-						   	alloc_failed = 1;
+							alloc_failed = 1;
 						}
 						break;
 					}
 
 				}
-				
+
 			}
 
 		} /* End of scanning for each chunk */
@@ -6563,19 +6563,19 @@
 
 	}
 
-	if (altBlockIndex) 
+	if (altBlockIndex)
 		YFREE_ALT(blockIndex);
 	else
 		YFREE(blockIndex);
-	
+
 	/* Ok, we've done all the scanning.
 	 * Fix up the hard link chains.
-	 * We should now have scanned all the objects, now it's time to add these 
+	 * We should now have scanned all the objects, now it's time to add these
 	 * hardlinks.
 	 */
 	yaffs_HardlinkFixup(dev,hardList);
-	
-	
+
+
 	/*
 	*  Sort out state of unlinked and deleted objects.
 	*/
@@ -6608,7 +6608,7 @@
 	}
 
 	yaffs_ReleaseTempBuffer(dev, chunkData, __LINE__);
-	
+
 	if(alloc_failed){
 		return YAFFS_FAIL;
 	}
@@ -6623,10 +6623,10 @@
 static void yaffs_RemoveObjectFromDirectory(yaffs_Object * obj)
 {
 	yaffs_Device *dev = obj->myDev;
-	
+
 	if(dev && dev->removeObjectCallback)
 		dev->removeObjectCallback(obj);
-	   
+
 	list_del_init(&obj->siblings);
 	obj->parent = NULL;
 }
@@ -6704,7 +6704,7 @@
 	list_for_each(i, &directory->variant.directoryVariant.children) {
 		if (i) {
 			l = list_entry(i, yaffs_Object, siblings);
-			
+
 			yaffs_CheckObjectDetailsLoaded(l);
 
 			/* Special case for lost-n-found */
@@ -6712,7 +6712,7 @@
 				if (yaffs_strcmp(name, YAFFS_LOSTNFOUND_NAME) == 0) {
 					return l;
 				}
-			} else if (yaffs_SumCompare(l->sum, sum) || l->chunkId <= 0)	
+			} else if (yaffs_SumCompare(l->sum, sum) || l->chunkId <= 0)
 			{
 				/* LostnFound cunk called Objxxx
 				 * Do a real check
@@ -6784,7 +6784,7 @@
 int yaffs_GetObjectName(yaffs_Object * obj, YCHAR * name, int buffSize)
 {
 	memset(name, 0, buffSize * sizeof(YCHAR));
-	
+
 	yaffs_CheckObjectDetailsLoaded(obj);
 
 	if (obj->objectId == YAFFS_OBJECTID_LOSTNFOUND) {
@@ -7016,13 +7016,13 @@
 static int yaffs_CreateInitialDirectories(yaffs_Device *dev)
 {
 	/* Initialise the unlinked, deleted, root and lost and found directories */
-	
+
 	dev->lostNFoundDir = dev->rootDir =  NULL;
 	dev->unlinkedDir = dev->deletedDir = NULL;
 
 	dev->unlinkedDir =
 	    yaffs_CreateFakeDirectory(dev, YAFFS_OBJECTID_UNLINKED, S_IFDIR);
-	
+
 	dev->deletedDir =
 	    yaffs_CreateFakeDirectory(dev, YAFFS_OBJECTID_DELETED, S_IFDIR);
 
@@ -7032,12 +7032,12 @@
 	dev->lostNFoundDir =
 	    yaffs_CreateFakeDirectory(dev, YAFFS_OBJECTID_LOSTNFOUND,
 				      YAFFS_LOSTNFOUND_MODE | S_IFDIR);
-	
+
 	if(dev->lostNFoundDir && dev->rootDir && dev->unlinkedDir && dev->deletedDir){
 		yaffs_AddObjectToDirectory(dev->rootDir, dev->lostNFoundDir);
 		return YAFFS_OK;
 	}
-	
+
 	return YAFFS_FAIL;
 }
 
@@ -7071,12 +7071,12 @@
 
 	/* Check geometry parameters. */
 
-	if ((dev->isYaffs2 && dev->nDataBytesPerChunk < 1024) || 
-	    (!dev->isYaffs2 && dev->nDataBytesPerChunk != 512) || 
-	     dev->nChunksPerBlock < 2 || 
-	     dev->nReservedBlocks < 2 || 
-	     dev->internalStartBlock <= 0 || 
-	     dev->internalEndBlock <= 0 || 
+	if ((dev->isYaffs2 && dev->nDataBytesPerChunk < 1024) ||
+	    (!dev->isYaffs2 && dev->nDataBytesPerChunk != 512) ||
+	     dev->nChunksPerBlock < 2 ||
+	     dev->nReservedBlocks < 2 ||
+	     dev->internalStartBlock <= 0 ||
+	     dev->internalEndBlock <= 0 ||
 	     dev->internalEndBlock <= (dev->internalStartBlock + dev->nReservedBlocks + 2)	// otherwise it is too small
 	    ) {
 		T(YAFFS_TRACE_ALWAYS,
@@ -7122,28 +7122,28 @@
 
 
 	/* OK now calculate a few things for the device */
-	
+
 	/*
-	 *  Calculate all the chunk size manipulation numbers: 
+	 *  Calculate all the chunk size manipulation numbers:
 	 */
 	 /* Start off assuming it is a power of 2 */
 	 dev->chunkShift = ShiftDiv(dev->nDataBytesPerChunk);
 	 dev->chunkMask = (1<<dev->chunkShift) - 1;
 
 	 if(dev->nDataBytesPerChunk == (dev->chunkMask + 1)){
-	 	/* Yes it is a power of 2, disable crumbs */
+		/* Yes it is a power of 2, disable crumbs */
 		dev->crumbMask = 0;
 		dev->crumbShift = 0;
 		dev->crumbsPerChunk = 0;
 	 } else {
-	 	/* Not a power of 2, use crumbs instead */
+		/* Not a power of 2, use crumbs instead */
 		dev->crumbShift = ShiftDiv(sizeof(yaffs_PackedTags2TagsPart));
 		dev->crumbMask = (1<<dev->crumbShift)-1;
 		dev->crumbsPerChunk = dev->nDataBytesPerChunk/(1 << dev->crumbShift);
 		dev->chunkShift = 0;
 		dev->chunkMask = 0;
 	}
-	 	
+
 
 	/*
 	 * Calculate chunkGroupBits.
@@ -7151,9 +7151,9 @@
 	 */
 
 	x = dev->nChunksPerBlock * (dev->internalEndBlock + 1);
-	
+
 	bits = ShiftsGE(x);
-	
+
 	/* Set up tnode width if wide tnodes are enabled. */
 	if(!dev->wideTnodesDisabled){
 		/* bits must be even so that we end up with 32-bit words */
@@ -7166,20 +7166,20 @@
 	}
 	else
 		dev->tnodeWidth = 16;
- 
+
 	dev->tnodeMask = (1<<dev->tnodeWidth)-1;
-		
+
 	/* Level0 Tnodes are 16 bits or wider (if wide tnodes are enabled),
 	 * so if the bitwidth of the
 	 * chunk range we're using is greater than 16 we need
 	 * to figure out chunk shift and chunkGroupSize
 	 */
-		 
+
 	if (bits <= dev->tnodeWidth)
 		dev->chunkGroupBits = 0;
 	else
 		dev->chunkGroupBits = bits - dev->tnodeWidth;
-		
+
 
 	dev->chunkGroupSize = 1 << dev->chunkGroupBits;
 
@@ -7217,11 +7217,11 @@
 	/* Initialise temporary buffers and caches. */
 	if(!yaffs_InitialiseTempBuffers(dev))
 		init_failed = 1;
-	
+
 	dev->srCache = NULL;
 	dev->gcCleanupList = NULL;
-	
-	
+
+
 	if (!init_failed &&
 	    dev->nShortOpCaches > 0) {
 		int i;
@@ -7233,10 +7233,10 @@
 		}
 
 		buf = dev->srCache =  YMALLOC(srCacheBytes);
-		    
+
 		if(dev->srCache)
 			memset(dev->srCache,0,srCacheBytes);
-		   
+
 		for (i = 0; i < dev->nShortOpCaches && buf; i++) {
 			dev->srCache[i].object = NULL;
 			dev->srCache[i].lastUse = 0;
@@ -7245,12 +7245,12 @@
 		}
 		if(!buf)
 			init_failed = 1;
-			
+
 		dev->srLastUse = 0;
 	}
 
 	dev->cacheHits = 0;
-	
+
 	if(!init_failed){
 		dev->gcCleanupList = YMALLOC(dev->nChunksPerBlock * sizeof(__u32));
 		if(!dev->gcCleanupList)
@@ -7262,7 +7262,7 @@
 	}
 	if(!init_failed && !yaffs_InitialiseBlocks(dev))
 		init_failed = 1;
-		
+
 	yaffs_InitialiseTnodes(dev);
 	yaffs_InitialiseObjects(dev);
 
@@ -7278,14 +7278,14 @@
 				  (TSTR("yaffs: restored from checkpoint" TENDSTR)));
 			} else {
 
-				/* Clean up the mess caused by an aborted checkpoint load 
-				 * and scan backwards. 
+				/* Clean up the mess caused by an aborted checkpoint load
+				 * and scan backwards.
 				 */
 				yaffs_DeinitialiseBlocks(dev);
 				yaffs_DeinitialiseTnodes(dev);
 				yaffs_DeinitialiseObjects(dev);
-				
-			
+
+
 				dev->nErasedBlocks = 0;
 				dev->nFreeChunks = 0;
 				dev->allocationBlock = -1;
@@ -7297,7 +7297,7 @@
 
 				if(!init_failed && !yaffs_InitialiseBlocks(dev))
 					init_failed = 1;
-					
+
 				yaffs_InitialiseTnodes(dev);
 				yaffs_InitialiseObjects(dev);
 
@@ -7311,7 +7311,7 @@
 			if(!yaffs_Scan(dev))
 				init_failed = 1;
 	}
-		
+
 	if(init_failed){
 		/* Clean up the mess */
 		T(YAFFS_TRACE_TRACING,
@@ -7332,7 +7332,7 @@
 
 	yaffs_VerifyFreeChunks(dev);
 	yaffs_VerifyBlocks(dev);
-	
+
 
 	T(YAFFS_TRACE_TRACING,
 	  (TSTR("yaffs: yaffs_GutsInitialise() done.\n" TENDSTR)));
@@ -7416,7 +7416,7 @@
 #endif
 
 	nFree += dev->nDeletedFiles;
-	
+
 	/* Now count the number of dirty chunks in the cache and subtract those */
 
 	{
@@ -7430,12 +7430,12 @@
 	nFree -= nDirtyCacheChunks;
 
 	nFree -= ((dev->nReservedBlocks + 1) * dev->nChunksPerBlock);
-	
+
 	/* Now we figure out how much to reserve for the checkpoint and report that... */
 	blocksForCheckpoint = dev->nCheckpointReservedBlocks - dev->blocksInCheckpoint;
 	if(blocksForCheckpoint < 0)
 		blocksForCheckpoint = 0;
-		
+
 	nFree -= (blocksForCheckpoint * dev->nChunksPerBlock);
 
 	if (nFree < 0)
@@ -7451,10 +7451,10 @@
 {
 	int counted;
 	int difference;
-	
+
 	if(yaffs_SkipVerification(dev))
 		return;
-	
+
 	counted = yaffs_CountFreeChunks(dev);
 
 	difference = dev->nFreeChunks - counted;
@@ -7470,11 +7470,11 @@
 /*---------------------------------------- YAFFS test code ----------------------*/
 
 #define yaffs_CheckStruct(structure,syze, name) \
-           if(sizeof(structure) != syze) \
+	   if(sizeof(structure) != syze) \
 	       { \
-	         T(YAFFS_TRACE_ALWAYS,(TSTR("%s should be %d but is %d\n" TENDSTR),\
+		 T(YAFFS_TRACE_ALWAYS,(TSTR("%s should be %d but is %d\n" TENDSTR),\
 		 name,syze,sizeof(structure))); \
-	         return YAFFS_FAIL; \
+		 return YAFFS_FAIL; \
 		}
 
 static int yaffs_CheckStructures(void)
diff --git a/fs/yaffs2/yaffs_guts.h b/fs/yaffs2/yaffs_guts.h
index ecf701f..1f75efd 100644
--- a/fs/yaffs2/yaffs_guts.h
+++ b/fs/yaffs2/yaffs_guts.h
@@ -1,5 +1,5 @@
 /*
- * YAFFS: Yet another Flash File System . A NAND-flash specific file system. 
+ * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
  *
  * Copyright (C) 2002-2007 Aleph One Ltd.
  *   for Toby Churchill Ltd and Brightstar Engineering
@@ -22,11 +22,11 @@
 #define YAFFS_OK	1
 #define YAFFS_FAIL  0
 
-/* Give us a  Y=0x59, 
- * Give us an A=0x41, 
- * Give us an FF=0xFF 
+/* Give us a  Y=0x59,
+ * Give us an A=0x41,
+ * Give us an FF=0xFF
  * Give us an S=0x53
- * And what have we got... 
+ * And what have we got...
  */
 #define YAFFS_MAGIC			0x5941FF53
 
@@ -102,7 +102,7 @@
  * The range is limited slightly to help distinguish bad numbers from good.
  * This also allows us to perhaps in the future use special numbers for
  * special purposes.
- * EFFFFF00 allows the allocation of 8 blocks per second (~1Mbytes) for 15 years, 
+ * EFFFFF00 allows the allocation of 8 blocks per second (~1Mbytes) for 15 years,
  * and is a larger number than the lifetime of a 2GB device.
  */
 #define YAFFS_LOWEST_SEQUENCE_NUMBER	0x00001000
@@ -178,7 +178,7 @@
 
 	/* The following stuff only has meaning when we read */
 	yaffs_ECCResult eccResult;
-	unsigned blockBad;	
+	unsigned blockBad;
 
 	/* YAFFS 1 stuff */
 	unsigned chunkDeleted;	/* The chunk is marked deleted */
@@ -244,29 +244,29 @@
 	/* This block is empty */
 
 	YAFFS_BLOCK_STATE_ALLOCATING,
-	/* This block is partially allocated. 
+	/* This block is partially allocated.
 	 * At least one page holds valid data.
 	 * This is the one currently being used for page
 	 * allocation. Should never be more than one of these
 	 */
 
-	YAFFS_BLOCK_STATE_FULL,	
+	YAFFS_BLOCK_STATE_FULL,
 	/* All the pages in this block have been allocated.
 	 */
 
 	YAFFS_BLOCK_STATE_DIRTY,
-	/* All pages have been allocated and deleted. 
+	/* All pages have been allocated and deleted.
 	 * Erase me, reuse me.
 	 */
 
-	YAFFS_BLOCK_STATE_CHECKPOINT,	
+	YAFFS_BLOCK_STATE_CHECKPOINT,
 	/* This block is assigned to holding checkpoint data.
 	 */
 
-	YAFFS_BLOCK_STATE_COLLECTING,	
+	YAFFS_BLOCK_STATE_COLLECTING,
 	/* This block is being garbage collected */
 
-	YAFFS_BLOCK_STATE_DEAD	
+	YAFFS_BLOCK_STATE_DEAD
 	/* This block has failed and is not in use */
 } yaffs_BlockState;
 
@@ -279,11 +279,11 @@
 	int pagesInUse:10;	/* number of pages in use */
 	unsigned blockState:4;	/* One of the above block states. NB use unsigned because enum is sometimes an int */
 	__u32 needsRetiring:1;	/* Data has failed on this block, need to get valid data off */
-                        	/* and retire the block. */
+				/* and retire the block. */
 	__u32 skipErasedCheck: 1; /* If this is set we can skip the erased check on this block */
-	__u32 gcPrioritise: 1; 	/* An ECC check or blank check has failed on this block. 
+	__u32 gcPrioritise: 1; 	/* An ECC check or blank check has failed on this block.
 				   It should be prioritised for GC */
-        __u32 chunkErrorStrikes:3; /* How many times we've had ecc etc failures on this block and tried to reuse it */
+	__u32 chunkErrorStrikes:3; /* How many times we've had ecc etc failures on this block and tried to reuse it */
 
 #ifdef CONFIG_YAFFS_YAFFS2
 	__u32 hasShrinkHeader:1; /* This block has at least one shrink object header */
@@ -408,7 +408,7 @@
 	__u8 renameAllowed:1;	/* Some objects are not allowed to be renamed. */
 	__u8 unlinkAllowed:1;
 	__u8 dirty:1;		/* the object needs to be written to flash */
-	__u8 valid:1;		/* When the file system is being loaded up, this 
+	__u8 valid:1;		/* When the file system is being loaded up, this
 				 * object might be created before the data
 				 * is available (ie. file data records appear before the header).
 				 */
@@ -430,11 +430,11 @@
 
 	/* directory structure stuff */
 	/* also used for linking up the free list */
-	struct yaffs_ObjectStruct *parent; 
+	struct yaffs_ObjectStruct *parent;
 	struct list_head siblings;
 
 	/* Where's my object header in NAND? */
-	int chunkId;		
+	int chunkId;
 
 	int nDataChunks;	/* Number of data chunks attached to the file. */
 
@@ -491,26 +491,26 @@
 } yaffs_ObjectBucket;
 
 
-/* yaffs_CheckpointObject holds the definition of an object as dumped 
+/* yaffs_CheckpointObject holds the definition of an object as dumped
  * by checkpointing.
  */
 
 typedef struct {
-        int structType;
-	__u32 objectId;		
+	int structType;
+	__u32 objectId;
 	__u32 parentId;
 	int chunkId;
-			
+
 	yaffs_ObjectType variantType:3;
-	__u8 deleted:1;		
-	__u8 softDeleted:1;	
-	__u8 unlinked:1;	
-	__u8 fake:1;		
+	__u8 deleted:1;
+	__u8 softDeleted:1;
+	__u8 unlinked:1;
+	__u8 fake:1;
 	__u8 renameAllowed:1;
 	__u8 unlinkAllowed:1;
-	__u8 serial;		
-	
-	int nDataChunks;	
+	__u8 serial;
+
+	int nDataChunks;
 	__u32 fileSizeOrEquivalentObjectId;
 
 }yaffs_CheckpointObject;
@@ -540,16 +540,16 @@
 	int endBlock;		/* End block we're allowed to use */
 	int nReservedBlocks;	/* We want this tuneable so that we can reduce */
 				/* reserved blocks on NOR and RAM. */
-	
-	
+
+
 	/* Stuff used by the shared space checkpointing mechanism */
 	/* If this value is zero, then this mechanism is disabled */
-	
+
 	int nCheckpointReservedBlocks; /* Blocks to reserve for checkpoint data */
 
-	
 
 
+
 	int nShortOpCaches;	/* If <= 0, then short op caching is disabled, else
 				 * the number of short op caches (don't use too many)
 				 */
@@ -561,8 +561,8 @@
 	void *genericDevice;	/* Pointer to device context
 				 * On an mtd this holds the mtd pointer.
 				 */
-        void *superBlock;
-        
+	void *superBlock;
+
 	/* NAND access functions (Must be set before calling YAFFS)*/
 
 	int (*writeChunkToNAND) (struct yaffs_DeviceStruct * dev,
@@ -588,21 +588,21 @@
 #endif
 
 	int isYaffs2;
-	
-	/* The removeObjectCallback function must be supplied by OS flavours that 
+
+	/* The removeObjectCallback function must be supplied by OS flavours that
 	 * need it. The Linux kernel does not use this, but yaffs direct does use
 	 * it to implement the faster readdir
 	 */
 	void (*removeObjectCallback)(struct yaffs_ObjectStruct *obj);
-	
+
 	/* Callback to mark the superblock dirsty */
 	void (*markSuperBlockDirty)(void * superblock);
-	
+
 	int wideTnodesDisabled; /* Set to disable wide tnodes */
-	
+
 
 	/* End of stuff that must be set before initialisation. */
-	
+
 	/* Checkpoint control. Can be set before or after initialisation */
 	__u8 skipCheckpointRead;
 	__u8 skipCheckpointWrite;
@@ -611,21 +611,21 @@
 
 	__u16 chunkGroupBits;	/* 0 for devices <= 32MB. else log2(nchunks) - 16 */
 	__u16 chunkGroupSize;	/* == 2^^chunkGroupBits */
-	
+
 	/* Stuff to support wide tnodes */
 	__u32 tnodeWidth;
 	__u32 tnodeMask;
-	
+
 	/* Stuff to support various file offses to chunk/offset translations */
 	/* "Crumbs" for nDataBytesPerChunk not being a power of 2 */
 	__u32 crumbMask;
 	__u32 crumbShift;
 	__u32 crumbsPerChunk;
-	
+
 	/* Straight shifting for nDataBytesPerChunk being a power of 2 */
 	__u32 chunkShift;
 	__u32 chunkMask;
-	
+
 
 /* XXX U-BOOT XXX */
 #if 0
@@ -636,12 +636,12 @@
 	void (*putSuperFunc) (struct super_block * sb);
 #endif
 #endif
-	__u8 *spareBuffer;	/* For mtdif2 use. Don't know the size of the buffer 
+	__u8 *spareBuffer;	/* For mtdif2 use. Don't know the size of the buffer
 				 * at compile time so we have to allocate it.
 				 */
 
 	int isMounted;
-	
+
 	int isCheckpointed;
 
 
@@ -650,7 +650,7 @@
 	int internalEndBlock;
 	int blockOffset;
 	int chunkOffset;
-	
+
 
 	/* Runtime checkpointing stuff */
 	int checkpointPageSequence;   /* running sequence number of checkpoint pages */
@@ -666,13 +666,13 @@
 	int checkpointMaxBlocks;
 	__u32 checkpointSum;
 	__u32 checkpointXor;
-	
+
 	/* Block Info */
 	yaffs_BlockInfo *blockInfo;
 	__u8 *chunkBits;	/* bitmap of chunks in use */
 	unsigned blockInfoAlt:1;	/* was allocated using alternative strategy */
 	unsigned chunkBitsAlt:1;	/* was allocated using alternative strategy */
-	int chunkBitmapStride;	/* Number of bytes of chunkBits per block. 
+	int chunkBitmapStride;	/* Number of bytes of chunkBits per block.
 				 * Must be consistent with nChunksPerBlock.
 				 */
 
@@ -720,7 +720,7 @@
 	int tagsEccUnfixed;
 	int nDeletions;
 	int nUnmarkedDeletions;
-	
+
 	int hasPendingPrioritisedGCs; /* We think this device might have pending prioritised gcs */
 
 	/* Special directories */
@@ -731,7 +731,7 @@
 	 *      __u8            bufferedData[YAFFS_CHUNKS_PER_BLOCK][YAFFS_BYTES_PER_CHUNK];
 	 *      yaffs_Spare bufferedSpare[YAFFS_CHUNKS_PER_BLOCK];
 	 */
-	
+
 	int bufferedBlock;	/* Which block is buffered here? */
 	int doingBufferedBlockRewrite;
 
@@ -764,7 +764,7 @@
 
 /* The static layout of bllock usage etc is stored in the super block header */
 typedef struct {
-        int StructType;
+	int StructType;
 	int version;
 	int checkpointStartBlock;
 	int checkpointEndBlock;
@@ -772,12 +772,12 @@
 	int endBlock;
 	int rfu[100];
 } yaffs_SuperBlockHeader;
-	
+
 /* The CheckpointDevice structure holds the device information that changes at runtime and
  * must be preserved over unmount/mount cycles.
  */
 typedef struct {
-        int structType;
+	int structType;
 	int nErasedBlocks;
 	int allocationBlock;	/* Current block being allocated off */
 	__u32 allocationPage;
diff --git a/fs/yaffs2/yaffs_malloc.h b/fs/yaffs2/yaffs_malloc.h
index 122fb4c..3ed6175 100644
--- a/fs/yaffs2/yaffs_malloc.h
+++ b/fs/yaffs2/yaffs_malloc.h
@@ -1,6 +1,6 @@
 #ifndef __YAFFS_MALLOC_H__
 /*
- * YAFFS: Yet another Flash File System . A NAND-flash specific file system. 
+ * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
  *
  * Copyright (C) 2002-2007 Aleph One Ltd.
  *   for Toby Churchill Ltd and Brightstar Engineering
@@ -13,14 +13,13 @@
  *
  * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
  */
- 
+
 /* XXX U-BOOT XXX */
 #if 0
 #include <stdlib.h>
-#endif 
+#endif
 
-void *yaffs_malloc(size_t size); 
+void *yaffs_malloc(size_t size);
 void yaffs_free(void *ptr);
- 
-#endif
 
+#endif
diff --git a/fs/yaffs2/yaffs_mtdif.c b/fs/yaffs2/yaffs_mtdif.c
index 407ef2b..d0e16d0 100644
--- a/fs/yaffs2/yaffs_mtdif.c
+++ b/fs/yaffs2/yaffs_mtdif.c
@@ -175,7 +175,7 @@
 	__u8 *spareAsBytes = (__u8 *) spare;
 
 	if (data && spare) {
-		if (dev->useNANDECC) {	
+		if (dev->useNANDECC) {
 			/* Careful, this call adds 2 ints */
 			/* to the end of the spare data.  Calling function */
 			/* should allocate enough memory for spare, */
diff --git a/fs/yaffs2/yaffs_mtdif.h b/fs/yaffs2/yaffs_mtdif.h
index f75e08c..317600c 100644
--- a/fs/yaffs2/yaffs_mtdif.h
+++ b/fs/yaffs2/yaffs_mtdif.h
@@ -1,5 +1,5 @@
 /*
- * YAFFS: Yet another Flash File System . A NAND-flash specific file system. 
+ * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
  *
  * Copyright (C) 2002-2007 Aleph One Ltd.
  *   for Toby Churchill Ltd and Brightstar Engineering
diff --git a/fs/yaffs2/yaffs_mtdif2.c b/fs/yaffs2/yaffs_mtdif2.c
index cd2a2a1..f569b99 100644
--- a/fs/yaffs2/yaffs_mtdif2.c
+++ b/fs/yaffs2/yaffs_mtdif2.c
@@ -162,7 +162,7 @@
 
 	if (tags)
 		yaffs_UnpackTags2(tags, &pt);
-	
+
 	if(tags && retval == -EBADMSG && tags->eccResult == YAFFS_ECC_RESULT_NO_ERROR)
 		tags->eccResult = YAFFS_ECC_RESULT_UNFIXED;
 
diff --git a/fs/yaffs2/yaffs_mtdif2.h b/fs/yaffs2/yaffs_mtdif2.h
index e70d751..b67ba52 100644
--- a/fs/yaffs2/yaffs_mtdif2.h
+++ b/fs/yaffs2/yaffs_mtdif2.h
@@ -1,5 +1,5 @@
 /*
- * YAFFS: Yet another Flash File System . A NAND-flash specific file system. 
+ * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
  *
  * Copyright (C) 2002-2007 Aleph One Ltd.
  *   for Toby Churchill Ltd and Brightstar Engineering
diff --git a/fs/yaffs2/yaffs_nand.c b/fs/yaffs2/yaffs_nand.c
index b201655..e790be6 100644
--- a/fs/yaffs2/yaffs_nand.c
+++ b/fs/yaffs2/yaffs_nand.c
@@ -10,7 +10,7 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
- 
+
 /* XXX U-BOOT XXX */
 #include <common.h>
 
@@ -28,9 +28,9 @@
 {
 	int result;
 	yaffs_ExtendedTags localTags;
-	
+
 	int realignedChunkInNAND = chunkInNAND - dev->chunkOffset;
-	
+
 	/* If there are no tags provided, use local tags to get prioritised gc working */
 	if(!tags)
 		tags = &localTags;
@@ -42,14 +42,14 @@
 		result = yaffs_TagsCompatabilityReadChunkWithTagsFromNAND(dev,
 									realignedChunkInNAND,
 									buffer,
-									tags);	
-	if(tags && 
+									tags);
+	if(tags &&
 	   tags->eccResult > YAFFS_ECC_RESULT_NO_ERROR){
-	
+
 		yaffs_BlockInfo *bi = yaffs_GetBlockInfo(dev, chunkInNAND/dev->nChunksPerBlock);
-                yaffs_HandleChunkError(dev,bi);
+		yaffs_HandleChunkError(dev,bi);
 	}
-								
+
 	return result;
 }
 
@@ -60,7 +60,7 @@
 {
 	chunkInNAND -= dev->chunkOffset;
 
-	
+
 	if (tags) {
 		tags->sequenceNumber = dev->sequenceNumber;
 		tags->chunkUsed = 1;
diff --git a/fs/yaffs2/yaffs_nand.h b/fs/yaffs2/yaffs_nand.h
index 8ed1a2d..48e3f7e 100644
--- a/fs/yaffs2/yaffs_nand.h
+++ b/fs/yaffs2/yaffs_nand.h
@@ -1,5 +1,5 @@
 /*
- * YAFFS: Yet another Flash File System . A NAND-flash specific file system. 
+ * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
  *
  * Copyright (C) 2002-2007 Aleph One Ltd.
  *   for Toby Churchill Ltd and Brightstar Engineering
@@ -41,4 +41,3 @@
 int yaffs_InitialiseNAND(struct yaffs_DeviceStruct *dev);
 
 #endif
-
diff --git a/fs/yaffs2/yaffs_nandemul2k.h b/fs/yaffs2/yaffs_nandemul2k.h
index 13520e1..cd2e96f 100644
--- a/fs/yaffs2/yaffs_nandemul2k.h
+++ b/fs/yaffs2/yaffs_nandemul2k.h
@@ -1,5 +1,5 @@
 /*
- * YAFFS: Yet another Flash File System . A NAND-flash specific file system. 
+ * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
  *
  * Copyright (C) 2002-2007 Aleph One Ltd.
  *   for Toby Churchill Ltd and Brightstar Engineering
diff --git a/fs/yaffs2/yaffs_packedtags1.h b/fs/yaffs2/yaffs_packedtags1.h
index 627b2f8..776c5c2 100644
--- a/fs/yaffs2/yaffs_packedtags1.h
+++ b/fs/yaffs2/yaffs_packedtags1.h
@@ -1,5 +1,5 @@
 /*
- * YAFFS: Yet another Flash File System . A NAND-flash specific file system. 
+ * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
  *
  * Copyright (C) 2002-2007 Aleph One Ltd.
  *   for Toby Churchill Ltd and Brightstar Engineering
diff --git a/fs/yaffs2/yaffs_packedtags2.c b/fs/yaffs2/yaffs_packedtags2.c
index 467d5ac..4744009 100644
--- a/fs/yaffs2/yaffs_packedtags2.c
+++ b/fs/yaffs2/yaffs_packedtags2.c
@@ -131,10 +131,10 @@
 						  (yaffs_PackedTags2TagsPart),
 						  &pt->ecc, &ecc);
 			switch(result){
-				case 0: 
-					t->eccResult = YAFFS_ECC_RESULT_NO_ERROR; 
+				case 0:
+					t->eccResult = YAFFS_ECC_RESULT_NO_ERROR;
 					break;
-				case 1: 
+				case 1:
 					t->eccResult = YAFFS_ECC_RESULT_FIXED;
 					break;
 				case -1:
diff --git a/fs/yaffs2/yaffs_packedtags2.h b/fs/yaffs2/yaffs_packedtags2.h
index 7c4a72c..c2242ff 100644
--- a/fs/yaffs2/yaffs_packedtags2.h
+++ b/fs/yaffs2/yaffs_packedtags2.h
@@ -1,5 +1,5 @@
 /*
- * YAFFS: Yet another Flash File System . A NAND-flash specific file system. 
+ * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
  *
  * Copyright (C) 2002-2007 Aleph One Ltd.
  *   for Toby Churchill Ltd and Brightstar Engineering
diff --git a/fs/yaffs2/yaffs_qsort.c b/fs/yaffs2/yaffs_qsort.c
index a74709f..4d56f96 100644
--- a/fs/yaffs2/yaffs_qsort.c
+++ b/fs/yaffs2/yaffs_qsort.c
@@ -44,7 +44,7 @@
 		register TYPE	t = *pi;		\
 		*pi++ = *pj;				\
 		*pj++ = t;				\
-        } while (--i > 0);				\
+	} while (--i > 0);				\
 }
 
 #define SWAPINIT(a, es) swaptype = ((char *)a - (char *)0) % sizeof(long) || \
@@ -53,7 +53,7 @@
 static __inline void
 swapfunc(char *a, char *b, int n, int swaptype)
 {
-	if (swaptype <= 1) 
+	if (swaptype <= 1)
 		swapcode(long, a, b, n)
 	else
 		swapcode(char, a, b, n)
@@ -74,7 +74,7 @@
 {
 	return cmp(a, b) < 0 ?
 	       (cmp(b, c) < 0 ? b : (cmp(a, c) < 0 ? c : a ))
-              :(cmp(b, c) > 0 ? b : (cmp(a, c) < 0 ? a : c ));
+	      :(cmp(b, c) > 0 ? b : (cmp(a, c) < 0 ? a : c ));
 }
 
 #ifndef min
@@ -140,7 +140,7 @@
 	}
 	if (swap_cnt == 0) {  /* Switch to insertion sort */
 		for (pm = (char *) a + es; pm < (char *) a + n * es; pm += es)
-			for (pl = pm; pl > (char *) a && cmp(pl - es, pl) > 0; 
+			for (pl = pm; pl > (char *) a && cmp(pl - es, pl) > 0;
 			     pl -= es)
 				swap(pl, pl - es);
 		return;
@@ -153,7 +153,7 @@
 	vecswap(pb, pn - r, r);
 	if ((r = pb - pa) > es)
 		yaffs_qsort(a, r / es, es, cmp);
-	if ((r = pd - pc) > es) { 
+	if ((r = pd - pc) > es) {
 		/* Iterate rather than recurse to save stack space */
 		a = pn - r;
 		n = r / es;
diff --git a/fs/yaffs2/yaffs_qsort.h b/fs/yaffs2/yaffs_qsort.h
index 3ec7397..19083da 100644
--- a/fs/yaffs2/yaffs_qsort.h
+++ b/fs/yaffs2/yaffs_qsort.h
@@ -1,5 +1,5 @@
 /*
- * YAFFS: Yet another Flash File System . A NAND-flash specific file system. 
+ * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
  *
  * Copyright (C) 2002-2007 Aleph One Ltd.
  *   for Toby Churchill Ltd and Brightstar Engineering
@@ -18,6 +18,6 @@
 #define __YAFFS_QSORT_H__
 
 extern void yaffs_qsort (void *const base, size_t total_elems, size_t size,
-                   int (*cmp)(const void *, const void *));
+		   int (*cmp)(const void *, const void *));
 
 #endif
diff --git a/fs/yaffs2/yaffs_ramdisk.h b/fs/yaffs2/yaffs_ramdisk.h
index 045ab42..3cff8be 100644
--- a/fs/yaffs2/yaffs_ramdisk.h
+++ b/fs/yaffs2/yaffs_ramdisk.h
@@ -1,5 +1,5 @@
 /*
- * YAFFS: Yet another Flash File System . A NAND-flash specific file system. 
+ * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
  *
  * Copyright (C) 2002-2007 Aleph One Ltd.
  *   for Toby Churchill Ltd and Brightstar Engineering
diff --git a/fs/yaffs2/yaffs_tagscompat.h b/fs/yaffs2/yaffs_tagscompat.h
index c1edb6a..a61e3ba 100644
--- a/fs/yaffs2/yaffs_tagscompat.h
+++ b/fs/yaffs2/yaffs_tagscompat.h
@@ -1,5 +1,5 @@
 /*
- * YAFFS: Yet another Flash File System . A NAND-flash specific file system. 
+ * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
  *
  * Copyright (C) 2002-2007 Aleph One Ltd.
  *   for Toby Churchill Ltd and Brightstar Engineering
diff --git a/fs/yaffs2/yaffs_tagsvalidity.h b/fs/yaffs2/yaffs_tagsvalidity.h
index ba56727..2fd0c24 100644
--- a/fs/yaffs2/yaffs_tagsvalidity.h
+++ b/fs/yaffs2/yaffs_tagsvalidity.h
@@ -1,5 +1,5 @@
 /*
- * YAFFS: Yet another Flash File System . A NAND-flash specific file system. 
+ * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
  *
  * Copyright (C) 2002-2007 Aleph One Ltd.
  *   for Toby Churchill Ltd and Brightstar Engineering
diff --git a/fs/yaffs2/yaffscfg.c b/fs/yaffs2/yaffscfg.c
index a4a0924..3beb34d 100644
--- a/fs/yaffs2/yaffscfg.c
+++ b/fs/yaffs2/yaffscfg.c
@@ -83,7 +83,7 @@
 // NB Though /boot and /flash occupy the same physical device they
 // are still disticnt "yaffs_Devices. You may think of these as "partitions"
 // using non-overlapping areas in the same device.
-// 
+//
 
 #include "yaffs_ramdisk.h"
 #include "yaffs_flashif.h"
@@ -124,7 +124,7 @@
 	// Stuff to configure YAFFS
 	// Stuff to initialise anything special (eg lock semaphore).
 	yaffsfs_LocalInitialisation();
-	
+
 	// Set up devices
 
 /* XXX U-BOOT XXX */
@@ -134,7 +134,7 @@
 	ramDev.nChunksPerBlock = 32;
 	ramDev.nReservedBlocks = 2; // Set this smaller for RAM
 	ramDev.startBlock = 1; // Can't use block 0
-	ramDev.endBlock = 127; // Last block in 2MB.	
+	ramDev.endBlock = 127; // Last block in 2MB.
 	ramDev.useNANDECC = 1;
 	ramDev.nShortOpCaches = 0;	// Disable caching on this device.
 	ramDev.genericDevice = (void *) 0;	// Used to identify the device in fstat.
@@ -148,7 +148,7 @@
 	bootDev.nChunksPerBlock = 32;
 	bootDev.nReservedBlocks = 5;
 	bootDev.startBlock = 1; // Can't use block 0
-	bootDev.endBlock = 127; // Last block in 2MB.	
+	bootDev.endBlock = 127; // Last block in 2MB.
 	bootDev.useNANDECC = 0; // use YAFFS's ECC
 	bootDev.nShortOpCaches = 10; // Use caches
 	bootDev.genericDevice = (void *) 1;	// Used to identify the device in fstat.
@@ -196,13 +196,13 @@
 		flashDev->nChunksPerBlock = YAFFS_CHUNKS_PER_BLOCK;
 		flashDev->nDataBytesPerChunk = YAFFS_BYTES_PER_CHUNK;
 	}
-	
+
 	/* ... and common functions */
 	flashDev->eraseBlockInNAND = nandmtd_EraseBlockInNAND;
 	flashDev->initialiseNAND = nandmtd_InitialiseNAND;
 
 	yaffs_initialise(yaffsfs_config);
-	
+
 	return 0;
 }
 
@@ -219,19 +219,19 @@
 		printf("Error opening file: %d\n", outh);
 		return;
 	}
-	
+
 	memset(buffer,bval,100);
-	
+
 	do{
 		i = sizeOfFile;
 		if(i > 100) i = 100;
 		sizeOfFile -= i;
-		
+
 		yaffs_write(outh,buffer,i);
-		
+
 	} while (sizeOfFile > 0);
-	
-		
+
+
 	yaffs_close(outh);
 }
 
@@ -252,7 +252,7 @@
 	{
 		printf("%02x ",b);
 		i++;
-		if(i > 32) 
+		if(i > 32)
 		{
 		   printf("\n");
 		   i = 0;;
@@ -305,7 +305,7 @@
 {
 	int h;
 	struct yaffs_stat s;
-	
+
 	checkMount();
 
 	yaffs_stat(fn,&s);
@@ -317,7 +317,7 @@
 		printf("File not found\n");
 		return;
 	}
-				
+
 	yaffs_read(h,addr,(int)s.st_size);
 	printf("\t[DONE]\n");
 
@@ -335,9 +335,9 @@
 	{
 		printf("Error opening file: %d\n", outh);
 	}
-	
+
 	yaffs_write(outh,addr,size);
-	
+
 	yaffs_close(outh);
 }
 
@@ -381,7 +381,7 @@
 	checkMount();
 
 	int retval = yaffs_mkdir(dir, 0);
-	
+
 	if ( retval < 0)
 		printf("yaffs_mkdir returning error: %d\n", retval);
 }
@@ -391,7 +391,7 @@
 	checkMount();
 
 	int retval = yaffs_rmdir(dir);
-	
+
 	if ( retval < 0)
 		printf("yaffs_rmdir returning error: %d\n", retval);
 }
@@ -401,7 +401,7 @@
 	checkMount();
 
 	int retval = yaffs_unlink(path);
-	
+
 	if ( retval < 0)
 		printf("yaffs_unlink returning error: %d\n", retval);
 }
@@ -411,7 +411,7 @@
 	checkMount();
 
 	int retval = yaffs_rename(newPath, oldPath);
-	
+
 	if ( retval < 0)
 		printf("yaffs_unlink returning error: %d\n", retval);
 }
diff --git a/fs/yaffs2/yaffscfg.h b/fs/yaffs2/yaffscfg.h
index 6ae1696..3503dc8 100644
--- a/fs/yaffs2/yaffscfg.h
+++ b/fs/yaffs2/yaffscfg.h
@@ -1,5 +1,5 @@
 /*
- * YAFFS: Yet another Flash File System . A NAND-flash specific file system. 
+ * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
  *
  * Copyright (C) 2002-2007 Aleph One Ltd.
  *   for Toby Churchill Ltd and Brightstar Engineering
@@ -43,4 +43,3 @@
 int yaffsfs_GetError(void);
 
 #endif
-
diff --git a/fs/yaffs2/yaffsfs.c b/fs/yaffs2/yaffsfs.c
index f62c952..111cb34 100644
--- a/fs/yaffs2/yaffsfs.c
+++ b/fs/yaffs2/yaffsfs.c
@@ -10,7 +10,7 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
- 
+
 /* XXX U-BOOT XXX */
 #include <common.h>
 #include <malloc.h>
@@ -44,7 +44,7 @@
 
 
 // Handle management.
-// 
+//
 
 
 unsigned int yaffs_wr_attempts;
@@ -82,7 +82,7 @@
 	{
 		return NULL;
 	}
-	
+
 	return &yaffsfs_handle[h];
 }
 
@@ -94,7 +94,7 @@
 	{
 		return h->obj;
 	}
-	
+
 	return NULL;
 }
 
@@ -107,7 +107,7 @@
 {
 	int i;
 	yaffsfs_Handle *h;
-	
+
 	for(i = 0; i < YAFFSFS_N_HANDLES; i++)
 	{
 		h = yaffsfs_GetHandlePointer(i);
@@ -131,7 +131,7 @@
 static int yaffsfs_PutHandle(int handle)
 {
 	yaffsfs_Handle *h = yaffsfs_GetHandlePointer(handle);
-	
+
 	if(h)
 	{
 		h->inUse = 0;
@@ -164,7 +164,7 @@
 	yaffs_Device *retval = NULL;
 	int thisMatchLength;
 	int longestMatch = -1;
-	
+
 	// Check all configs, choose the one that:
 	// 1) Actually matches a prefix (ie /a amd /abc will not match
 	// 2) Matches the longest.
@@ -173,10 +173,10 @@
 		leftOver = path;
 		p = cfg->prefix;
 		thisMatchLength = 0;
-		
-		while(*p &&  //unmatched part of prefix 
+
+		while(*p &&  //unmatched part of prefix
 		      strcmp(p,"/") && // the rest of the prefix is not / (to catch / at end)
-		      *leftOver && 
+		      *leftOver &&
 		      yaffsfs_Match(*p,*leftOver))
 		{
 			p++;
@@ -201,7 +201,7 @@
 {
 
 	yaffs_Device *dev;
-	
+
 	dev= yaffsfs_FindDevice(path,restOfPath);
 	if(dev && dev->isMounted)
 	{
@@ -216,7 +216,7 @@
 	while(obj && obj->variantType == YAFFS_OBJECT_TYPE_SYMLINK)
 	{
 		char *alias = obj->variant.symLinkVariant.alias;
-						
+
 		if(*alias == '/')
 		{
 			// Starts with a /, need to scan from root up
@@ -242,12 +242,12 @@
 	char *restOfPath;
 	char str[YAFFS_MAX_NAME_LENGTH+1];
 	int i;
-	
+
 	if(symDepth > YAFFSFS_MAX_SYMLINK_DEREFERENCES)
 	{
 		return NULL;
 	}
-	
+
 	if(startDir)
 	{
 		dir = startDir;
@@ -257,20 +257,20 @@
 	{
 		dir = yaffsfs_FindRoot(path,&restOfPath);
 	}
-	
+
 	while(dir)
-	{	
+	{
 		// parse off /.
-		// curve ball: also throw away surplus '/' 
+		// curve ball: also throw away surplus '/'
 		// eg. "/ram/x////ff" gets treated the same as "/ram/x/ff"
 		while(*restOfPath == '/')
 		{
 			restOfPath++; // get rid of '/'
 		}
-		
+
 		*name = restOfPath;
 		i = 0;
-		
+
 		while(*restOfPath && *restOfPath != '/')
 		{
 			if (i < YAFFS_MAX_NAME_LENGTH)
@@ -281,7 +281,7 @@
 			}
 			restOfPath++;
 		}
-		
+
 		if(!*restOfPath)
 		{
 			// got to the end of the string
@@ -300,14 +300,14 @@
 			else
 			{
 				dir = yaffs_FindObjectByName(dir,str);
-				
+
 				while(dir && dir->variantType == YAFFS_OBJECT_TYPE_SYMLINK)
 				{
-				
+
 					dir = yaffsfs_FollowLink(dir,symDepth);
-		
+
 				}
-				
+
 				if(dir && dir->variantType != YAFFS_OBJECT_TYPE_DIRECTORY)
 				{
 					dir = NULL;
@@ -325,19 +325,19 @@
 }
 
 // yaffsfs_FindObject turns a path for an existing object into the object
-// 
+//
 static yaffs_Object *yaffsfs_FindObject(yaffs_Object *relativeDirectory, const char *path,int symDepth)
 {
 	yaffs_Object *dir;
 	char *name;
-	
+
 	dir = yaffsfs_FindDirectory(relativeDirectory,path,&name,symDepth);
-	
+
 	if(dir && *name)
 	{
 		return yaffs_FindObjectByName(dir,name);
 	}
-	
+
 	return dir;
 }
 
@@ -355,29 +355,29 @@
 	int openDenied = 0;
 	int symDepth = 0;
 	int errorReported = 0;
-	
+
 	int i;
-	
-	
+
+
 	// todo sanity check oflag (eg. can't have O_TRUNC without WRONLY or RDWR
-	
-	
+
+
 	yaffsfs_Lock();
-	
+
 	handle = yaffsfs_GetHandle();
-	
+
 	if(handle >= 0)
 	{
 
 		h = yaffsfs_GetHandlePointer(handle);
-	
-	
+
+
 		// try to find the exisiting object
 		obj = yaffsfs_FindObject(NULL,path,0);
-		
+
 		if(obj && obj->variantType == YAFFS_OBJECT_TYPE_SYMLINK)
 		{
-		
+
 			obj = yaffsfs_FollowLink(obj,symDepth++);
 		}
 
@@ -385,10 +385,10 @@
 		{
 			// Check if the object is already in use
 			alreadyOpen = alreadyExclusive = 0;
-			
+
 			for(i = 0; i <= YAFFSFS_N_HANDLES; i++)
 			{
-				
+
 				if(i != handle &&
 				   yaffsfs_handle[i].inUse &&
 				    obj == yaffsfs_handle[i].obj)
@@ -405,7 +405,7 @@
 			{
 				openDenied = 1;
 			}
-			
+
 			// Open should fail if O_CREAT and O_EXCL are specified
 			if((oflag & O_EXCL) && (oflag & O_CREAT))
 			{
@@ -413,7 +413,7 @@
 				yaffsfs_SetError(-EEXIST);
 				errorReported = 1;
 			}
-			
+
 			// Check file permissions
 			if( (oflag & (O_RDWR | O_WRONLY)) == 0 &&     // ie O_RDONLY
 			   !(obj->yst_mode & S_IREAD))
@@ -421,34 +421,34 @@
 				openDenied = 1;
 			}
 
-			if( (oflag & O_RDWR) && 
+			if( (oflag & O_RDWR) &&
 			   !(obj->yst_mode & S_IREAD))
 			{
 				openDenied = 1;
 			}
 
-			if( (oflag & (O_RDWR | O_WRONLY)) && 
+			if( (oflag & (O_RDWR | O_WRONLY)) &&
 			   !(obj->yst_mode & S_IWRITE))
 			{
 				openDenied = 1;
 			}
-			
+
 		}
-		
+
 		else if((oflag & O_CREAT))
 		{
 			// Let's see if we can create this file
 			dir = yaffsfs_FindDirectory(NULL,path,&name,0);
 			if(dir)
 			{
-				obj = yaffs_MknodFile(dir,name,mode,0,0);	
+				obj = yaffs_MknodFile(dir,name,mode,0,0);
 			}
 			else
 			{
 				yaffsfs_SetError(-ENOTDIR);
 			}
 		}
-		
+
 		if(obj && !openDenied)
 		{
 			h->obj = obj;
@@ -457,14 +457,14 @@
 			h->append =  (oflag & O_APPEND) ? 1 : 0;
 			h->exclusive = (oflag & O_EXCL) ? 1 : 0;
 			h->position = 0;
-			
+
 			obj->inUse++;
 			if((oflag & O_TRUNC) && !h->readOnly)
 			{
 				//todo truncate
 				yaffs_ResizeFile(obj,0);
 			}
-			
+
 		}
 		else
 		{
@@ -476,23 +476,23 @@
 			}
 			handle = -1;
 		}
-		
+
 	}
-	
+
 	yaffsfs_Unlock();
-	
-	return handle;		
+
+	return handle;
 }
 
 int yaffs_close(int fd)
 {
 	yaffsfs_Handle *h = NULL;
 	int retVal = 0;
-	
+
 	yaffsfs_Lock();
 
 	h = yaffsfs_GetHandlePointer(fd);
-	
+
 	if(h && h->inUse)
 	{
 		// clean up
@@ -508,12 +508,12 @@
 	else
 	{
 		// bad handle
-		yaffsfs_SetError(-EBADF);		
+		yaffsfs_SetError(-EBADF);
 		retVal = -1;
 	}
-	
+
 	yaffsfs_Unlock();
-	
+
 	return retVal;
 }
 
@@ -524,15 +524,15 @@
 	int pos = 0;
 	int nRead = -1;
 	int maxRead;
-	
+
 	yaffsfs_Lock();
 	h = yaffsfs_GetHandlePointer(fd);
 	obj = yaffsfs_GetHandleObject(fd);
-	
+
 	if(!h || !obj)
 	{
 		// bad handle
-		yaffsfs_SetError(-EBADF);		
+		yaffsfs_SetError(-EBADF);
 	}
 	else if( h && obj)
 	{
@@ -551,7 +551,7 @@
 			nbyte = maxRead;
 		}
 
-		
+
 		if(nbyte > 0)
 		{
 			nRead = yaffs_ReadDataFromFile(obj,buf,pos,nbyte);
@@ -568,14 +568,14 @@
 		{
 			nRead = 0;
 		}
-		
+
 	}
-	
+
 	yaffsfs_Unlock();
-	
-	
+
+
 	return (nRead >= 0) ? nRead : -1;
-		
+
 }
 
 int yaffs_write(int fd, const void *buf, unsigned int nbyte)
@@ -585,15 +585,15 @@
 	int pos = 0;
 	int nWritten = -1;
 	int writeThrough = 0;
-	
+
 	yaffsfs_Lock();
 	h = yaffsfs_GetHandlePointer(fd);
 	obj = yaffsfs_GetHandleObject(fd);
-	
+
 	if(!h || !obj)
 	{
 		// bad handle
-		yaffsfs_SetError(-EBADF);		
+		yaffsfs_SetError(-EBADF);
 	}
 	else if( h && obj && h->readOnly)
 	{
@@ -609,9 +609,9 @@
 		{
 			pos = h->position;
 		}
-		
+
 		nWritten = yaffs_WriteDataToFile(obj,buf,pos,nbyte,writeThrough);
-		
+
 		if(nWritten >= 0)
 		{
 			h->position = pos + nWritten;
@@ -620,12 +620,12 @@
 		{
 			//todo error
 		}
-		
+
 	}
-	
+
 	yaffsfs_Unlock();
-	
-	
+
+
 	return (nWritten >= 0) ? nWritten : -1;
 
 }
@@ -635,43 +635,43 @@
 	yaffsfs_Handle *h = NULL;
 	yaffs_Object *obj = NULL;
 	int result = 0;
-	
+
 	yaffsfs_Lock();
 	h = yaffsfs_GetHandlePointer(fd);
 	obj = yaffsfs_GetHandleObject(fd);
-	
+
 	if(!h || !obj)
 	{
 		// bad handle
-		yaffsfs_SetError(-EBADF);		
+		yaffsfs_SetError(-EBADF);
 	}
 	else
 	{
 		// resize the file
 		result = yaffs_ResizeFile(obj,newSize);
-	}	
+	}
 	yaffsfs_Unlock();
-	
-	
+
+
 	return (result) ? 0 : -1;
 
 }
 
-off_t yaffs_lseek(int fd, off_t offset, int whence) 
+off_t yaffs_lseek(int fd, off_t offset, int whence)
 {
 	yaffsfs_Handle *h = NULL;
 	yaffs_Object *obj = NULL;
 	int pos = -1;
 	int fSize = -1;
-	
+
 	yaffsfs_Lock();
 	h = yaffsfs_GetHandlePointer(fd);
 	obj = yaffsfs_GetHandleObject(fd);
-	
+
 	if(!h || !obj)
 	{
 		// bad handle
-		yaffsfs_SetError(-EBADF);		
+		yaffsfs_SetError(-EBADF);
 	}
 	else if(whence == SEEK_SET)
 	{
@@ -695,7 +695,7 @@
 			pos = fSize + offset;
 		}
 	}
-	
+
 	if(pos >= 0)
 	{
 		h->position = pos;
@@ -705,20 +705,20 @@
 		// todo error
 	}
 
-	
+
 	yaffsfs_Unlock();
-	
+
 	return pos;
 }
 
 
-int yaffsfs_DoUnlink(const char *path,int isDirectory) 
+int yaffsfs_DoUnlink(const char *path,int isDirectory)
 {
 	yaffs_Object *dir = NULL;
 	yaffs_Object *obj = NULL;
 	char *name;
 	int result = YAFFS_FAIL;
-	
+
 	yaffsfs_Lock();
 
 	obj = yaffsfs_FindObject(NULL,path,0);
@@ -742,25 +742,25 @@
 	else
 	{
 		result = yaffs_Unlink(dir,name);
-		
+
 		if(result == YAFFS_FAIL && isDirectory)
 		{
 			yaffsfs_SetError(-ENOTEMPTY);
 		}
 	}
-	
+
 	yaffsfs_Unlock();
-	
+
 	// todo error
-	
+
 	return (result == YAFFS_FAIL) ? -1 : 0;
 }
-int yaffs_rmdir(const char *path) 
+int yaffs_rmdir(const char *path)
 {
 	return yaffsfs_DoUnlink(path,1);
 }
 
-int yaffs_unlink(const char *path) 
+int yaffs_unlink(const char *path)
 {
 	return yaffsfs_DoUnlink(path,0);
 }
@@ -774,34 +774,34 @@
 	char *newname;
 	int result= YAFFS_FAIL;
 	int renameAllowed = 1;
-	
+
 	yaffsfs_Lock();
-	
+
 	olddir = yaffsfs_FindDirectory(NULL,oldPath,&oldname,0);
 	newdir = yaffsfs_FindDirectory(NULL,newPath,&newname,0);
 	obj = yaffsfs_FindObject(NULL,oldPath,0);
-	
+
 	if(!olddir || !newdir || !obj)
 	{
 		// bad file
-		yaffsfs_SetError(-EBADF);	
-		renameAllowed = 0;	
+		yaffsfs_SetError(-EBADF);
+		renameAllowed = 0;
 	}
 	else if(olddir->myDev != newdir->myDev)
 	{
 		// oops must be on same device
 		// todo error
 		yaffsfs_SetError(-EXDEV);
-		renameAllowed = 0;	
+		renameAllowed = 0;
 	}
 	else if(obj && obj->variantType == YAFFS_OBJECT_TYPE_DIRECTORY)
 	{
-		// It is a directory, check that it is not being renamed to 
+		// It is a directory, check that it is not being renamed to
 		// being its own decendent.
 		// Do this by tracing from the new directory back to the root, checking for obj
-		
+
 		yaffs_Object *xx = newdir;
-		
+
 		while( renameAllowed && xx)
 		{
 			if(xx == obj)
@@ -812,15 +812,15 @@
 		}
 		if(!renameAllowed) yaffsfs_SetError(-EACCESS);
 	}
-	
+
 	if(renameAllowed)
 	{
 		result = yaffs_RenameObject(olddir,oldname,newdir,newname);
 	}
-	
+
 	yaffsfs_Unlock();
-	
-	return (result == YAFFS_FAIL) ? -1 : 0;	
+
+	return (result == YAFFS_FAIL) ? -1 : 0;
 }
 
 
@@ -838,12 +838,12 @@
     	buf->st_dev = (int)obj->myDev->genericDevice;
     	buf->st_ino = obj->objectId;
     	buf->st_mode = obj->yst_mode & ~S_IFMT; // clear out file type bits
-	
-		if(obj->variantType == YAFFS_OBJECT_TYPE_DIRECTORY) 
+
+		if(obj->variantType == YAFFS_OBJECT_TYPE_DIRECTORY)
 		{
 			buf->st_mode |= S_IFDIR;
 		}
-		else if(obj->variantType == YAFFS_OBJECT_TYPE_SYMLINK) 
+		else if(obj->variantType == YAFFS_OBJECT_TYPE_SYMLINK)
 		{
 			buf->st_mode |= S_IFLNK;
 		}
@@ -851,17 +851,17 @@
 		{
 			buf->st_mode |= S_IFREG;
 		}
-		
+
     	buf->st_nlink = yaffs_GetObjectLinkCount(obj);
-    	buf->st_uid = 0;    
-    	buf->st_gid = 0;;     
+    	buf->st_uid = 0;
+    	buf->st_gid = 0;;
     	buf->st_rdev = obj->yst_rdev;
     	buf->st_size = yaffs_GetObjectFileLength(obj);
 		buf->st_blksize = obj->myDev->nDataBytesPerChunk;
     	buf->st_blocks = (buf->st_size + buf->st_blksize -1)/buf->st_blksize;
-    	buf->yst_atime = obj->yst_atime; 
-    	buf->yst_ctime = obj->yst_ctime; 
-    	buf->yst_mtime = obj->yst_mtime; 
+    	buf->yst_atime = obj->yst_atime;
+    	buf->yst_ctime = obj->yst_ctime;
+    	buf->yst_mtime = obj->yst_mtime;
 		retVal = 0;
 	}
 	return retVal;
@@ -870,17 +870,17 @@
 static int yaffsfs_DoStatOrLStat(const char *path, struct yaffs_stat *buf,int doLStat)
 {
 	yaffs_Object *obj;
-	
+
 	int retVal = -1;
-	
+
 	yaffsfs_Lock();
 	obj = yaffsfs_FindObject(NULL,path,0);
-	
+
 	if(!doLStat && obj)
 	{
 		obj = yaffsfs_FollowLink(obj,0);
 	}
-	
+
 	if(obj)
 	{
 		retVal = yaffsfs_DoStat(obj,buf);
@@ -890,11 +890,11 @@
 		// todo error not found
 		yaffsfs_SetError(-ENOENT);
 	}
-	
+
 	yaffsfs_Unlock();
-	
+
 	return retVal;
-	
+
 }
 
 int yaffs_stat(const char *path, struct yaffs_stat *buf)
@@ -910,12 +910,12 @@
 int yaffs_fstat(int fd, struct yaffs_stat *buf)
 {
 	yaffs_Object *obj;
-	
+
 	int retVal = -1;
-	
+
 	yaffsfs_Lock();
 	obj = yaffsfs_GetHandleObject(fd);
-	
+
 	if(obj)
 	{
 		retVal = yaffsfs_DoStat(obj,buf);
@@ -923,11 +923,11 @@
 	else
 	{
 		// bad handle
-		yaffsfs_SetError(-EBADF);		
+		yaffsfs_SetError(-EBADF);
 	}
-	
+
 	yaffsfs_Unlock();
-	
+
 	return retVal;
 }
 
@@ -939,14 +939,14 @@
 	{
 		obj = yaffs_GetEquivalentObject(obj);
 	}
-	
+
 	if(obj)
 	{
 		obj->yst_mode = mode;
 		obj->dirty = 1;
 		result = yaffs_FlushFile(obj,0);
 	}
-	
+
 	return result == YAFFS_OK ? 0 : -1;
 }
 
@@ -954,12 +954,12 @@
 int yaffs_chmod(const char *path, mode_t mode)
 {
 	yaffs_Object *obj;
-	
+
 	int retVal = -1;
-	
+
 	yaffsfs_Lock();
 	obj = yaffsfs_FindObject(NULL,path,0);
-	
+
 	if(obj)
 	{
 		retVal = yaffsfs_DoChMod(obj,mode);
@@ -969,23 +969,23 @@
 		// todo error not found
 		yaffsfs_SetError(-ENOENT);
 	}
-	
+
 	yaffsfs_Unlock();
-	
+
 	return retVal;
-	
+
 }
 
 
 int yaffs_fchmod(int fd, mode_t mode)
 {
 	yaffs_Object *obj;
-	
+
 	int retVal = -1;
-	
+
 	yaffsfs_Lock();
 	obj = yaffsfs_GetHandleObject(fd);
-	
+
 	if(obj)
 	{
 		retVal = yaffsfs_DoChMod(obj,mode);
@@ -993,11 +993,11 @@
 	else
 	{
 		// bad handle
-		yaffsfs_SetError(-EBADF);		
+		yaffsfs_SetError(-EBADF);
 	}
-	
+
 	yaffsfs_Unlock();
-	
+
 	return retVal;
 }
 
@@ -1008,7 +1008,7 @@
 	yaffs_Object *dir = NULL;
 	char *name;
 	int retVal= -1;
-	
+
 	yaffsfs_Lock();
 	parent = yaffsfs_FindDirectory(NULL,path,&name,0);
 	if(parent)
@@ -1022,9 +1022,9 @@
 		yaffsfs_SetError(-ENOSPC); // just assume no space for now
 		retVal = -1;
 	}
-	
+
 	yaffsfs_Unlock();
-	
+
 	return retVal;
 }
 
@@ -1034,9 +1034,9 @@
 	int result=YAFFS_FAIL;
 	yaffs_Device *dev=NULL;
 	char *dummy;
-	
+
 	T(YAFFS_TRACE_ALWAYS,("yaffs: Mounting %s\n",path));
-	
+
 	yaffsfs_Lock();
 	dev = yaffsfs_FindDevice(path,&dummy);
 	if(dev)
@@ -1050,7 +1050,7 @@
 				yaffsfs_SetError(-ENOMEM);
 			}
 			retVal = result ? 0 : -1;
-			
+
 		}
 		else
 		{
@@ -1065,7 +1065,7 @@
 	}
 	yaffsfs_Unlock();
 	return retVal;
-	
+
 }
 
 int yaffs_unmount(const char *path)
@@ -1073,7 +1073,7 @@
 	int retVal=-1;
 	yaffs_Device *dev=NULL;
 	char *dummy;
-	
+
 	yaffsfs_Lock();
 	dev = yaffsfs_FindDevice(path,&dummy);
 	if(dev)
@@ -1082,10 +1082,10 @@
 		{
 			int i;
 			int inUse;
-			
+
 			yaffs_FlushEntireDeviceCache(dev);
 			yaffs_CheckpointSave(dev);
-			
+
 			for(i = inUse = 0; i < YAFFSFS_N_HANDLES && !inUse; i++)
 			{
 				if(yaffsfs_handle[i].inUse && yaffsfs_handle[i].obj->myDev == dev)
@@ -1093,11 +1093,11 @@
 					inUse = 1; // the device is in use, can't unmount
 				}
 			}
-			
+
 			if(!inUse)
 			{
 				yaffs_Deinitialise(dev);
-					
+
 				retVal = 0;
 			}
 			else
@@ -1105,23 +1105,23 @@
 				// todo error can't unmount as files are open
 				yaffsfs_SetError(-EBUSY);
 			}
-			
+
 		}
 		else
 		{
 			//todo error - not mounted.
 			yaffsfs_SetError(-EINVAL);
-			
+
 		}
 	}
 	else
 	{
 		// todo error - no device
 		yaffsfs_SetError(-ENODEV);
-	}	
+	}
 	yaffsfs_Unlock();
 	return retVal;
-	
+
 }
 
 loff_t yaffs_freespace(const char *path)
@@ -1129,37 +1129,37 @@
 	loff_t retVal=-1;
 	yaffs_Device *dev=NULL;
 	char *dummy;
-	
+
 	yaffsfs_Lock();
 	dev = yaffsfs_FindDevice(path,&dummy);
 	if(dev  && dev->isMounted)
 	{
 		retVal = yaffs_GetNumberOfFreeChunks(dev);
 		retVal *= dev->nDataBytesPerChunk;
-		
+
 	}
 	else
 	{
 		yaffsfs_SetError(-EINVAL);
 	}
-	
+
 	yaffsfs_Unlock();
-	return retVal;	
+	return retVal;
 }
 
 
 
 void yaffs_initialise(yaffsfs_DeviceConfiguration *cfgList)
 {
-	
+
 	yaffsfs_DeviceConfiguration *cfg;
-	
+
 	yaffsfs_configurationList = cfgList;
-	
+
 	yaffsfs_InitHandles();
-	
+
 	cfg = yaffsfs_configurationList;
-	
+
 	while(cfg && cfg->prefix && cfg->dev)
 	{
 		cfg->dev->isMounted = 0;
@@ -1186,7 +1186,7 @@
 	yaffs_Object *dirObj;		/* ptr to directory being searched */
 	yaffs_Object *nextReturn;	/* obj to be returned by next readddir */
 	int offset;
-	struct list_head others;	
+	struct list_head others;
 } yaffsfs_DirectorySearchContext;
 
 
@@ -1199,9 +1199,9 @@
 	if(dsc &&
 	   dsc->dirObj &&
 	   dsc->dirObj->variantType == YAFFS_OBJECT_TYPE_DIRECTORY){
-	   
+
 	   dsc->offset = 0;
-	   
+
 	   if( list_empty(&dsc->dirObj->variant.directoryVariant.children)){
 	   	dsc->nextReturn = NULL;
 	   } else {
@@ -1218,16 +1218,16 @@
 	if(dsc &&
 	   dsc->dirObj &&
 	   dsc->dirObj->variantType == YAFFS_OBJECT_TYPE_DIRECTORY){
-	   
+
 	   if( dsc->nextReturn == NULL ||
 	       list_empty(&dsc->dirObj->variant.directoryVariant.children)){
 	   	dsc->nextReturn = NULL;
 	   } else {
 		   struct list_head *next = dsc->nextReturn->siblings.next;
-   
+
 		   if( next == &dsc->dirObj->variant.directoryVariant.children)
 	   		dsc->nextReturn = NULL; /* end of list */
-	   	   else 
+	   	   else
 		   	dsc->nextReturn = list_entry(next,yaffs_Object,siblings);
 	   }
 	} else {
@@ -1240,11 +1240,11 @@
 
 	struct list_head *i;
 	yaffsfs_DirectorySearchContext *dsc;
-	
+
 	/* if search contexts not initilised then skip */
 	if(!search_contexts.next)
 		return;
-		
+
 	/* Iteratethrough the directory search contexts.
 	 * If any are the one being removed, then advance the dsc to
 	 * the next one to prevent a hanging ptr.
@@ -1256,7 +1256,7 @@
 				yaffsfs_DirAdvance(dsc);
 		}
 	}
-				
+
 }
 
 yaffs_DIR *yaffs_opendir(const char *dirname)
@@ -1264,14 +1264,14 @@
 	yaffs_DIR *dir = NULL;
  	yaffs_Object *obj = NULL;
 	yaffsfs_DirectorySearchContext *dsc = NULL;
-	
+
 	yaffsfs_Lock();
-	
+
 	obj = yaffsfs_FindObject(NULL,dirname,0);
-	
+
 	if(obj && obj->variantType == YAFFS_OBJECT_TYPE_DIRECTORY)
 	{
-		
+
 		dsc = YMALLOC(sizeof(yaffsfs_DirectorySearchContext));
 		dir = (yaffs_DIR *)dsc;
 		if(dsc)
@@ -1281,17 +1281,17 @@
 			dsc->dirObj = obj;
 			strncpy(dsc->name,dirname,NAME_MAX);
 			INIT_LIST_HEAD(&dsc->others);
-			
+
 			if(!search_contexts.next)
 				INIT_LIST_HEAD(&search_contexts);
-				
-			list_add(&dsc->others,&search_contexts);	
+
+			list_add(&dsc->others,&search_contexts);
 			yaffsfs_SetDirRewound(dsc);		}
-	
+
 	}
-	
+
 	yaffsfs_Unlock();
-	
+
 	return dir;
 }
 
@@ -1299,9 +1299,9 @@
 {
 	yaffsfs_DirectorySearchContext *dsc = (yaffsfs_DirectorySearchContext *)dirp;
 	struct yaffs_dirent *retVal = NULL;
-		
+
 	yaffsfs_Lock();
-	
+
 	if(dsc && dsc->magic == YAFFS_MAGIC){
 		yaffsfs_SetError(0);
 		if(dsc->nextReturn){
@@ -1324,20 +1324,20 @@
 	{
 		yaffsfs_SetError(-EBADF);
 	}
-	
+
 	yaffsfs_Unlock();
-	
+
 	return retVal;
-	
+
 }
 
 
 void yaffs_rewinddir(yaffs_DIR *dirp)
 {
 	yaffsfs_DirectorySearchContext *dsc = (yaffsfs_DirectorySearchContext *)dirp;
-	
+
 	yaffsfs_Lock();
-	
+
 	yaffsfs_SetDirRewound(dsc);
 
 	yaffsfs_Unlock();
@@ -1347,7 +1347,7 @@
 int yaffs_closedir(yaffs_DIR *dirp)
 {
 	yaffsfs_DirectorySearchContext *dsc = (yaffsfs_DirectorySearchContext *)dirp;
-		
+
 	yaffsfs_Lock();
 	dsc->magic = 0;
 	list_del(&dsc->others); /* unhook from list */
@@ -1366,7 +1366,7 @@
 	char *name;
 	int retVal= -1;
 	int mode = 0; // ignore for now
-	
+
 	yaffsfs_Lock();
 	parent = yaffsfs_FindDirectory(NULL,newpath,&name,0);
 	obj = yaffs_MknodSymLink(parent,name,mode,0,0,oldpath);
@@ -1379,11 +1379,11 @@
 		yaffsfs_SetError(-ENOSPC); // just assume no space for now
 		retVal = -1;
 	}
-	
+
 	yaffsfs_Unlock();
-	
+
 	return retVal;
-	
+
 }
 
 int yaffs_readlink(const char *path, char *buf, int bufsiz)
@@ -1391,11 +1391,11 @@
 	yaffs_Object *obj = NULL;
 	int retVal;
 
-		
+
 	yaffsfs_Lock();
-	
+
 	obj = yaffsfs_FindObject(NULL,path,0);
-	
+
 	if(!obj)
 	{
 		yaffsfs_SetError(-ENOENT);
@@ -1424,12 +1424,12 @@
 	yaffs_Object *target = NULL;
 	int retVal = 0;
 
-		
+
 	yaffsfs_Lock();
-	
+
 	obj = yaffsfs_FindObject(NULL,oldpath,0);
 	target = yaffsfs_FindObject(NULL,newpath,0);
-	
+
 	if(!obj)
 	{
 		yaffsfs_SetError(-ENOENT);
@@ -1440,15 +1440,15 @@
 		yaffsfs_SetError(-EEXIST);
 		retVal = -1;
 	}
-	else	
+	else
 	{
 		yaffs_Object *newdir = NULL;
 		yaffs_Object *link = NULL;
-		
+
 		char *newname;
-		
+
 		newdir = yaffsfs_FindDirectory(NULL,newpath,&newname,0);
-		
+
 		if(!newdir)
 		{
 			yaffsfs_SetError(-ENOTDIR);
@@ -1473,7 +1473,7 @@
 		}
 	}
 	yaffsfs_Unlock();
-	
+
 	return retVal;
 }
 
@@ -1482,13 +1482,13 @@
 int yaffs_DumpDevStruct(const char *path)
 {
 	char *rest;
-	
+
 	yaffs_Object *obj = yaffsfs_FindRoot(path,&rest);
-	
+
 	if(obj)
 	{
 		yaffs_Device *dev = obj->myDev;
-		
+
 		printf("\n"
 			   "nPageWrites.......... %d\n"
 			   "nPageReads........... %d\n"
@@ -1504,7 +1504,7 @@
 				dev->garbageCollections,
 				dev->passiveGarbageCollections
 		);
-		
+
 	}
 	return 0;
 }
diff --git a/fs/yaffs2/yaffsfs.h b/fs/yaffs2/yaffsfs.h
index 9afe60a..95e7a91 100644
--- a/fs/yaffs2/yaffsfs.h
+++ b/fs/yaffs2/yaffsfs.h
@@ -1,5 +1,5 @@
 /*
- * YAFFS: Yet another Flash File System . A NAND-flash specific file system. 
+ * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
  *
  * Copyright (C) 2002-2007 Aleph One Ltd.
  *   for Toby Churchill Ltd and Brightstar Engineering
@@ -47,7 +47,7 @@
 #define O_RDWR		02
 #endif
 
-#ifndef O_CREAT		
+#ifndef O_CREAT
 #define O_CREAT 	0100
 #endif
 
@@ -95,7 +95,7 @@
 #define EACCESS	13
 #endif
 
-#ifndef EXDEV	
+#ifndef EXDEV
 #define EXDEV	18
 #endif
 
@@ -146,7 +146,7 @@
 #define S_IFREG		0100000
 #endif
 
-#ifndef S_IREAD 
+#ifndef S_IREAD
 #define S_IREAD		0000400
 #endif
 
@@ -202,8 +202,8 @@
 int yaffs_lstat(const char *path, struct yaffs_stat *buf) ;
 int yaffs_fstat(int fd, struct yaffs_stat *buf) ;
 
-int yaffs_chmod(const char *path, mode_t mode); 
-int yaffs_fchmod(int fd, mode_t mode); 
+int yaffs_chmod(const char *path, mode_t mode);
+int yaffs_fchmod(int fd, mode_t mode);
 
 int yaffs_mkdir(const char *path, mode_t mode) ;
 int yaffs_rmdir(const char *path) ;
@@ -216,10 +216,10 @@
 int yaffs_mount(const char *path) ;
 int yaffs_unmount(const char *path) ;
 
-int yaffs_symlink(const char *oldpath, const char *newpath); 
-int yaffs_readlink(const char *path, char *buf, int bufsiz); 
+int yaffs_symlink(const char *oldpath, const char *newpath);
+int yaffs_readlink(const char *path, char *buf, int bufsiz);
 
-int yaffs_link(const char *oldpath, const char *newpath); 
+int yaffs_link(const char *oldpath, const char *newpath);
 int yaffs_mknod(const char *pathname, mode_t mode, dev_t dev);
 
 loff_t yaffs_freespace(const char *path);
@@ -229,5 +229,3 @@
 int yaffs_StartUp(void);
 
 #endif
-
-
diff --git a/fs/yaffs2/yaffsinterface.h b/fs/yaffs2/yaffsinterface.h
index 0cfdfcf..810837a 100644
--- a/fs/yaffs2/yaffsinterface.h
+++ b/fs/yaffs2/yaffsinterface.h
@@ -1,5 +1,5 @@
 /*
- * YAFFS: Yet another Flash File System . A NAND-flash specific file system. 
+ * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
  *
  * Copyright (C) 2002-2007 Aleph One Ltd.
  *   for Toby Churchill Ltd and Brightstar Engineering
diff --git a/fs/yaffs2/ydirectenv.h b/fs/yaffs2/ydirectenv.h
index adcc0b5..b555810 100644
--- a/fs/yaffs2/ydirectenv.h
+++ b/fs/yaffs2/ydirectenv.h
@@ -1,5 +1,5 @@
 /*
- * YAFFS: Yet another Flash File System . A NAND-flash specific file system. 
+ * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
  *
  * Copyright (C) 2002-2007 Aleph One Ltd.
  *   for Toby Churchill Ltd and Brightstar Engineering
@@ -20,7 +20,7 @@
 #ifndef __YDIRECTENV_H__
 #define __YDIRECTENV_H__
 
-// Direct interface
+/* Direct interface */
 
 #include "devextras.h"
 
@@ -90,5 +90,3 @@
 #define yaffs_strcmp(a,b) strcmp(a,b)
 
 #endif
-
-
diff --git a/fs/yaffs2/yportenv.h b/fs/yaffs2/yportenv.h
index b316b16..bbab14d 100644
--- a/fs/yaffs2/yportenv.h
+++ b/fs/yaffs2/yportenv.h
@@ -1,5 +1,5 @@
 /*
- * YAFFS: Yet another Flash File System . A NAND-flash specific file system. 
+ * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
  *
  * Copyright (C) 2002-2007 Aleph One Ltd.
  *   for Toby Churchill Ltd and Brightstar Engineering
@@ -156,7 +156,7 @@
  * Tracing flags.
  * The flags masked in YAFFS_TRACE_ALWAYS are always traced.
  */
- 
+
 #define YAFFS_TRACE_OS			0x00000002
 #define YAFFS_TRACE_ALLOCATE		0x00000004
 #define YAFFS_TRACE_SCAN		0x00000008
