#endif
-const char *yaffsfs_c_version="$Id: yaffsfs.c,v 1.10 2006-03-08 07:59:20 charles Exp $";
+const char *yaffsfs_c_version="$Id: yaffsfs.c,v 1.13 2006-10-03 10:13:03 charles Exp $";
// configurationList is the list of devices that are supported
static yaffsfs_DeviceConfiguration *yaffsfs_configurationList;
}
-int yaffs_truncate(int fd, unsigned int newSize)
+int yaffs_truncate(int fd, off_t newSize)
{
yaffsfs_Handle *h = NULL;
yaffs_Object *obj = NULL;
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->nDataBytesPerChunk;
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;
int inUse;
yaffs_FlushEntireDeviceCache(dev);
+ yaffs_CheckpointSave(dev);
for(i = inUse = 0; i < YAFFSFS_N_HANDLES && !inUse; i++)
{
}
-off_t yaffs_freespace(const char *path)
+loff_t yaffs_freespace(const char *path)
{
- off_t retVal=-1;
+ loff_t retVal=-1;
yaffs_Device *dev=NULL;
char *dummy;
if(dev && dev->isMounted)
{
retVal = yaffs_GetNumberOfFreeChunks(dev);
- retVal *= dev->nBytesPerChunk;
+ retVal *= dev->nDataBytesPerChunk;
}
else
// Creates a link called newpath to existing oldpath
yaffs_Object *obj = NULL;
yaffs_Object *target = NULL;
- int retVal;
+ int retVal = 0;
yaffsfs_Lock();