[ostree] Honor disable_fsync during checkout also
- From: Vadim Rutkovsky <vrutkovsky src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ostree] Honor disable_fsync during checkout also
- Date: Wed, 4 Jun 2014 14:14:55 +0000 (UTC)
commit ef0057299945ff1d5e687c46ba65eb470263d3d5
Author: Vadim Rutkovsky <vrutkovs redhat com>
Date: Wed Jun 4 01:40:32 2014 +0200
Honor disable_fsync during checkout also
Finally, fsync to ensure all entries are on disk, unless disabled.
We support disabling this for cases like server-side buildroot
construction where we don't need to be robust against power loss
src/libostree/ostree-repo-checkout.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/src/libostree/ostree-repo-checkout.c b/src/libostree/ostree-repo-checkout.c
index 7bf8328..417e11f 100644
--- a/src/libostree/ostree-repo-checkout.c
+++ b/src/libostree/ostree-repo-checkout.c
@@ -661,10 +661,13 @@ checkout_tree_at (OstreeRepo *self,
* this should be configurable for the case where we're constructing
* buildroots.
*/
- if (fsync (destination_dfd) == -1)
+ if (!self->disable_fsync)
{
- ot_util_set_error_from_errno (error, errno);
- goto out;
+ if (fsync (destination_dfd) == -1)
+ {
+ ot_util_set_error_from_errno (error, errno);
+ goto out;
+ }
}
ret = TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]