Rename genhd wrapper to blkdev
authorMichael Jeanson <mjeanson@efficios.com>
Tue, 5 Apr 2022 18:57:41 +0000 (14:57 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 7 Apr 2022 19:29:01 +0000 (15:29 -0400)
The genhd.h header was folded into blkdev.h in v5.18, rename our wrapper
to follow upstream.

Change-Id: I4ec94fb94d11712dd20f0680aea1de77fbfa9d17
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/wrapper/blkdev.h [new file with mode: 0644]
include/wrapper/genhd.h [deleted file]
src/lttng-statedump-impl.c

diff --git a/include/wrapper/blkdev.h b/include/wrapper/blkdev.h
new file mode 100644 (file)
index 0000000..0d5ad90
--- /dev/null
@@ -0,0 +1,107 @@
+/* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
+ *
+ * wrapper/blkdev.h
+ *
+ * wrapper around block layer functions and data structures. Using
+ * KALLSYMS to get its address when available, else we need to have a
+ * kernel that exports this function to GPL modules.
+ *
+ * Copyright (C) 2011-2014 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ */
+
+#ifndef _LTTNG_WRAPPER_BLKDEV_H
+#define _LTTNG_WRAPPER_BLKDEV_H
+
+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,18,0))
+#include <linux/blkdev.h>
+#else
+#include <linux/genhd.h>
+#endif
+
+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,17,0))
+#define LTTNG_GENHD_FL_HIDDEN GENHD_FL_HIDDEN
+#else
+#define LTTNG_GENHD_FL_HIDDEN GENHD_FL_SUPPRESS_PARTITION_INFO
+#endif
+
+#ifdef CONFIG_KALLSYMS_ALL
+
+#include <linux/kallsyms.h>
+#include <wrapper/kallsyms.h>
+
+static inline
+struct class *wrapper_get_block_class(void)
+{
+       struct class *ptr_block_class;
+
+       ptr_block_class = (struct class *) kallsyms_lookup_dataptr("block_class");
+       if (!ptr_block_class) {
+               printk_once(KERN_WARNING "LTTng: block_class symbol lookup failed.\n");
+               return NULL;
+       }
+       return ptr_block_class;
+}
+
+/*
+ * Canary function to check for 'block_class' at compile time.
+ *
+ * From 'include/linux/blkdev.h':
+ *
+ *   extern struct class block_class;
+ */
+static inline
+struct class *__canary__get_block_class(void)
+{
+       return &block_class;
+}
+
+static inline
+struct device_type *wrapper_get_disk_type(void)
+{
+       struct device_type *ptr_disk_type;
+
+       ptr_disk_type = (struct device_type *) kallsyms_lookup_dataptr("disk_type");
+       if (!ptr_disk_type) {
+               printk_once(KERN_WARNING "LTTng: disk_type symbol lookup failed.\n");
+               return NULL;
+       }
+       return ptr_disk_type;
+}
+
+/*
+ * No canary for 'disk_type', it's only defined in 'block/genhd.c'.
+ *
+ * static inline
+ * struct device_type *__canary__get_disk_type(void)
+ * {
+ *     return &disk_type;
+ * }
+ */
+
+#else
+
+static inline
+struct class *wrapper_get_block_class(void)
+{
+       /*
+        * Symbol block_class is not exported.
+        * TODO: return &block_class;
+        */
+       /* Feature currently unavailable without KALLSYMS_ALL */
+       return NULL;
+}
+
+static inline
+struct device_type *wrapper_get_disk_type(void)
+{
+       /*
+        * Symbol disk_type is not exported.
+        * TODO: return &disk_type;
+        */
+       /* Feature currently unavailable without KALLSYMS_ALL */
+       return NULL;
+}
+
+#endif
+
+#endif /* _LTTNG_WRAPPER_BLKDEV_H */
diff --git a/include/wrapper/genhd.h b/include/wrapper/genhd.h
deleted file mode 100644 (file)
index 4a59b68..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-/* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
- *
- * wrapper/genhd.h
- *
- * wrapper around block layer functions and data structures. Using
- * KALLSYMS to get its address when available, else we need to have a
- * kernel that exports this function to GPL modules.
- *
- * Copyright (C) 2011-2014 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
- */
-
-#ifndef _LTTNG_WRAPPER_GENHD_H
-#define _LTTNG_WRAPPER_GENHD_H
-
-#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,18,0))
-#include <linux/blkdev.h>
-#else
-#include <linux/genhd.h>
-#endif
-
-#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,17,0))
-#define LTTNG_GENHD_FL_HIDDEN GENHD_FL_HIDDEN
-#else
-#define LTTNG_GENHD_FL_HIDDEN GENHD_FL_SUPPRESS_PARTITION_INFO
-#endif
-
-#ifdef CONFIG_KALLSYMS_ALL
-
-#include <linux/kallsyms.h>
-#include <wrapper/kallsyms.h>
-
-static inline
-struct class *wrapper_get_block_class(void)
-{
-       struct class *ptr_block_class;
-
-       ptr_block_class = (struct class *) kallsyms_lookup_dataptr("block_class");
-       if (!ptr_block_class) {
-               printk_once(KERN_WARNING "LTTng: block_class symbol lookup failed.\n");
-               return NULL;
-       }
-       return ptr_block_class;
-}
-
-/*
- * Canary function to check for 'block_class' at compile time.
- *
- * From 'include/linux/genhd.h':
- *
- *   extern struct class block_class;
- */
-static inline
-struct class *__canary__get_block_class(void)
-{
-       return &block_class;
-}
-
-static inline
-struct device_type *wrapper_get_disk_type(void)
-{
-       struct device_type *ptr_disk_type;
-
-       ptr_disk_type = (struct device_type *) kallsyms_lookup_dataptr("disk_type");
-       if (!ptr_disk_type) {
-               printk_once(KERN_WARNING "LTTng: disk_type symbol lookup failed.\n");
-               return NULL;
-       }
-       return ptr_disk_type;
-}
-
-/*
- * No canary for 'disk_type', it's only defined in 'block/genhd.c'.
- *
- * static inline
- * struct device_type *__canary__get_disk_type(void)
- * {
- *     return &disk_type;
- * }
- */
-
-#else
-
-static inline
-struct class *wrapper_get_block_class(void)
-{
-       /*
-        * Symbol block_class is not exported.
-        * TODO: return &block_class;
-        */
-       /* Feature currently unavailable without KALLSYMS_ALL */
-       return NULL;
-}
-
-static inline
-struct device_type *wrapper_get_disk_type(void)
-{
-       /*
-        * Symbol disk_type is not exported.
-        * TODO: return &disk_type;
-        */
-       /* Feature currently unavailable without KALLSYMS_ALL */
-       return NULL;
-}
-
-#endif
-
-#endif /* _LTTNG_WRAPPER_GENHD_H */
index 4d7b2921f1bac52ba43a6a271f69ff3aa8865ca2..0e7530906c5c79b87a2e9cf02a23bec5e5a8f83b 100644 (file)
@@ -41,7 +41,7 @@
 #include <wrapper/namespace.h>
 #include <wrapper/irq.h>
 #include <wrapper/tracepoint.h>
 #include <wrapper/namespace.h>
 #include <wrapper/irq.h>
 #include <wrapper/tracepoint.h>
-#include <wrapper/genhd.h>
+#include <wrapper/blkdev.h>
 #include <wrapper/file.h>
 #include <wrapper/fdtable.h>
 #include <wrapper/sched.h>
 #include <wrapper/file.h>
 #include <wrapper/fdtable.h>
 #include <wrapper/sched.h>
This page took 0.030251 seconds and 4 git commands to generate.