+/*
+ * Do a per-volume sync. We use this just before updating the progress file, so
+ * that any changes -- data and metadata -- will have made it to disk, without
+ * causing a sync of every mounted volume.
+ *
+ */
+
+static void
+sync_volume(const char *path) {
+ int full_sync = FSCTL_SYNC_FULLSYNC | FSCTL_SYNC_WAIT;
+
+ (void)fsctl(path, FSCTL_SYNC_VOLUME, &full_sync, 0);
+ return;
+}
+