diff options
author | Colin Walters <walters@verbum.org> | 2018-04-23 17:53:04 -0400 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-04-30 17:24:51 +0000 |
commit | 8c1542134cf8a1a00d669c80da45c15c22fc0522 (patch) | |
tree | 504e42b762c26606bbe7dfd99cf84dbd4326a822 /src/libostree/ostree-repo.h | |
parent | 776ce5cc6afb77d971c7fa1fed86ba1badb7df21 (diff) | |
download | ostree-8c1542134cf8a1a00d669c80da45c15c22fc0522.tar.gz |
lib/repo: Enable locking by default, but drop external API
The code has been sitting around for a while but since I disabled
it by default, I doubt anyone is really using it or relying on it.
This patch and turns on locking by default, and also drops the
API which was only public in the experimental API builds.
Conceptually these are two distinct things, and we
may actually want to split up the patches.
I don't think this will break anyone, but it's hard to say for sure.
It's also going to be hard to find out until we actually release
I suspect...
But anyone who is broken should be able to add `locking=false` into
their repo config. On the flip side Endless has been shipping with
this enabled and it is reported to help.
The reason to drop the APIs: I'm a bit concerned about the interactions over time
between libostree's use of the API and any apps that start using it.
For example, if an app specifies a SHARED lock in their code, then
later internally we decide to temporarily grab an `EXCLUSIVE`, but the
app had a second thread/process that was `EXCLUSIVE` already, and
that process was waiting on the first bit of code, then we could
deadlock. I can't think of a real world situation where this would happen
yet though.
We are likely to in the future have say `fsck` take an external lock,
`checkout` grab a shared one, etc.
Closes: #1555
Approved by: jlebon
Diffstat (limited to 'src/libostree/ostree-repo.h')
-rw-r--r-- | src/libostree/ostree-repo.h | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/src/libostree/ostree-repo.h b/src/libostree/ostree-repo.h index 04b04416..8d3a7a6f 100644 --- a/src/libostree/ostree-repo.h +++ b/src/libostree/ostree-repo.h @@ -109,48 +109,6 @@ OstreeRepo * ostree_repo_create_at (int dfd, #ifdef OSTREE_ENABLE_EXPERIMENTAL_API -/** - * OstreeRepoLockType: - * @OSTREE_REPO_LOCK_SHARED: A shared lock - * @OSTREE_REPO_LOCK_EXCLUSIVE: An exclusive lock - * - * The type of repository lock to acquire. - * - * Since: 2017.14 - */ -typedef enum { - OSTREE_REPO_LOCK_SHARED, - OSTREE_REPO_LOCK_EXCLUSIVE -} OstreeRepoLockType; - -_OSTREE_PUBLIC -gboolean ostree_repo_lock_push (OstreeRepo *self, - OstreeRepoLockType lock_type, - GCancellable *cancellable, - GError **error); -_OSTREE_PUBLIC -gboolean ostree_repo_lock_pop (OstreeRepo *self, - GCancellable *cancellable, - GError **error); - -/** - * OstreeRepoAutoLock: (skip) - * - * This is simply an alias to #OstreeRepo used for automatic lock cleanup. - * See ostree_repo_auto_lock_push() for its intended usage. - * - * Since: 2017.14 - */ -typedef OstreeRepo OstreeRepoAutoLock; - -_OSTREE_PUBLIC -OstreeRepoAutoLock * ostree_repo_auto_lock_push (OstreeRepo *self, - OstreeRepoLockType lock_type, - GCancellable *cancellable, - GError **error); -_OSTREE_PUBLIC -void ostree_repo_auto_lock_cleanup (OstreeRepoAutoLock *lock); - _OSTREE_PUBLIC const gchar * ostree_repo_get_collection_id (OstreeRepo *self); _OSTREE_PUBLIC |