summaryrefslogtreecommitdiff
path: root/libdiskfs
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1995-10-19 19:49:43 +0000
committerMiles Bader <miles@gnu.org>1995-10-19 19:49:43 +0000
commit4d306c0d3ba310ea97a60966de789900bb499c21 (patch)
tree86606e8131689a182b0887a1608e0739353df4c5 /libdiskfs
parent4674c4360ac70cf8394584270ac3b8c0776db0b1 (diff)
(periodic_sync): Hold DISKFS_FSYS_LOCK for reading while syncing.
Diffstat (limited to 'libdiskfs')
-rw-r--r--libdiskfs/fsys-syncfs.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libdiskfs/fsys-syncfs.c b/libdiskfs/fsys-syncfs.c
index 6ea8c774..81477113 100644
--- a/libdiskfs/fsys-syncfs.c
+++ b/libdiskfs/fsys-syncfs.c
@@ -52,6 +52,8 @@ diskfs_S_fsys_syncfs (fsys_t controlport,
if (!pi)
return EOPNOTSUPP;
+ rwlock_reader_lock (&diskfs_fsys_lock);
+
if (children)
diskfs_node_iterate (helper);
@@ -60,7 +62,11 @@ diskfs_S_fsys_syncfs (fsys_t controlport,
diskfs_sync_everything (wait);
diskfs_set_hypermetadata (wait, 0);
+
+ rwlock_reader_unlock (&diskfs_fsys_lock);
+
ports_port_deref (pi);
+
return 0;
}