[rtems commit] Filesystem: New defaults fsync_h and fdatasync_h

Joel Sherrill joel at rtems.org
Thu Mar 29 14:14:29 UTC 2012


Module:    rtems
Branch:    master
Commit:    269896e7ecc70ea6e3b8e08b204336e22d30c431
Changeset: http://git.rtems.org/rtems/commit/?id=269896e7ecc70ea6e3b8e08b204336e22d30c431

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Feb 24 17:39:27 2012 +0100

Filesystem: New defaults fsync_h and fdatasync_h

New defaults rtems_filesystem_default_fsync_or_fdatasync() and
rtems_filesystem_default_fsync_or_fdatasync_success() for fsync_h and
fdatasync_h.  The rtems_filesystem_default_fsync_or_fdatasync() sets now
errno to EINVAL according to POSIX.

---

 c/src/lib/libbsp/shared/umon/tfsDriver.c          |    4 +-
 cpukit/libcsupport/include/rtems/libio.h          |   18 +++++++------
 cpukit/libcsupport/src/__usrenv.c                 |    4 +-
 cpukit/libfs/Makefile.am                          |    8 +++--
 cpukit/libfs/src/defaults/default_fdatasync.c     |   21 ---------------
 cpukit/libfs/src/defaults/default_fsync.c         |   10 ++++---
 cpukit/libfs/src/defaults/default_fsync_success.c |   26 ++++++++++++++++++
 cpukit/libfs/src/defaults/default_handlers.c      |    4 +-
 cpukit/libfs/src/devfs/devfs_init.c               |    4 +-
 cpukit/libfs/src/imfs/imfs.h                      |    4 ---
 cpukit/libfs/src/imfs/imfs_fdatasync.c            |   29 ---------------------
 cpukit/libfs/src/imfs/imfs_fifo.c                 |    4 +-
 cpukit/libfs/src/imfs/imfs_handlers_device.c      |    4 +-
 cpukit/libfs/src/imfs/imfs_handlers_directory.c   |    4 +-
 cpukit/libfs/src/imfs/imfs_handlers_link.c        |    4 +-
 cpukit/libfs/src/imfs/imfs_handlers_memfile.c     |    4 +-
 cpukit/libfs/src/nfsclient/src/nfs.c              |   12 ++++----
 cpukit/libfs/src/rfs/rtems-rfs-rtems-dev.c        |    4 +-
 cpukit/libfs/src/rfs/rtems-rfs-rtems-dir.c        |    2 +-
 cpukit/libfs/src/rfs/rtems-rfs-rtems.c            |    4 +-
 cpukit/libnetworking/lib/ftpfs.c                  |    8 +++---
 cpukit/libnetworking/lib/tftpDriver.c             |    4 +-
 cpukit/libnetworking/rtems/rtems_syscall.c        |    4 +-
 23 files changed, 84 insertions(+), 106 deletions(-)

diff --git a/c/src/lib/libbsp/shared/umon/tfsDriver.c b/c/src/lib/libbsp/shared/umon/tfsDriver.c
index fcff017..fe3ffbc 100644
--- a/c/src/lib/libbsp/shared/umon/tfsDriver.c
+++ b/c/src/lib/libbsp/shared/umon/tfsDriver.c
@@ -675,7 +675,7 @@ static const rtems_filesystem_file_handlers_r rtems_tfs_handlers = {
   .lseek_h = rtems_tfs_lseek,
   .fstat_h = rtems_filesystem_default_fstat,
   .ftruncate_h = rtems_tfs_ftruncate,
-  .fsync_h = rtems_filesystem_default_fsync,
-  .fdatasync_h = rtems_filesystem_default_fdatasync,
+  .fsync_h = rtems_filesystem_default_fsync_or_fdatasync,
+  .fdatasync_h = rtems_filesystem_default_fsync_or_fdatasync,
   .fcntl_h = rtems_filesystem_default_fcntl
 };
