dumpDir(mountpt);
sprintf(fullname, "%s/%s", mountpt, "big-test-file");
+
+ handle = yaffs_open(fullname, O_RDONLY, 0);
+
handle = yaffs_open(fullname, O_CREAT | O_RDWR | O_TRUNC, S_IREAD | S_IWRITE);
if(handle < 0) {
write_big_sparse_file(handle);
verify_big_sparse_file(handle);
+ yaffs_close(handle);
+
printf("Job done\n");
yaffs_unmount(mountpt);
+ yaffs_mount(mountpt);
+ printf("mounted again\n");
+ dumpDir(mountpt);
+ handle = yaffs_open(fullname, O_RDONLY, 0);
+ verify_big_sparse_file(handle);
+ yaffs_unmount(mountpt);
+
+
+ yaffs_mount_common(mountpt, 0, 1);
+ printf("mounted with no checkpt\n");
+ dumpDir(mountpt);
+ handle = yaffs_open(fullname, O_RDONLY, 0);
+ verify_big_sparse_file(handle);
+ yaffs_unmount(mountpt);
}
return (void *)dev;
}
-int yaffs_mount2(const YCHAR *path,int read_only)
+int yaffs_mount_common(const YCHAR *path,int read_only, int skip_checkpt)
{
int retVal=-1;
int result=YAFFS_FAIL;
if(dev){
if(!dev->is_mounted){
dev->read_only = read_only ? 1 : 0;
- result = yaffs_guts_initialise(dev);
+ if(skip_checkpt) {
+ u8 skip = dev->param.skip_checkpt_rd;
+ dev->param.skip_checkpt_rd = 1;
+ result = yaffs_guts_initialise(dev);
+ dev->param.skip_checkpt_rd = skip;
+ } else {
+ result = yaffs_guts_initialise(dev);
+ }
+
if(result == YAFFS_FAIL)
yaffsfs_SetError(-ENOMEM);
retVal = result ? 0 : -1;
}
+int yaffs_mount2(const YCHAR *path, int readonly)
+{
+ return yaffs_mount_common(path, readonly, 0);
+}
int yaffs_mount(const YCHAR *path)
{
- return yaffs_mount2(path,0);
+ return yaffs_mount_common(path, 0, 0);
}
int yaffs_sync(const YCHAR *path)
int yaffs_mount(const YCHAR *path) ;
int yaffs_mount2(const YCHAR *path, int read_only);
+int yaffs_mount_common(const YCHAR *path, int read_only, int skip_checkpt);
+
int yaffs_unmount(const YCHAR *path) ;
int yaffs_unmount2(const YCHAR *path, int force);
int yaffs_remount(const YCHAR *path, int force, int read_only);
sb->u.generic_sbp = dev;
#endif
- sb->s_maxbytes = 32000000000UL;
+ sb->s_maxbytes = 35000000000LL;
dev->driver_context = mtd;
param->name = mtd->name;