Mercurial > yaffs-ecoscentric
diff direct/yaffsfs.c @ 308:63d50ebbae7d
Improve sync to flush metadata
| author | charles |
|---|---|
| date | Thu, 24 Sep 2009 00:24:55 +0100 |
| parents | c28a53b1d08f |
| children | b21bd2a64496 |
line wrap: on
line diff
--- a/direct/yaffsfs.c +++ b/direct/yaffsfs.c @@ -587,7 +587,7 @@ int yaffs_open(const YCHAR *path, int of return handle; } -int yaffs_flush(int fd) +int yaffs_Dofsync(int fd,int datasync) { yaffsfs_Handle *h = NULL; int retVal = 0; @@ -599,7 +599,7 @@ int yaffs_flush(int fd) if(h && h->inUse) { // flush the file - yaffs_FlushFile(h->obj,1); + yaffs_FlushFile(h->obj,1,datasync); } else { @@ -613,6 +613,15 @@ int yaffs_flush(int fd) return retVal; } +int yaffs_fsync(int fd) +{ + return yaffs_Dofsync(fd,0); +} + +int yaffs_fdatasync(int fd) +{ + return yaffs_Dofsync(fd,1); +} int yaffs_close(int fd) { @@ -626,7 +635,7 @@ int yaffs_close(int fd) if(h && h->inUse) { // clean up - yaffs_FlushFile(h->obj,1); + yaffs_FlushFile(h->obj,1,0); h->obj->inUse--; if(h->obj->inUse <= 0 && h->obj->unlinked) { @@ -1265,7 +1274,7 @@ int yaffs_set_wince_times(int fd, } obj->dirty = 1; - result = yaffs_FlushFile(obj,0); + result = yaffs_FlushFile(obj,0,0); retVal = 0; } else @@ -1295,7 +1304,7 @@ static int yaffsfs_DoChMod(yaffs_Object { obj->yst_mode = mode; obj->dirty = 1; - result = yaffs_FlushFile(obj,0); + result = yaffs_FlushFile(obj,0,0); } return result == YAFFS_OK ? 0 : -1;
