aboutsummaryrefslogtreecommitdiff
path: root/odb/source.h
diff options
context:
space:
mode:
Diffstat (limited to 'odb/source.h')
-rw-r--r--odb/source.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/odb/source.h b/odb/source.h
index 4973fb4251..09cca839fe 100644
--- a/odb/source.h
+++ b/odb/source.h
@@ -57,6 +57,13 @@ struct odb_source {
* all associated resources. The function will never be called with a NULL pointer.
*/
void (*free)(struct odb_source *source);
+
+ /*
+ * This callback is expected to clear underlying caches of the object
+ * database source. The function is called when the repository has for
+ * example just been repacked so that new objects will become visible.
+ */
+ void (*reprepare)(struct odb_source *source);
};
/*
@@ -96,4 +103,14 @@ void odb_source_free(struct odb_source *source);
*/
void odb_source_release(struct odb_source *source);
+/*
+ * Reprepare the object database source and clear any caches. Depending on the
+ * backend used this may have the effect that concurrently-written objects
+ * become visible.
+ */
+static inline void odb_source_reprepare(struct odb_source *source)
+{
+ source->reprepare(source);
+}
+
#endif