Add --disable-fsync option to pull-local, and API to repo

This will be used by guestmount - it's WAY faster.  We only take disks
as a unit, so it's safe.  If the process fails halfway through, we
just start over from scratch the next time anyways.
This commit is contained in:
Colin Walters committed 2014-01-31 22:18:13 -05:00
1 parent 2313bdcb62
commit 234ae70b4c
5 files changed
+33 -3

No files matched your search

+6 -3
View File
@@ -157,10 +157,13 @@ commit_loose_object_trusted (OstreeRepo *self,
/* Ensure that in case of a power cut, these files have the data we
* want. See http://lwn.net/Articles/322823/
*/
if (fsync (fd) == -1)
if (!self->disable_fsync)
{
ot_util_set_error_from_errno (error, errno);
goto out;
if (fsync (fd) == -1)
{
ot_util_set_error_from_errno (error, errno);
goto out;
}
}
if (!g_output_stream_close (temp_out, cancellable, error))