[Yaffs] [PATCH 12/20] Flush during close (similar to yaffs_c…

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Xiangfu Liu
Date:  
To: yaffs
CC: sebastien
Old-Topics: [Yaffs] [PATCH 11/20] Use UNIX time instead of seconds since boot.
New-Topics: [Yaffs] [PATCH 13/20] C++ compatibility.
Subject: [Yaffs] [PATCH 12/20] Flush during close (similar to yaffs_close()).
From: Sebastian Huber <>

---
 rtems/rtems_yaffs.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)


diff --git a/rtems/rtems_yaffs.c b/rtems/rtems_yaffs.c
index 92fb171..6867bee 100644
--- a/rtems/rtems_yaffs.c
+++ b/rtems/rtems_yaffs.c
@@ -702,7 +702,14 @@ static int ycb_file_open(rtems_libio_t *iop, const char *pathname, uint32_t flag

 static int ycb_file_close(rtems_libio_t *iop)
 {
-    /* nothing to do */
+    const rtems_filesystem_location_info_t *pathinfo = &iop->pathinfo;
+    struct yaffs_obj *obj = pathinfo->node_access;
+    struct yaffs_dev *dev = obj->my_dev;
+
+    ylock(dev);
+    yaffs_flush_file(obj, 1, 0);
+    yunlock(dev);
+
     return 0;
 }


--
1.7.4.1