Fix issue with zero page
[yaffs2.git] / yaffs_fs.c
index 7b4a8b04c65ef57a635fa2564e03acc3666e87a8..0efbee3971b0e26469d34022ecc18a107e9fd459 100644 (file)
@@ -29,7 +29,7 @@
  */
 
 
-const char *yaffs_fs_c_version = "$Id: yaffs_fs.c,v 1.5 2005-04-29 07:01:18 charles Exp $";
+const char *yaffs_fs_c_version = "$Id: yaffs_fs.c,v 1.7 2005-07-05 23:54:59 charles Exp $";
 extern const char *yaffs_guts_c_version;
 
 
@@ -548,7 +548,7 @@ static int yaffs_writepage(struct page *page)
        yaffs_GrossLock(obj->myDev);
 
 
-       nWritten = yaffs_WriteDataToFile(obj,buffer,page->index << PAGE_CACHE_SHIFT,nBytes);
+       nWritten = yaffs_WriteDataToFile(obj,buffer,page->index << PAGE_CACHE_SHIFT,nBytes,0);
 
        yaffs_GrossUnlock(obj->myDev);
        
@@ -786,7 +786,7 @@ static ssize_t yaffs_file_write(struct file *f, const char *buf, size_t n, loff_
                T(YAFFS_TRACE_OS,(KERN_DEBUG"yaffs_file_write about to write writing %d bytes to object %d at %d\n",n,obj->objectId,ipos));
        }
 
-       nWritten = yaffs_WriteDataToFile(obj,buf,ipos,n);
+       nWritten = yaffs_WriteDataToFile(obj,buf,ipos,n,0);
 
        T(YAFFS_TRACE_OS,(KERN_DEBUG"yaffs_file_write writing %d bytes, %d written at %d\n",n,nWritten,ipos));
        if(nWritten > 0)
@@ -1365,7 +1365,7 @@ static struct super_block *yaffs_internal_read_super(int yaffsVersion,int useRam
                dev->genericDevice = NULL; // Not used for RAM emulation.
 
                nBlocks = YAFFS_RAM_EMULATION_SIZE / (YAFFS_CHUNKS_PER_BLOCK * YAFFS_BYTES_PER_CHUNK);
-               dev->startBlock = 1;  // Don't use block 0
+               dev->startBlock = 0;  
                dev->endBlock = nBlocks - 1;
                dev->nChunksPerBlock = YAFFS_CHUNKS_PER_BLOCK;
                dev->nBytesPerChunk = YAFFS_BYTES_PER_CHUNK;
@@ -1383,7 +1383,7 @@ static struct super_block *yaffs_internal_read_super(int yaffsVersion,int useRam
                        dev->nChunksPerBlock = nandemul2k_GetChunksPerBlock();
                        dev->nBytesPerChunk =  nandemul2k_GetBytesPerChunk();;
                        nBlocks = nandemul2k_GetNumberOfBlocks();
-                       dev->startBlock = 1;  // Don't use block 0
+                       dev->startBlock = 0;
                        dev->endBlock = nBlocks - 1;
                }
                else
@@ -1515,7 +1515,7 @@ static struct super_block *yaffs_internal_read_super(int yaffsVersion,int useRam
                // Set up the memory size parameters....
                
                nBlocks = mtd->size / (YAFFS_CHUNKS_PER_BLOCK * YAFFS_BYTES_PER_CHUNK);
-               dev->startBlock = 1;  // Don't use block 0
+               dev->startBlock = 0;
                dev->endBlock = nBlocks - 1;
                dev->nChunksPerBlock = YAFFS_CHUNKS_PER_BLOCK;
                dev->nBytesPerChunk = YAFFS_BYTES_PER_CHUNK;
@@ -1535,7 +1535,7 @@ static struct super_block *yaffs_internal_read_super(int yaffsVersion,int useRam
                        dev->nBytesPerChunk = mtd->oobblock;
                        dev->nChunksPerBlock = mtd->erasesize / mtd->oobblock;
                        nBlocks = mtd->size / mtd->erasesize;
-                       dev->startBlock = 1;  // Don't use block 0
+                       dev->startBlock = 0;
                        dev->endBlock = nBlocks - 1;
                }
                else