changeset 1705:99834d6b6eeb

* tests/fileio1.c (main): If we have two filesystem configured mount the second one on /mnt and list the root of it. * src/fs-ecos.c (jffs2_fo_write): Fixed a typo in a debug print which is normally disabled. * src/fs-ecos.c (jffs2_fo_lseek): Put back part of the fix for lseeking past the end of the file which was removed during the last merge with MTD. * src/flashio.c (jffs2_flash_erase): Minor update for new flash API.
author asl
date Thu, 05 Aug 2004 13:41:33 +0000
parents d4ce7bf7bdb7
children 3845779eca10
files packages/fs/jffs2/current/ChangeLog packages/fs/jffs2/current/src/flashio.c packages/fs/jffs2/current/src/fs-ecos.c packages/fs/jffs2/current/tests/fileio1.c
diffstat 4 files changed, 55 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/packages/fs/jffs2/current/ChangeLog
+++ b/packages/fs/jffs2/current/ChangeLog
@@ -1,3 +1,21 @@
+2004-07-14  Andrew Lunn  <andrew.lunn@ascom.ch>
+
+	* tests/fileio1.c (main): If we have two filesystem configured
+	mount the second one on /mnt and list the root of it.
+	* src/fs-ecos.c (jffs2_fo_write): Fixed a typo in a debug print 
+	which is normally disabled.
+
+2004-07-12  Andrew Lunn  <andrew.lunn@ascom.ch>
+
+	* src/fs-ecos.c (jffs2_fo_lseek): Put back part of the fix for
+	lseeking past the end of the file which was removed during the last
+	merge with MTD.
+
+2004-07-10  Andrew Lunn  <andrew.lunn@ascom.ch>
+
+	* src/flashio.c (jffs2_flash_erase): Minor update for new
+	flash API.
+
 2004-04-19  Oyvind Harboe <oyvind.harboe@zylin.com>
 	
 	* src/build.c: JFFS2 can now be used as a write-once, read many mode
--- a/packages/fs/jffs2/current/src/flashio.c
+++ b/packages/fs/jffs2/current/src/flashio.c
@@ -144,7 +144,7 @@ cyg_bool jffs2_flash_erase(struct jffs2_
 			   struct jffs2_eraseblock * jeb)
 {
 	cyg_io_flash_getconfig_erase_t e;
-	void *err_addr;
+	cyg_flashaddr_t err_addr;
 	Cyg_ErrNo err;
 	cyg_uint32 len = sizeof (e);
 	struct super_block *sb = OFNI_BS_2SFFJ(c);
--- a/packages/fs/jffs2/current/src/fs-ecos.c
+++ b/packages/fs/jffs2/current/src/fs-ecos.c
@@ -1360,7 +1360,7 @@ static int jffs2_fo_write(struct CYG_FIL
 		int err;
 
 		D2(printf("jffs2_fo_write page_start_pos %d\n", pos));
-		D2(printf("jffs2_fo_write transfer size %d\n", l));
+		D2(printf("jffs2_fo_write transfer size %d\n", len));
 
 		err = jffs2_write_inode_range(c, f, &ri, buf,
 					      pos, len, &writtenlen);
@@ -1420,7 +1420,7 @@ static int jffs2_fo_lseek(struct CYG_FIL
 
         // Check that pos is still within current file size, or at the
         // very end.
-        if (pos < 0 || pos > node->i_size)
+        if (pos < 0 )
                 return EINVAL;
 
 	// All OK, set fp offset and return new position.
--- a/packages/fs/jffs2/current/tests/fileio1.c
+++ b/packages/fs/jffs2/current/tests/fileio1.c
@@ -73,6 +73,8 @@
 #include <string.h>
 #include <dirent.h>
 
+#include <stdlib.h>
+
 #include <cyg/fileio/fileio.h>
 
 #include <cyg/infra/testcase.h>
@@ -416,6 +418,14 @@ int main( int argc, char **argv )
     //int i;
     int existingdirents=-1;
 
+    struct mallinfo info;
+
+    info =  mallinfo();
+    diag_printf("arenasize %d, freeblocks %d, totalallocated %d, totalfree %d, maxfree %d\n",
+                info.arena, info.ordblks, info.uordblks, info.fordblks, info.maxfree);
+    
+    
+
     CYG_TEST_INIT();
 
     // --------------------------------------------------------------
@@ -658,9 +668,33 @@ int main( int argc, char **argv )
     err = umount( "/jffs2" );
     if( err < 0 ) SHOW_RESULT( umount, err );    
     
+#ifdef CYGDAT_IO_FLASH_BLOCK_DEVICE_NAME_2
+    diag_printf("<INFO>: mounting second JFFS2 filesystem on /mnt\n");
+    
+    err = mount( CYGDAT_IO_FLASH_BLOCK_DEVICE_NAME_1, "/mnt", "jffs2" );
+    if( err < 0 ) SHOW_RESULT( mount, err );    
+
+    err = chdir( "/" );
+    if( err < 0 ) SHOW_RESULT( chdir, err );
+
+    checkcwd( "/" );
+    
+    listdir( "/", true, -1, &existingdirents );
+    if ( existingdirents < 2 )
+        CYG_TEST_FAIL("Not enough dir entries\n");
+
+    listdir( "/mnt", true, -1, &existingdirents );
+    if ( existingdirents < 2 )
+        CYG_TEST_FAIL("Not enough dir entries\n");
+
+    diag_printf("<INFO>: umount /mnt\n");    
+    err = umount( "/mnt" );
+#endif
+
     diag_printf("<INFO>: umount /\n");    
     err = umount( "/" );
     if( err < 0 ) SHOW_RESULT( umount, err );    
+
     
     CYG_TEST_PASS_FINISH("fileio1");
 }