File compat_no_bioset_initialized.patch of Package drbd.16493

diff -Naur drbd-9.0.16+git.ab9777df.orig/drbd/drbd-kernel-compat/drbd_wrappers.h drbd-9.0.16+git.ab9777df/drbd/drbd-kernel-compat/drbd_wrappers.h
--- drbd-9.0.16+git.ab9777df.orig/drbd/drbd-kernel-compat/drbd_wrappers.h	2018-12-10 15:36:51.485109170 +0800
+++ drbd-9.0.16+git.ab9777df/drbd/drbd-kernel-compat/drbd_wrappers.h	2018-12-10 16:13:27.248289076 +0800
@@ -1397,14 +1397,23 @@
 	*pool = mempool_create_slab_pool(min_nr, mem_cache);
 	return *pool == NULL ? -ENOMEM : 0;
 }
+#ifndef COMPAT_HAVE_BIOSET_INITIALIZED
 static inline bool
 bioset_initialized(struct bio_set **bs)
 {
 	return *bs != NULL;
 }
+#endif
 #else
 #define DRBD_MEMPOOL_T mempool_t
 #define DRBD_BIO_SET   bio_set
+#ifndef COMPAT_HAVE_BIOSET_INITIALIZED
+static inline bool
+bioset_initialized(struct bio_set *bs)
+{
+	return bs->bio_slab != NULL;
+}
+#endif
 #endif
 
 #endif
diff -Naur drbd-9.0.16+git.ab9777df.orig/drbd/drbd-kernel-compat/tests/have_bioset_initialized.c drbd-9.0.16+git.ab9777df/drbd/drbd-kernel-compat/tests/have_bioset_initialized.c
--- drbd-9.0.16+git.ab9777df.orig/drbd/drbd-kernel-compat/tests/have_bioset_initialized.c	1970-01-01 08:00:00.000000000 +0800
+++ drbd-9.0.16+git.ab9777df/drbd/drbd-kernel-compat/tests/have_bioset_initialized.c	2018-12-10 16:18:02.952053971 +0800
@@ -0,0 +1,14 @@
+#include <linux/bio.h>
+/*
+With linux v4.18 biosets get embedded
+commit 917a38c71af82185c39e31589587591fa764fb85
+Author: Kent Overstreet <kent.overstreet@gmail.com>
+Date:   Tue May 8 21:33:51 2018 -0400
+*/
+
+static inline bool foo(void)
+{
+	struct bio_set bio_set;
+
+	return bioset_initialized(&bio_set);
+}
openSUSE Build Service is sponsored by