#include "ostree-core-private.h"
#include "ostree-repo-private.h"
+#include "ostree-autocleanups.h"
#include "otutil.h"
typedef struct {
* Prune static deltas, if COMMIT is specified then delete static delta files only
* targeting that commit; otherwise any static delta of non existing commits are
* deleted.
+ *
+ * This function takes an exclusive lock on the @self repository.
*/
gboolean
ostree_repo_prune_static_deltas (OstreeRepo *self, const char *commit,
GCancellable *cancellable,
GError **error)
{
+ g_autoptr(OstreeRepoAutoLock) lock =
+ ostree_repo_auto_lock_push (self, OSTREE_REPO_LOCK_EXCLUSIVE, cancellable,
+ error);
+ if (!lock)
+ return FALSE;
+
g_autoptr(GPtrArray) deltas = NULL;
if (!ostree_repo_list_static_delta_names (self, &deltas,
cancellable, error))
* Use the %OSTREE_REPO_PRUNE_FLAGS_NO_PRUNE to just determine
* statistics on objects that would be deleted, without actually
* deleting them.
+ *
+ * This function takes an exclusive lock on the @self repository.
*/
gboolean
ostree_repo_prune (OstreeRepo *self,
GCancellable *cancellable,
GError **error)
{
+ g_autoptr(OstreeRepoAutoLock) lock =
+ ostree_repo_auto_lock_push (self, OSTREE_REPO_LOCK_EXCLUSIVE, cancellable,
+ error);
+ if (!lock)
+ return FALSE;
+
g_autoptr(GHashTable) objects = NULL;
gboolean refs_only = flags & OSTREE_REPO_PRUNE_FLAGS_REFS_ONLY;
*
* The %OSTREE_REPO_PRUNE_FLAGS_NO_PRUNE flag may be specified to just determine
* statistics on objects that would be deleted, without actually deleting them.
+ *
+ * This function takes an exclusive lock on the @self repository.
*/
gboolean
ostree_repo_prune_from_reachable (OstreeRepo *self,
GCancellable *cancellable,
GError **error)
{
+ g_autoptr(OstreeRepoAutoLock) lock =
+ ostree_repo_auto_lock_push (self, OSTREE_REPO_LOCK_EXCLUSIVE, cancellable,
+ error);
+ if (!lock)
+ return FALSE;
+
g_autoptr(GHashTable) objects = NULL;
if (!ostree_repo_list_objects (self, OSTREE_REPO_LIST_OBJECTS_ALL | OSTREE_REPO_LIST_OBJECTS_NO_PARENTS,