Fix a few more NXFFS bugs

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3558 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2011-05-04 00:25:21 +00:00
parent 39c59cd8f6
commit d33237215d

@ -553,6 +553,7 @@ int user_start(int argc, char *argv[])
{
FAR struct mtd_dev_s *mtd;
int ret;
int i;
/* Seed the random number generated */
@ -585,7 +586,14 @@ int user_start(int argc, char *argv[])
exit(3);
}
/* Then write a files to the NXFFS file system until either (1) all of the
/* Loop a few times ... file the file system with some random, files,
* delete some files randomly, fill the file system with more random file,
* delete, etc. This beats the FLASH very hard!
*/
for (i = 0; i < 2; i++)
{
/* Write a files to the NXFFS file system until either (1) all of the
* open file structures are utilized or until (2) NXFFS reports an error
* (hopefully that the file system is full)
*/
@ -602,9 +610,14 @@ int user_start(int argc, char *argv[])
if (ret < 0)
{
fprintf(stderr, "ERROR: Failed to verify files\n");
}
else
{
fprintf(stderr, "Verified!\n");
}
fprintf(stderr, " Number of files: %d\n", g_nfiles);
fprintf(stderr, " Number deleted: %d\n", g_ndeleted);
}
/* Delete some files */
@ -617,6 +630,7 @@ int user_start(int argc, char *argv[])
{
fprintf(stderr, "Deleted some files\n");
}
fprintf(stderr, " Number of files: %d\n", g_nfiles);
fprintf(stderr, " Number deleted: %d\n", g_ndeleted);
nxffs_dump(mtd);
@ -627,6 +641,12 @@ int user_start(int argc, char *argv[])
if (ret < 0)
{
fprintf(stderr, "ERROR: Failed to verify files\n");
}
else
{
fprintf(stderr, "Verified!\n");
}
fprintf(stderr, " Number of files: %d\n", g_nfiles);
fprintf(stderr, " Number deleted: %d\n", g_ndeleted);
}