FSX();
outh = yaffs_open(fullTempCounterName, O_RDWR | O_TRUNC | O_CREAT, S_IREAD | S_IWRITE);
+
if(outh >= 0){
struct yaffs_stat tmpstat, oldstat, tmpfstat;
FSX();
+ yaffs_fstat(outh,&tmpfstat);
+ printf("\n\n\n*** Writing file %s inode %d\n",fullTempCounterName,tmpfstat.st_ino);
nwritten = yaffs_write(outh,x,sizeof(x));
FSX();
- yaffs_fstat(outh,&tmpfstat);
yaffs_close(outh);
FSX();
yaffs_dirent *de;
struct yaffs_stat s;
char str[1000];
+ int error_line = 0;
d = yaffs_opendir(dname);
printf("%s inode %ld %d obj %x length %d mode %X ",str, de->d_ino, s.st_ino,de->d_dont_use,(int)s.st_size,s.st_mode);\
if(de->d_ino != s.st_ino){
printf(" \n\n!!!! HEY inode mismatch\n\n");
- FatalError(__LINE__);
+ error_line = __LINE__;
}
switch(s.st_mode & S_IFMT)
dump_directory_tree_worker(str,1);
if(s.st_ino > 10000)
- FatalError(__LINE__);
+ error_line = __LINE__;
}
+ if(error_line)
+ FatalError(error_line);
+
yaffs_closedir(d);
}
FSX();
h = yaffs_open(fname,O_RDWR | O_CREAT | O_TRUNC, S_IREAD | S_IWRITE);
yaffs_fstat(h,&st);
- printf("Writing file %s inode %d\n",fname, st.st_ino);
+ printf("\n\n\n**** Open writing file %s inode %d\n",fname, st.st_ino);
FSX();
FSX();
yaffs_close(h);
+ printf("File closed\n");
return 0;
WRITE_ERROR:
FSX();
if(result)
FatalError(__LINE__);
+ printf("Raname file %s to %s\n",fullTempMainName,fullMainName);
yaffs_rename(fullTempMainName,fullMainName);
FSX();
}
void NorStressTestRun(const char *prefix, int n_cycles, int do_fsx)
{
+
interleave_fsx = do_fsx;
MakeFullNames(prefix);
+ dump_directory_tree(fullPathName);
FSX_INIT(prefix);
dump_directory_tree(fullPathName);