[master] 6294c0cb2 object/stevedore: document required vs. optional callbacks

Nils Goroll nils.goroll at uplex.de
Tue Jun 9 10:25:06 UTC 2020


commit 6294c0cb29b49081c5eae45a8039f22e98c83211
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Tue Jun 9 12:17:59 2020 +0200

    object/stevedore: document required vs. optional callbacks

diff --git a/bin/varnishd/cache/cache_obj.h b/bin/varnishd/cache/cache_obj.h
index 5208afa0c..1f936a534 100644
--- a/bin/varnishd/cache/cache_obj.h
+++ b/bin/varnishd/cache/cache_obj.h
@@ -51,15 +51,17 @@ typedef void *objsetattr_f(struct worker *, struct objcore *,
 typedef void objtouch_f(struct worker *, struct objcore *, vtim_real now);
 
 struct obj_methods {
+	/* required */
 	objfree_f	*objfree;
 	objiterator_f	*objiterator;
 	objgetspace_f	*objgetspace;
 	objextend_f	*objextend;
+	objgetattr_f	*objgetattr;
+	objsetattr_f	*objsetattr;
+	/* optional */
 	objtrimstore_f	*objtrimstore;
 	objbocdone_f	*objbocdone;
 	objslim_f	*objslim;
-	objgetattr_f	*objgetattr;
-	objsetattr_f	*objsetattr;
 	objtouch_f	*objtouch;
 	objsetstate_f	*objsetstate;
 };
diff --git a/bin/varnishd/storage/storage.h b/bin/varnishd/storage/storage.h
index 32bd1a2fa..c6cda8998 100644
--- a/bin/varnishd/storage/storage.h
+++ b/bin/varnishd/storage/storage.h
@@ -95,7 +95,9 @@ struct stevedore {
 	/* Called in MGT process */
 	storage_init_f		*init;
 
-	/* Called in cache process */
+	/* Called in cache process
+	 * only allocobj is required, other callbacks are optional
+	 */
 	storage_open_f		*open;
 	storage_close_f		*close;
 	storage_allocobj_f	*allocobj;


More information about the varnish-commit mailing list