diff --git a/cpukit/libcsupport/include/rtems/libio.h b/cpukit/libcsupport/include/rtems/libio.h
index d3efd4a..5789909 100644
--- a/cpukit/libcsupport/include/rtems/libio.h
+++ b/cpukit/libcsupport/include/rtems/libio.h
@@ -900,7 +900,8 @@ typedef int (*rtems_filesystem_ftruncate_t)(
  * @retval 0 Successful operation.
  * @retval -1 An error occured.  The errno is set to indicate the error.
  *
- * @see rtems_filesystem_default_fsync().
+ * @see rtems_filesystem_default_fsync_or_fdatasync() and
+ * rtems_filesystem_default_fsync_or_fdatasync_success().
  */
 typedef int (*rtems_filesystem_fsync_t)(
   rtems_libio_t *iop
@@ -914,7 +915,8 @@ typedef int (*rtems_filesystem_fsync_t)(
  * @retval 0 Successful operation.
  * @retval -1 An error occured.  The errno is set to indicate the error.
  *
- * @see rtems_filesystem_default_fdatasync().
+ * @see rtems_filesystem_default_fsync_or_fdatasync() and
+ * rtems_filesystem_default_fsync_or_fdatasync_success().
  */
 typedef int (*rtems_filesystem_fdatasync_t)(
   rtems_libio_t *iop
@@ -1068,20 +1070,20 @@ int rtems_filesystem_default_ftruncate_directory(
 );
 
 /**
- * @retval -1 Always.  The errno is set to ENOTSUP.
+ * @retval -1 Always.  The errno is set to EINVAL.
  *
- * @see rtems_filesystem_fsync_t.
+ * @see rtems_filesystem_fsync_t and rtems_filesystem_fdatasync_t.
  */
-int rtems_filesystem_default_fsync(
+int rtems_filesystem_default_fsync_or_fdatasync(
   rtems_libio_t *iop
 );
 
 /**
- * @retval -1 Always.  The errno is set to ENOTSUP.
+ * @retval 0 Always.
  *
- * @see rtems_filesystem_fdatasync_t.
+ * @see rtems_filesystem_fsync_t and rtems_filesystem_fdatasync_t.
  */
-int rtems_filesystem_default_fdatasync(
+int rtems_filesystem_default_fsync_or_fdatasync_success(
   rtems_libio_t *iop
 );
 
diff --git a/cpukit/libcsupport/src/__usrenv.c b/cpukit/libcsupport/src/__usrenv.c
index d26e736..df9bdc5 100644
--- a/cpukit/libcsupport/src/__usrenv.c
+++ b/cpukit/libcsupport/src/__usrenv.c
@@ -47,8 +47,8 @@ const rtems_filesystem_file_handlers_r rtems_filesystem_null_handlers = {
   .lseek_h = rtems_filesystem_default_lseek,
   .fstat_h = null_handler_fstat,
   .ftruncate_h = rtems_filesystem_default_ftruncate,
-  .fsync_h = rtems_filesystem_default_fsync,
-  .fdatasync_h = rtems_filesystem_default_fdatasync,
+  .fsync_h = rtems_filesystem_default_fsync_or_fdatasync,
+  .fdatasync_h = rtems_filesystem_default_fsync_or_fdatasync,
   .fcntl_h = rtems_filesystem_default_fcntl
 };
 
diff --git a/cpukit/libfs/Makefile.am b/cpukit/libfs/Makefile.am
index 18c4c47..342f5eb 100644
--- a/cpukit/libfs/Makefile.am
+++ b/cpukit/libfs/Makefile.am
@@ -16,7 +16,9 @@ libdefaultfs_a_SOURCES = \
     src/defaults/default_lock_and_unlock.c \
     src/defaults/default_eval_path.c \
     src/defaults/default_fchmod.c src/defaults/default_freenode.c \
-    src/defaults/default_fsync.c src/defaults/default_link.c \
+    src/defaults/default_fsync.c \
+    src/defaults/default_fsync_success.c \
+    src/defaults/default_link.c \
     src/defaults/default_read.c src/defaults/default_rmnod.c \
     src/defaults/default_chown.c \
     src/defaults/default_fcntl.c src/defaults/default_fsmount.c \
@@ -24,7 +26,7 @@ libdefaultfs_a_SOURCES = \
     src/defaults/default_lseek_success.c \
     src/defaults/default_readlink.c src/defaults/default_statvfs.c \
     src/defaults/default_utime.c \
-    src/defaults/default_fdatasync.c  src/defaults/default_fstat.c \
+    src/defaults/default_fstat.c \
     src/defaults/default_ioctl.c src/defaults/default_mount.c \
     src/defaults/default_rename.c src/defaults/default_symlink.c \
     src/defaults/default_write.c \
@@ -42,7 +44,7 @@ libimfs_a_SOURCES += src/imfs/deviceerrno.c src/imfs/deviceio.c \
     src/imfs/fifoimfs_init.c src/imfs/imfs_chown.c src/imfs/imfs_config.c \
     src/imfs/imfs_creat.c src/imfs/imfs_debug.c src/imfs/imfs_directory.c \
     src/imfs/imfs_eval.c src/imfs/imfs_fchmod.c \
-    src/imfs/imfs_fdatasync.c src/imfs/imfs_fifo.c \
+    src/imfs/imfs_fifo.c \
     src/imfs/imfs_fsunmount.c \
     src/imfs/imfs_handlers_device.c \
     src/imfs/imfs_handlers_directory.c src/imfs/imfs_handlers_link.c \
diff --git a/cpukit/libfs/src/defaults/default_fdatasync.c b/cpukit/libfs/src/defaults/default_fdatasync.c
deleted file mode 100644
index 90677df..0000000
--- a/cpukit/libfs/src/defaults/default_fdatasync.c
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- *  COPYRIGHT (c) 2010.
- *  On-Line Applications Research Corporation (OAR).
- *
- *  The license and distribution terms for this file may be
- *  found in the file LICENSE in this distribution or at
- *  http://www.rtems.com/license/LICENSE.
- *
- *  $Id$
- */
-
-#include <rtems/libio.h>
-#include <rtems/libio_.h>
-#include <rtems/seterr.h>
-
-int rtems_filesystem_default_fdatasync(
-  rtems_libio_t *iop
-)
-{
-  rtems_set_errno_and_return_minus_one( ENOTSUP );
-}
diff --git a/cpukit/libfs/src/defaults/default_fsync.c b/cpukit/libfs/src/defaults/default_fsync.c
index 5cd352e..d610af8 100644
--- a/cpukit/libfs/src/defaults/default_fsync.c
+++ b/cpukit/libfs/src/defaults/default_fsync.c
@@ -9,13 +9,15 @@
  *  $Id$
  */
 
-#include <rtems/libio.h>
+#if HAVE_CONFIG_H
+  #include "config.h"
+#endif
+
 #include <rtems/libio_.h>
-#include <rtems/seterr.h>
 
-int rtems_filesystem_default_fsync(
+int rtems_filesystem_default_fsync_or_fdatasync(
   rtems_libio_t *iop
 )
 {
-  rtems_set_errno_and_return_minus_one( ENOTSUP );
+  rtems_set_errno_and_return_minus_one( EINVAL );
 }
diff --git a/cpukit/libfs/src/defaults/default_fsync_success.c b/cpukit/libfs/src/defaults/default_fsync_success.c
new file mode 100644
index 0000000..591527e
--- /dev/null
+++ b/cpukit/libfs/src/defaults/default_fsync_success.c
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2012 embedded brains GmbH.  All rights reserved.
+ *
+ *  embedded brains GmbH
+ *  Obere Lagerstr. 30
+ *  82178 Puchheim
+ *  Germany
+ *  <rtems at embedded-brains.de>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ */
+
+#if HAVE_CONFIG_H
+  #include "config.h"
+#endif
+
+#include <rtems/libio_.h>
+
+int rtems_filesystem_default_fsync_or_fdatasync_success(
+  rtems_libio_t *iop
+)
+{
+  return 0;
+}
diff --git a/cpukit/libfs/src/defaults/default_handlers.c b/cpukit/libfs/src/defaults/default_handlers.c
index 286c2b4..2a10a19 100644
--- a/cpukit/libfs/src/defaults/default_handlers.c
+++ b/cpukit/libfs/src/defaults/default_handlers.c
@@ -30,7 +30,7 @@ const rtems_filesystem_file_handlers_r rtems_filesystem_handlers_default = {
   .lseek_h = rtems_filesystem_default_lseek,
   .fstat_h = rtems_filesystem_default_fstat,
   .ftruncate_h = rtems_filesystem_default_ftruncate,
-  .fsync_h = rtems_filesystem_default_fsync,
-  .fdatasync_h = rtems_filesystem_default_fdatasync,
+  .fsync_h = rtems_filesystem_default_fsync_or_fdatasync,
+  .fdatasync_h = rtems_filesystem_default_fsync_or_fdatasync,
   .fcntl_h = rtems_filesystem_default_fcntl
 };
diff --git a/cpukit/libfs/src/devfs/devfs_init.c b/cpukit/libfs/src/devfs/devfs_init.c
index 070aced..db856d2 100644
--- a/cpukit/libfs/src/devfs/devfs_init.c
+++ b/cpukit/libfs/src/devfs/devfs_init.c
@@ -45,8 +45,8 @@ const rtems_filesystem_file_handlers_r devFS_file_handlers = {
   .lseek_h = rtems_filesystem_default_lseek,
   .fstat_h = devFS_stat,
   .ftruncate_h = rtems_filesystem_default_ftruncate,
-  .fsync_h = rtems_filesystem_default_fsync,
-  .fdatasync_h = rtems_filesystem_default_fdatasync,
+  .fsync_h = rtems_filesystem_default_fsync_or_fdatasync,
+  .fdatasync_h = rtems_filesystem_default_fsync_or_fdatasync,
   .fcntl_h = rtems_filesystem_default_fcntl
 };
 
diff --git a/cpukit/libfs/src/imfs/imfs.h b/cpukit/libfs/src/imfs/imfs.h
index 2a851ac..8d68c07 100644
--- a/cpukit/libfs/src/imfs/imfs.h
+++ b/cpukit/libfs/src/imfs/imfs.h
@@ -476,10 +476,6 @@ extern int IMFS_rename(
   size_t namelen
 );
 
-extern int IMFS_fdatasync(
-  rtems_libio_t *iop
-);
-
 extern void IMFS_create_orphan(
   IMFS_jnode_t *jnode
 );
diff --git a/cpukit/libfs/src/imfs/imfs_fdatasync.c b/cpukit/libfs/src/imfs/imfs_fdatasync.c
deleted file mode 100644
index 6b107bf..0000000
--- a/cpukit/libfs/src/imfs/imfs_fdatasync.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- *  IMFS_fdatasync
- *
- *  The following routine does a sync on an IMFS node.  The In Memory
- *  File System is always in sync, therefore this routine always returns
- *  pass.
- *
- *  COPYRIGHT (c) 1989-1999.
- *  On-Line Applications Research Corporation (OAR).
- *
- *  The license and distribution terms for this file may be
- *  found in the file LICENSE in this distribution or at
- *  http://www.rtems.com/license/LICENSE.
- *
- *  $Id$
- */
-
-#if HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "imfs.h"
-
-int IMFS_fdatasync(
-  rtems_libio_t *iop
-)
-{
-  return 0;
-}
diff --git a/cpukit/libfs/src/imfs/imfs_fifo.c b/cpukit/libfs/src/imfs/imfs_fifo.c
index 790471e..9852750 100644
--- a/cpukit/libfs/src/imfs/imfs_fifo.c
+++ b/cpukit/libfs/src/imfs/imfs_fifo.c
@@ -135,7 +135,7 @@ const rtems_filesystem_file_handlers_r IMFS_fifo_handlers = {
   IMFS_fifo_lseek,
   IMFS_stat,
   rtems_filesystem_default_ftruncate,
-  rtems_filesystem_default_fsync,
-  rtems_filesystem_default_fdatasync,
+  rtems_filesystem_default_fsync_or_fdatasync,
+  rtems_filesystem_default_fsync_or_fdatasync,
   rtems_filesystem_default_fcntl
 };
diff --git a/cpukit/libfs/src/imfs/imfs_handlers_device.c b/cpukit/libfs/src/imfs/imfs_handlers_device.c
index a6edfb1..df9ea1a 100644
--- a/cpukit/libfs/src/imfs/imfs_handlers_device.c
+++ b/cpukit/libfs/src/imfs/imfs_handlers_device.c
@@ -30,7 +30,7 @@ const rtems_filesystem_file_handlers_r IMFS_device_handlers = {
   device_lseek,
   IMFS_stat,
   device_ftruncate,
-  rtems_filesystem_default_fsync,
-  rtems_filesystem_default_fdatasync,
+  rtems_filesystem_default_fsync_or_fdatasync,
+  rtems_filesystem_default_fsync_or_fdatasync,
   rtems_filesystem_default_fcntl
 };
diff --git a/cpukit/libfs/src/imfs/imfs_handlers_directory.c b/cpukit/libfs/src/imfs/imfs_handlers_directory.c
index 4778f45..dfda4fc 100644
--- a/cpukit/libfs/src/imfs/imfs_handlers_directory.c
+++ b/cpukit/libfs/src/imfs/imfs_handlers_directory.c
@@ -30,7 +30,7 @@ const rtems_filesystem_file_handlers_r IMFS_directory_handlers = {
   imfs_dir_lseek,
   IMFS_stat,
   rtems_filesystem_default_ftruncate_directory,
-  rtems_filesystem_default_fsync,
-  IMFS_fdatasync,
+  rtems_filesystem_default_fsync_or_fdatasync_success,
+  rtems_filesystem_default_fsync_or_fdatasync_success,
   rtems_filesystem_default_fcntl
 };
diff --git a/cpukit/libfs/src/imfs/imfs_handlers_link.c b/cpukit/libfs/src/imfs/imfs_handlers_link.c
index 967aa14..fd68f77 100644
--- a/cpukit/libfs/src/imfs/imfs_handlers_link.c
+++ b/cpukit/libfs/src/imfs/imfs_handlers_link.c
@@ -30,7 +30,7 @@ const rtems_filesystem_file_handlers_r IMFS_link_handlers = {
   rtems_filesystem_default_lseek,
   IMFS_stat,  /* stat */
   rtems_filesystem_default_ftruncate,
-  rtems_filesystem_default_fsync,
-  rtems_filesystem_default_fdatasync,
+  rtems_filesystem_default_fsync_or_fdatasync,
+  rtems_filesystem_default_fsync_or_fdatasync,
   rtems_filesystem_default_fcntl
 };
diff --git a/cpukit/libfs/src/imfs/imfs_handlers_memfile.c b/cpukit/libfs/src/imfs/imfs_handlers_memfile.c
index 10e47fd..e179eab 100644
--- a/cpukit/libfs/src/imfs/imfs_handlers_memfile.c
+++ b/cpukit/libfs/src/imfs/imfs_handlers_memfile.c
@@ -30,7 +30,7 @@ const rtems_filesystem_file_handlers_r IMFS_memfile_handlers = {
   memfile_lseek,
   IMFS_stat,
   memfile_ftruncate,
-  IMFS_fdatasync,      /* fsync */
-  IMFS_fdatasync,
+  rtems_filesystem_default_fsync_or_fdatasync_success,
+  rtems_filesystem_default_fsync_or_fdatasync_success,
   rtems_filesystem_default_fcntl
 };
diff --git a/cpukit/libfs/src/nfsclient/src/nfs.c b/cpukit/libfs/src/nfsclient/src/nfs.c
index ee11853..27a4338 100644
--- a/cpukit/libfs/src/nfsclient/src/nfs.c
+++ b/cpukit/libfs/src/nfsclient/src/nfs.c
@@ -2634,8 +2634,8 @@ struct _rtems_filesystem_file_handlers_r nfs_file_file_handlers = {
 	.lseek_h     = nfs_file_lseek,
 	.fstat_h     = nfs_fstat,
 	.ftruncate_h = nfs_file_ftruncate,
-	.fsync_h     = rtems_filesystem_default_fsync,
-	.fdatasync_h = rtems_filesystem_default_fdatasync,
+	.fsync_h     = rtems_filesystem_default_fsync_or_fdatasync,
+	.fdatasync_h = rtems_filesystem_default_fsync_or_fdatasync,
 	.fcntl_h     = rtems_filesystem_default_fcntl
 };
 
@@ -2650,8 +2650,8 @@ struct _rtems_filesystem_file_handlers_r nfs_dir_file_handlers = {
 	.lseek_h     = nfs_dir_lseek,
 	.fstat_h     = nfs_fstat,
 	.ftruncate_h = rtems_filesystem_default_ftruncate_directory,
-	.fsync_h     = rtems_filesystem_default_fsync,
-	.fdatasync_h = rtems_filesystem_default_fdatasync,
+	.fsync_h     = rtems_filesystem_default_fsync_or_fdatasync,
+	.fdatasync_h = rtems_filesystem_default_fsync_or_fdatasync,
 	.fcntl_h     = rtems_filesystem_default_fcntl
 };
 
@@ -2666,8 +2666,8 @@ struct _rtems_filesystem_file_handlers_r nfs_link_file_handlers = {
 	.lseek_h     = rtems_filesystem_default_lseek,
 	.fstat_h     = nfs_fstat,
 	.ftruncate_h = rtems_filesystem_default_ftruncate,
-	.fsync_h     = rtems_filesystem_default_fsync,
-	.fdatasync_h = rtems_filesystem_default_fdatasync,
+	.fsync_h     = rtems_filesystem_default_fsync_or_fdatasync,
+	.fdatasync_h = rtems_filesystem_default_fsync_or_fdatasync,
 	.fcntl_h     = rtems_filesystem_default_fcntl
 };
 
diff --git a/cpukit/libfs/src/rfs/rtems-rfs-rtems-dev.c b/cpukit/libfs/src/rfs/rtems-rfs-rtems-dev.c
index 9ca829e..d66e429 100644
--- a/cpukit/libfs/src/rfs/rtems-rfs-rtems-dev.c
+++ b/cpukit/libfs/src/rfs/rtems-rfs-rtems-dev.c
@@ -258,7 +258,7 @@ const rtems_filesystem_file_handlers_r rtems_rfs_rtems_device_handlers = {
   .lseek_h     = rtems_rfs_rtems_device_lseek,
   .fstat_h     = rtems_rfs_rtems_fstat,
   .ftruncate_h = rtems_rfs_rtems_device_ftruncate,
-  .fsync_h     = rtems_filesystem_default_fsync,
-  .fdatasync_h = rtems_filesystem_default_fdatasync,
+  .fsync_h     = rtems_filesystem_default_fsync_or_fdatasync,
+  .fdatasync_h = rtems_filesystem_default_fsync_or_fdatasync,
   .fcntl_h     = rtems_filesystem_default_fcntl
 };
diff --git a/cpukit/libfs/src/rfs/rtems-rfs-rtems-dir.c b/cpukit/libfs/src/rfs/rtems-rfs-rtems-dir.c
index 77eeeba..550973d 100644
--- a/cpukit/libfs/src/rfs/rtems-rfs-rtems-dir.c
+++ b/cpukit/libfs/src/rfs/rtems-rfs-rtems-dir.c
@@ -200,7 +200,7 @@ const rtems_filesystem_file_handlers_r rtems_rfs_rtems_dir_handlers = {
   .lseek_h     = rtems_rfs_rtems_dir_lseek,
   .fstat_h     = rtems_rfs_rtems_fstat,
   .ftruncate_h = rtems_filesystem_default_ftruncate_directory,
-  .fsync_h     = rtems_filesystem_default_fsync,
+  .fsync_h     = rtems_filesystem_default_fsync_or_fdatasync,
   .fdatasync_h = rtems_rfs_rtems_fdatasync,
   .fcntl_h     = rtems_filesystem_default_fcntl
 };
diff --git a/cpukit/libfs/src/rfs/rtems-rfs-rtems.c b/cpukit/libfs/src/rfs/rtems-rfs-rtems.c
index e6006a8..577a6e5 100644
--- a/cpukit/libfs/src/rfs/rtems-rfs-rtems.c
+++ b/cpukit/libfs/src/rfs/rtems-rfs-rtems.c
@@ -803,8 +803,8 @@ const rtems_filesystem_file_handlers_r rtems_rfs_rtems_link_handlers =
   .lseek_h     = rtems_filesystem_default_lseek,
   .fstat_h     = rtems_rfs_rtems_fstat,
   .ftruncate_h = rtems_filesystem_default_ftruncate,
-  .fsync_h     = rtems_filesystem_default_fsync,
-  .fdatasync_h = rtems_filesystem_default_fdatasync,
+  .fsync_h     = rtems_filesystem_default_fsync_or_fdatasync,
+  .fdatasync_h = rtems_filesystem_default_fsync_or_fdatasync,
   .fcntl_h     = rtems_filesystem_default_fcntl
 };
 
diff --git a/cpukit/libnetworking/lib/ftpfs.c b/cpukit/libnetworking/lib/ftpfs.c
index b50890e..c63ca2c 100644
--- a/cpukit/libnetworking/lib/ftpfs.c
+++ b/cpukit/libnetworking/lib/ftpfs.c
@@ -1303,8 +1303,8 @@ static const rtems_filesystem_file_handlers_r rtems_ftpfs_handlers = {
   .lseek_h = rtems_filesystem_default_lseek,
   .fstat_h = rtems_ftpfs_fstat,
   .ftruncate_h = rtems_ftpfs_ftruncate,
-  .fsync_h = rtems_filesystem_default_fsync,
-  .fdatasync_h = rtems_filesystem_default_fdatasync,
+  .fsync_h = rtems_filesystem_default_fsync_or_fdatasync,
+  .fdatasync_h = rtems_filesystem_default_fsync_or_fdatasync,
   .fcntl_h = rtems_filesystem_default_fcntl
 };
 
@@ -1317,7 +1317,7 @@ static const rtems_filesystem_file_handlers_r rtems_ftpfs_root_handlers = {
   .lseek_h = rtems_filesystem_default_lseek,
   .fstat_h = rtems_filesystem_default_fstat,
   .ftruncate_h = rtems_filesystem_default_ftruncate,
-  .fsync_h = rtems_filesystem_default_fsync,
-  .fdatasync_h = rtems_filesystem_default_fdatasync,
+  .fsync_h = rtems_filesystem_default_fsync_or_fdatasync,
+  .fdatasync_h = rtems_filesystem_default_fsync_or_fdatasync,
   .fcntl_h = rtems_filesystem_default_fcntl
 };
diff --git a/cpukit/libnetworking/lib/tftpDriver.c b/cpukit/libnetworking/lib/tftpDriver.c
index 0e284c1..0db4898 100644
--- a/cpukit/libnetworking/lib/tftpDriver.c
+++ b/cpukit/libnetworking/lib/tftpDriver.c
@@ -1051,7 +1051,7 @@ static const rtems_filesystem_file_handlers_r rtems_tftp_handlers = {
    .lseek_h = rtems_filesystem_default_lseek,
    .fstat_h = rtems_filesystem_default_fstat,
    .ftruncate_h = rtems_tftp_ftruncate,
-   .fsync_h = rtems_filesystem_default_fsync,
-   .fdatasync_h = rtems_filesystem_default_fdatasync,
+   .fsync_h = rtems_filesystem_default_fsync_or_fdatasync,
+   .fdatasync_h = rtems_filesystem_default_fsync_or_fdatasync,
    .fcntl_h = rtems_filesystem_default_fcntl
 };
diff --git a/cpukit/libnetworking/rtems/rtems_syscall.c b/cpukit/libnetworking/rtems/rtems_syscall.c
index f043e09..9935a69 100644
--- a/cpukit/libnetworking/rtems/rtems_syscall.c
+++ b/cpukit/libnetworking/rtems/rtems_syscall.c
@@ -770,7 +770,7 @@ static const rtems_filesystem_file_handlers_r socket_handlers = {
 	rtems_filesystem_default_lseek,		/* lseek */
 	rtems_bsdnet_fstat,			/* fstat */
 	rtems_filesystem_default_ftruncate,	/* ftruncate */
-	rtems_filesystem_default_fsync,		/* fsync */
-	rtems_filesystem_default_fdatasync,	/* fdatasync */
+	rtems_filesystem_default_fsync_or_fdatasync,	/* fsync */
+	rtems_filesystem_default_fsync_or_fdatasync,	/* fdatasync */
 	rtems_bsdnet_fcntl 			/* fcntl */
 };




More information about the vc mailing list