projects
/
yaffs2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix slow 512-byte problem. Thanx Frank.
[yaffs2.git]
/
direct
/
yaffsfs.c
diff --git
a/direct/yaffsfs.c
b/direct/yaffsfs.c
index 0ccb86f250bda1d97c2e2b437498e8528bd32628..9ac4493d7cf842171753097bd9c2521defe2b4b2 100644
(file)
--- a/
direct/yaffsfs.c
+++ b/
direct/yaffsfs.c
@@
-25,7
+25,7
@@
#endif
#endif
-const char *yaffsfs_c_version="$Id: yaffsfs.c,v 1.1
1 2006-04-21 20:24:35 colin
Exp $";
+const char *yaffsfs_c_version="$Id: yaffsfs.c,v 1.1
5 2006-11-17 01:43:48 charles
Exp $";
// configurationList is the list of devices that are supported
static yaffsfs_DeviceConfiguration *yaffsfs_configurationList;
// configurationList is the list of devices that are supported
static yaffsfs_DeviceConfiguration *yaffsfs_configurationList;
@@
-620,7
+620,7
@@
int yaffs_write(int fd, const void *buf, unsigned int nbyte)
}
}
-int yaffs_truncate(int fd,
unsigned in
t newSize)
+int yaffs_truncate(int fd,
off_
t newSize)
{
yaffsfs_Handle *h = NULL;
yaffs_Object *obj = NULL;
{
yaffsfs_Handle *h = NULL;
yaffs_Object *obj = NULL;
@@
-729,10
+729,6
@@
int yaffsfs_DoUnlink(const char *path,int isDirectory)
{
yaffsfs_SetError(-ENOTDIR);
}
{
yaffsfs_SetError(-ENOTDIR);
}
- else if(isDirectory && obj->variantType != YAFFS_OBJECT_TYPE_DIRECTORY)
- {
- yaffsfs_SetError(-ENOTDIR);
- }
else
{
result = yaffs_Unlink(dir,name);
else
{
result = yaffs_Unlink(dir,name);
@@
-851,7
+847,7
@@
static int yaffsfs_DoStat(yaffs_Object *obj,struct yaffs_stat *buf)
buf->st_gid = 0;;
buf->st_rdev = obj->yst_rdev;
buf->st_size = yaffs_GetObjectFileLength(obj);
buf->st_gid = 0;;
buf->st_rdev = obj->yst_rdev;
buf->st_size = yaffs_GetObjectFileLength(obj);
- buf->st_blksize = obj->myDev->nBytesPerChunk;
+ buf->st_blksize = obj->myDev->n
Data
BytesPerChunk;
buf->st_blocks = (buf->st_size + buf->st_blksize -1)/buf->st_blksize;
buf->yst_atime = obj->yst_atime;
buf->yst_ctime = obj->yst_ctime;
buf->st_blocks = (buf->st_size + buf->st_blksize -1)/buf->st_blksize;
buf->yst_atime = obj->yst_atime;
buf->yst_ctime = obj->yst_ctime;
@@
-1078,6
+1074,7
@@
int yaffs_unmount(const char *path)
int inUse;
yaffs_FlushEntireDeviceCache(dev);
int inUse;
yaffs_FlushEntireDeviceCache(dev);
+ yaffs_CheckpointSave(dev);
for(i = inUse = 0; i < YAFFSFS_N_HANDLES && !inUse; i++)
{
for(i = inUse = 0; i < YAFFSFS_N_HANDLES && !inUse; i++)
{
@@
-1117,9
+1114,9
@@
int yaffs_unmount(const char *path)
}
}
-off_t yaffs_freespace(const char *path)
+
l
off_t yaffs_freespace(const char *path)
{
{
- off_t retVal=-1;
+
l
off_t retVal=-1;
yaffs_Device *dev=NULL;
char *dummy;
yaffs_Device *dev=NULL;
char *dummy;
@@
-1128,7
+1125,7
@@
off_t yaffs_freespace(const char *path)
if(dev && dev->isMounted)
{
retVal = yaffs_GetNumberOfFreeChunks(dev);
if(dev && dev->isMounted)
{
retVal = yaffs_GetNumberOfFreeChunks(dev);
- retVal *= dev->nBytesPerChunk;
+ retVal *= dev->n
Data
BytesPerChunk;
}
else
}
else
@@
-1301,8
+1298,14
@@
struct yaffs_dirent *yaffs_readdir(yaffs_DIR *dirp)
yaffsfs_SetError(0);
if(dsc->nextReturn){
dsc->de.d_ino = yaffs_GetEquivalentObject(dsc->nextReturn)->objectId;
yaffsfs_SetError(0);
if(dsc->nextReturn){
dsc->de.d_ino = yaffs_GetEquivalentObject(dsc->nextReturn)->objectId;
+ dsc->de.d_dont_use = (unsigned)dsc->nextReturn;
dsc->de.d_off = dsc->offset++;
dsc->de.d_off = dsc->offset++;
- yaffs_GetObjectName(dsc->nextReturn,dsc->de.d_name,NAME_MAX+1);
+ yaffs_GetObjectName(dsc->nextReturn,dsc->de.d_name,NAME_MAX);
+ if(strlen(dsc->de.d_name) == 0)
+ {
+ // this should not happen!
+ strcpy(dsc->de.d_name,"zz");
+ }
dsc->de.d_reclen = sizeof(struct yaffs_dirent);
retVal = &dsc->de;
yaffsfs_DirAdvance(dsc);
dsc->de.d_reclen = sizeof(struct yaffs_dirent);
retVal = &dsc->de;
yaffsfs_DirAdvance(dsc);