aboutsummaryrefslogtreecommitdiff
path: root/libnetfs/fsys-syncfs.c
diff options
context:
space:
mode:
authorJustus Winter <justus@gnupg.org>2016-10-05 15:38:58 +0200
committerJustus Winter <justus@gnupg.org>2017-09-12 10:41:35 +0200
commit5fef1b7f22ec0ee3730b80bbf972dbf9a8995091 (patch)
tree29890aef362b5a8ebffb4721a1967b818a22a3af /libnetfs/fsys-syncfs.c
parent116552c075abf1d22057a608fee9d27684bcbbe5 (diff)
downloadhurd-5fef1b7f22ec0ee3730b80bbf972dbf9a8995091.tar.gz
hurd-5fef1b7f22ec0ee3730b80bbf972dbf9a8995091.tar.bz2
hurd-5fef1b7f22ec0ee3730b80bbf972dbf9a8995091.zip
libfshelp: Add function to map over all active translators.
* libdiskfs/file-syncfs.c (diskfs_S_file_syncfs): Use the new function. * libdiskfs/fsys-options.c (diskfs_S_fsys_set_options): Likewise. * libdiskfs/fsys-syncfs.c (diskfs_S_fsys_syncfs): Likewise. * libdiskfs/shutdown.c (diskfs_shutdown): Likewise. * libfshelp/fshelp.h (fshelp_map_active_translators): New declaration. * libfshelp/translator-list.c (fshelp_map_active_translators): New function. * libnetfs/file-syncfs.c (netfs_S_file_syncfs): Use the new function. * libnetfs/fsys-set-options.c (netfs_S_fsys_set_options): Likewise. * libnetfs/fsys-syncfs.c (netfs_S_fsys_syncfs): Likewise. * libnetfs/shutdown.c (netfs_shutdown): Likewise.
Diffstat (limited to 'libnetfs/fsys-syncfs.c')
-rw-r--r--libnetfs/fsys-syncfs.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/libnetfs/fsys-syncfs.c b/libnetfs/fsys-syncfs.c
index e232936e..904e9246 100644
--- a/libnetfs/fsys-syncfs.c
+++ b/libnetfs/fsys-syncfs.c
@@ -20,6 +20,21 @@
#include "netfs.h"
#include "fsys_S.h"
+#include <hurd/fsys.h>
+
+struct args
+{
+ int wait;
+};
+
+static error_t
+helper (void *cookie, const char *name, mach_port_t control)
+{
+ struct args *args = cookie;
+ (void) name;
+ fsys_syncfs (control, args->wait, 1);
+ return 0;
+}
error_t
netfs_S_fsys_syncfs (struct netfs_control *cntl,
@@ -30,6 +45,13 @@ netfs_S_fsys_syncfs (struct netfs_control *cntl,
{
struct iouser *cred;
error_t err;
+ struct args args = { wait };
+
+ if (! cntl)
+ return EOPNOTSUPP;
+
+ if (children)
+ fshelp_map_active_translators (helper, &args);
err = iohelp_create_simple_iouser (&cred, 0, 0);
if (err)