[master] b6fef8a4d Move struct storage definition to storage_simple.h

Nils Goroll nils.goroll at uplex.de
Sat Sep 25 10:39:07 UTC 2021


commit b6fef8a4d2323b753e089a7e4beba1d5e283bcff
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Sat Sep 25 12:24:50 2021 +0200

    Move struct storage definition to storage_simple.h
    
    Use of SML is supported by the storage API though the sml_* function
    pointers.
    
    Yet, like struct object, struct storage is part of the simple storage
    (sml) implementation and does not belong to the storage API. Storage
    not using SML (that is, code which does not include storage_simple.h)
    should not be concerned with struct storage.

diff --git a/bin/varnishd/storage/storage.h b/bin/varnishd/storage/storage.h
index 193b273e3..060c41a24 100644
--- a/bin/varnishd/storage/storage.h
+++ b/bin/varnishd/storage/storage.h
@@ -47,21 +47,6 @@ enum baninfo {
 	BI_DROP
 };
 
-/* Storage -----------------------------------------------------------*/
-
-struct storage {
-	unsigned		magic;
-#define STORAGE_MAGIC		0x1a4e51c0
-
-
-	VTAILQ_ENTRY(storage)	list;
-	void			*priv;
-
-	unsigned char		*ptr;
-	unsigned		len;
-	unsigned		space;
-};
-
 /* Prototypes --------------------------------------------------------*/
 
 typedef void storage_init_f(struct stevedore *, int ac, char * const *av);
@@ -80,6 +65,7 @@ typedef void *storage_allocbuf_f(struct worker *, const struct stevedore *,
 typedef void storage_freebuf_f(struct worker *, const struct stevedore *,
     uintptr_t priv);
 
+struct storage;
 typedef struct object *sml_getobj_f(struct worker *, struct objcore *);
 typedef struct storage *sml_alloc_f(const struct stevedore *, size_t size);
 typedef void sml_free_f(struct storage *);
diff --git a/bin/varnishd/storage/storage_simple.h b/bin/varnishd/storage/storage_simple.h
index 3f288aef7..881e0b857 100644
--- a/bin/varnishd/storage/storage_simple.h
+++ b/bin/varnishd/storage/storage_simple.h
@@ -33,6 +33,21 @@
  *
  */
 
+/* Storage -----------------------------------------------------------*/
+
+struct storage {
+	unsigned		magic;
+#define STORAGE_MAGIC		0x1a4e51c0
+
+
+	VTAILQ_ENTRY(storage)	list;
+	void			*priv;
+
+	unsigned char		*ptr;
+	unsigned		len;
+	unsigned		space;
+};
+
 /* Object ------------------------------------------------------------*/
 
 VTAILQ_HEAD(storagehead, storage);


More information about the varnish-commit mailing list