X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=direct%2Fyaffsfs.c;h=9d7804c153d1e113aa6b987cf861de53f188b4e3;hp=0ccb86f250bda1d97c2e2b437498e8528bd32628;hb=378bbdf4d64b8b26db55a495ab6ae520ff62e471;hpb=06781c4ca96ccdf097952eb97fe86b8db87b84b0 diff --git a/direct/yaffsfs.c b/direct/yaffsfs.c index 0ccb86f..9d7804c 100644 --- a/direct/yaffsfs.c +++ b/direct/yaffsfs.c @@ -25,7 +25,7 @@ #endif -const char *yaffsfs_c_version="$Id: yaffsfs.c,v 1.11 2006-04-21 20:24:35 colin 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; @@ -620,7 +620,7 @@ int yaffs_write(int fd, const void *buf, unsigned int nbyte) } -int yaffs_truncate(int fd, unsigned int newSize) +int yaffs_truncate(int fd, off_t newSize) { yaffsfs_Handle *h = NULL; yaffs_Object *obj = NULL; @@ -851,7 +851,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_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; @@ -1078,6 +1078,7 @@ int yaffs_unmount(const char *path) int inUse; yaffs_FlushEntireDeviceCache(dev); + yaffs_CheckpointSave(dev); for(i = inUse = 0; i < YAFFSFS_N_HANDLES && !inUse; i++) { @@ -1117,9 +1118,9 @@ int yaffs_unmount(const char *path) } -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; @@ -1128,7 +1129,7 @@ off_t yaffs_freespace(const char *path) if(dev && dev->isMounted) { retVal = yaffs_GetNumberOfFreeChunks(dev); - retVal *= dev->nBytesPerChunk; + retVal *= dev->nDataBytesPerChunk; } else