self->disable_fsync = disable_fsync;
}
+/**
+ * ostree_repo_get_disable_fsync:
+ * @self: An #OstreeRepo
+ *
+ * For more information see ostree_repo_set_disable_fsync().
+ *
+ * Returns: Whether or not fsync() is enabled for this repo.
+ */
+gboolean
+ostree_repo_get_disable_fsync (OstreeRepo *self)
+{
+ return self->disable_fsync;
+}
/* Replace the contents of a file, honoring the repository's fsync
* policy.
void ostree_repo_set_disable_fsync (OstreeRepo *self,
gboolean disable_fsync);
+gboolean ostree_repo_get_disable_fsync (OstreeRepo *self);
+
gboolean ostree_repo_is_system (OstreeRepo *repo);
gboolean ostree_repo_is_writable (OstreeRepo *self,
if (!glnx_shutil_rm_rf_at (osdeploy_dfd, checkout_target_name, cancellable, error))
goto out;
- if (!ostree_repo_checkout_tree_at (repo, &checkout_opts, osdeploy_dfd,
- checkout_target_name, csum,
- cancellable, error))
- goto out;
+ /* We end up using syncfs for the entire filesystem, so turn off
+ * OstreeRepo level fsync.
+ */
+ { gboolean fsync_was_disabled = ostree_repo_get_disable_fsync (repo);
+ gboolean checkout_success;
+
+ ostree_repo_set_disable_fsync (repo, TRUE);
+ checkout_success = ostree_repo_checkout_tree_at (repo, &checkout_opts, osdeploy_dfd,
+ checkout_target_name, csum,
+ cancellable, error);
+ ostree_repo_set_disable_fsync (repo, fsync_was_disabled);
+ if (!checkout_success)
+ goto out;
+ }
if (!glnx_opendirat (osdeploy_dfd, checkout_target_name, TRUE, &ret_fd, error))
goto out;