projects
/
yaffs2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Improve sync to flush metadata
[yaffs2.git]
/
direct
/
yaffsfs.c
diff --git
a/direct/yaffsfs.c
b/direct/yaffsfs.c
index 3be1ea7d13a83a521b2ec4f78c551519730f5d9d..1da4d059049e4e3dc1acd238f2b04a9a7b4bfc67 100644
(file)
--- a/
direct/yaffsfs.c
+++ b/
direct/yaffsfs.c
@@
-24,7
+24,7
@@
#endif
#endif
-const char *yaffsfs_c_version="$Id: yaffsfs.c,v 1.2
5 2009-03-05 01:47:17
charles Exp $";
+const char *yaffsfs_c_version="$Id: yaffsfs.c,v 1.2
6 2009-09-23 23:24:55
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;
@@
-587,7
+587,7
@@
int yaffs_open(const YCHAR *path, int oflag, int mode)
return handle;
}
return handle;
}
-int yaffs_
flush(int fd
)
+int yaffs_
Dofsync(int fd,int datasync
)
{
yaffsfs_Handle *h = NULL;
int retVal = 0;
{
yaffsfs_Handle *h = NULL;
int retVal = 0;
@@
-599,7
+599,7
@@
int yaffs_flush(int fd)
if(h && h->inUse)
{
// flush the file
if(h && h->inUse)
{
// flush the file
- yaffs_FlushFile(h->obj,1);
+ yaffs_FlushFile(h->obj,1
,datasync
);
}
else
{
}
else
{
@@
-613,6
+613,15
@@
int yaffs_flush(int fd)
return retVal;
}
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)
{
int yaffs_close(int fd)
{
@@
-626,7
+635,7
@@
int yaffs_close(int fd)
if(h && h->inUse)
{
// clean up
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)
{
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;
}
obj->dirty = 1;
- result = yaffs_FlushFile(obj,0);
+ result = yaffs_FlushFile(obj,0
,0
);
retVal = 0;
}
else
retVal = 0;
}
else
@@
-1295,7
+1304,7
@@
static int yaffsfs_DoChMod(yaffs_Object *obj,mode_t mode)
{
obj->yst_mode = mode;
obj->dirty = 1;
{
obj->yst_mode = mode;
obj->dirty = 1;
- result = yaffs_FlushFile(obj,0);
+ result = yaffs_FlushFile(obj,0
,0
);
}
return result == YAFFS_OK ? 0 : -1;
}
return result == YAFFS_OK ? 0 : -1;