changeset 540:41497496e857

objstore: move the impl header out of the include directory There is no reason to keep it in the include directory where it can unnecessarily confuse developers. Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
author Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
date Wed, 07 Nov 2018 18:06:06 -0500
parents 6859642ba2bd
children a46d8d36f799
files src/objstore/CMakeLists.txt src/objstore/include/nomad/objstore_impl.h src/objstore/obj.c src/objstore/objstore.c src/objstore/objstore_impl.h src/objstore/vdev.c src/objstore/vol.c
diffstat 7 files changed, 69 insertions(+), 75 deletions(-) [+]
line wrap: on
line diff
--- a/src/objstore/CMakeLists.txt	Wed Nov 07 10:58:26 2018 -0500
+++ b/src/objstore/CMakeLists.txt	Wed Nov 07 18:06:06 2018 -0500
@@ -36,7 +36,6 @@
 	PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
 install(FILES	include/nomad/objstore.h
 		include/nomad/objstore_backend.h
-		# not shipping objstore_impl.h since it is internal to the lib
 	DESTINATION include/nomad
 	PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)
 
--- a/src/objstore/include/nomad/objstore_impl.h	Wed Nov 07 10:58:26 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2015-2018 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#ifndef __NOMAD_OBJSTORE_IMPL_H
-#define __NOMAD_OBJSTORE_IMPL_H
-
-/*
- * There are three objstore include files.  Make sure to include the right
- * one.
- *
- * (1) If you are simply trying to use objstore, include <nomad/objstore.h>.
- * (2) If you are trying to write a backend, include <nomad/objstore_backend.h>.
- * (3) If you are developing objstore itself, include <nomad/objstore_impl.h>.
- */
-
-#include <jeffpc/mem.h>
-#include <jeffpc/list.h>
-
-#include <nomad/objstore.h>
-#include <nomad/objstore_backend.h>
-
-/* backend support */
-struct backend {
-	struct list_node node;
-	const struct objstore_vdev_def *def;
-	void *module;
-};
-
-/* internal backend management */
-extern struct backend *backend_lookup(const char *name);
-
-/* internal volume management */
-extern int vol_init(void);
-extern void vol_fini(void);
-extern void vol_add_vdev(struct objstore *vol, struct objstore_vdev *vdev);
-
-/* internal vdev management */
-extern int vdev_init(void);
-extern void vdev_fini(void);
-
-/* internal object management */
-extern struct mem_cache *obj_cache;
-extern struct mem_cache *objver_cache;
-extern struct obj *allocobj(void);
-extern void freeobj(struct obj *obj);
-extern struct objver *allocobjver(void);
-extern void freeobjver(struct objver *ver);
-
-REFCNT_INLINE_FXNS(struct obj, obj, refcnt, freeobj, NULL);
-
-#endif
--- a/src/objstore/obj.c	Wed Nov 07 10:58:26 2018 -0500
+++ b/src/objstore/obj.c	Wed Nov 07 18:06:06 2018 -0500
@@ -25,7 +25,8 @@
 #include <jeffpc/error.h>
 
 #include <nomad/objstore.h>
-#include <nomad/objstore_impl.h>
+
+#include "objstore_impl.h"
 
 struct mem_cache *obj_cache;
 struct mem_cache *objver_cache;
--- a/src/objstore/objstore.c	Wed Nov 07 10:58:26 2018 -0500
+++ b/src/objstore/objstore.c	Wed Nov 07 18:06:06 2018 -0500
@@ -30,7 +30,8 @@
 
 #include <nomad/config.h>
 #include <nomad/objstore.h>
-#include <nomad/objstore_impl.h>
+
+#include "objstore_impl.h"
 
 static struct list backends;
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/objstore/objstore_impl.h	Wed Nov 07 18:06:06 2018 -0500
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2015-2018 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#ifndef __OBJSTORE_IMPL_H
+#define __OBJSTORE_IMPL_H
+
+#include <jeffpc/mem.h>
+#include <jeffpc/list.h>
+
+#include <nomad/objstore.h>
+#include <nomad/objstore_backend.h>
+
+/* backend support */
+struct backend {
+	struct list_node node;
+	const struct objstore_vdev_def *def;
+	void *module;
+};
+
+/* internal backend management */
+extern struct backend *backend_lookup(const char *name);
+
+/* internal volume management */
+extern int vol_init(void);
+extern void vol_fini(void);
+extern void vol_add_vdev(struct objstore *vol, struct objstore_vdev *vdev);
+
+/* internal vdev management */
+extern int vdev_init(void);
+extern void vdev_fini(void);
+
+/* internal object management */
+extern struct mem_cache *obj_cache;
+extern struct mem_cache *objver_cache;
+extern struct obj *allocobj(void);
+extern void freeobj(struct obj *obj);
+extern struct objver *allocobjver(void);
+extern void freeobjver(struct objver *ver);
+
+REFCNT_INLINE_FXNS(struct obj, obj, refcnt, freeobj, NULL);
+
+#endif
--- a/src/objstore/vdev.c	Wed Nov 07 10:58:26 2018 -0500
+++ b/src/objstore/vdev.c	Wed Nov 07 18:06:06 2018 -0500
@@ -23,7 +23,8 @@
 #include <jeffpc/error.h>
 
 #include <nomad/objstore.h>
-#include <nomad/objstore_impl.h>
+
+#include "objstore_impl.h"
 
 static struct mem_cache *vdev_cache;
 
--- a/src/objstore/vol.c	Wed Nov 07 10:58:26 2018 -0500
+++ b/src/objstore/vol.c	Wed Nov 07 18:06:06 2018 -0500
@@ -26,7 +26,8 @@
 #include <jeffpc/mem.h>
 
 #include <nomad/objstore.h>
-#include <nomad/objstore_impl.h>
+
+#include "objstore_impl.h"
 
 static struct mem_cache *vol_cache;
 static struct mem_cache *open_obj_cache;