Move ref writing to be transaction-based

Rather than having separate write_ref calls, make clients start a
transaction, add some refs, and then commit it. While this doesn't
make it 100% atomic, it makes it easier for us to use an atomic
model, and it means we don't do as much I/O updating the summary
file and such.

https://bugzilla.gnome.org/show_bug.cgi?id=707644
This commit is contained in:
Jasper St. Pierre committed 2013-09-06 20:31:12 -04:00
1 parent bd2948e964
commit 91d3b90c9f
13 files changed
+189 -101

No files matched your search

+6
View File
@@ -39,6 +39,7 @@ struct OstreeRepo {
GFile *config_file;
GFile *transaction_lock_path;
GHashTable *txn_refs;
GMutex txn_stats_lock;
OstreeRepoTransactionStats txn_stats;
@@ -92,6 +93,11 @@ _ostree_repo_write_directory_meta (OstreeRepo *self,
guchar **out_csum,
GCancellable *cancellable,
GError **error);
gboolean
_ostree_repo_update_refs (OstreeRepo *self,
GHashTable *refs,
GCancellable *cancellable,
GError **error);
G_END_DECLS