Accepting request 650583 from network:ha-clustering:Factory
OBS-URL: https://build.opensuse.org/request/show/650583 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/drbd?expand=0&rev=72
This commit is contained in:
commit
b893dd4bdf
83
compat_have_mempool_init.patch
Normal file
83
compat_have_mempool_init.patch
Normal file
@ -0,0 +1,83 @@
|
||||
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-11-21 16:42:49.173926025 +0800
|
||||
+++ drbd-9.0.16+git.ab9777df/drbd/drbd-kernel-compat/drbd_wrappers.h 2018-11-21 16:44:33.373769980 +0800
|
||||
@@ -1348,8 +1348,11 @@
|
||||
#endif
|
||||
|
||||
#ifndef COMPAT_HAVE_BIOSET_INIT
|
||||
+
|
||||
+#ifndef COMPAT_HAVE_MEMPOOL_INIT
|
||||
#define mempool_free(V, P) mempool_free(V, *P)
|
||||
#define mempool_alloc(P, F) mempool_alloc(*P, F)
|
||||
+#endif
|
||||
|
||||
#ifndef COMPAT_HAVE_BIO_CLONE_FAST
|
||||
# define bio_clone_fast(bio, gfp, bio_set) bio_clone(bio, gfp)
|
||||
@@ -1358,7 +1361,13 @@
|
||||
#endif
|
||||
|
||||
#define bio_alloc_bioset(GFP, n, P) bio_alloc_bioset(GFP, n, *P)
|
||||
+
|
||||
+#ifndef COMPAT_HAVE_MEMPOOL_INIT
|
||||
#define DRBD_MEMPOOL_T mempool_t *
|
||||
+#else
|
||||
+#define DRBD_MEMPOOL_T mempool_t
|
||||
+#endif
|
||||
+
|
||||
#define DRBD_BIO_SET bio_set *
|
||||
static inline void bioset_exit(struct bio_set **bs)
|
||||
{
|
||||
@@ -1367,6 +1376,8 @@
|
||||
*bs = NULL;
|
||||
}
|
||||
}
|
||||
+
|
||||
+#ifndef COMPAT_HAVE_MEMPOOL_INIT
|
||||
static inline void mempool_exit(mempool_t **p)
|
||||
{
|
||||
if (*p) {
|
||||
@@ -1374,6 +1385,8 @@
|
||||
*p = NULL;
|
||||
}
|
||||
}
|
||||
+#endif
|
||||
+
|
||||
#if defined(COMPAT_HAVE_BIOSET_NEED_BVECS)
|
||||
#define bioset_init(BS, S, FP, F) __bioset_init(BS, S, FP, F)
|
||||
#else
|
||||
@@ -1385,6 +1398,8 @@
|
||||
*bs = bioset_create(size, front_pad, flags);
|
||||
return *bs == NULL ? -ENOMEM : 0;
|
||||
}
|
||||
+
|
||||
+#ifndef COMPAT_HAVE_MEMPOOL_INIT
|
||||
static inline int
|
||||
mempool_init_page_pool(mempool_t **pool, int min_nr, int order)
|
||||
{
|
||||
@@ -1397,6 +1412,8 @@
|
||||
*pool = mempool_create_slab_pool(min_nr, mem_cache);
|
||||
return *pool == NULL ? -ENOMEM : 0;
|
||||
}
|
||||
+#endif
|
||||
+
|
||||
static inline bool
|
||||
bioset_initialized(struct bio_set **bs)
|
||||
{
|
||||
diff -Naur drbd-9.0.16+git.ab9777df.orig/drbd/drbd-kernel-compat/tests/have_mempool_init.c drbd-9.0.16+git.ab9777df/drbd/drbd-kernel-compat/tests/have_mempool_init.c
|
||||
--- drbd-9.0.16+git.ab9777df.orig/drbd/drbd-kernel-compat/tests/have_mempool_init.c 1970-01-01 08:00:00.000000000 +0800
|
||||
+++ drbd-9.0.16+git.ab9777df/drbd/drbd-kernel-compat/tests/have_mempool_init.c 2018-11-21 16:43:42.429846044 +0800
|
||||
@@ -0,0 +1,14 @@
|
||||
+#include <linux/mempool.h>
|
||||
+/*
|
||||
+With linux v4.18 mempool_init get embedded
|
||||
+commit c1a67fefd0546a5552289c65fe31b1d60e64b643
|
||||
+Author: Kent Overstreet <kent.overstreet@gmail.com>
|
||||
+Date: Mon May 4 16:52:20 2015 -0700
|
||||
+*/
|
||||
+
|
||||
+static int foo(void)
|
||||
+{
|
||||
+ struct mempool_s mempool_t;
|
||||
+
|
||||
+ return mempool_init_page_pool(&mempool_t, 0, 0);
|
||||
+}
|
@ -1,3 +1,9 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Nov 21 07:47:51 UTC 2018 - nwang@suse.com
|
||||
|
||||
- bsc#1116820, kernel compatible issue of sle15sp1
|
||||
- Add patch compat_have_mempool_init.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Oct 26 03:01:05 UTC 2018 - nwang@suse.com
|
||||
|
||||
|
@ -36,6 +36,7 @@ Source1: preamble
|
||||
Source2: Module.supported
|
||||
Source3: drbd_git_revision
|
||||
Patch1: fix-resync-finished-with-syncs-have-bits-set.patch
|
||||
Patch2: compat_have_mempool_init.patch
|
||||
BuildRequires: kernel-source
|
||||
BuildRequires: kernel-syms
|
||||
BuildRequires: libelf-devel
|
||||
@ -69,6 +70,7 @@ installed kernel.
|
||||
%prep
|
||||
%setup -q -n drbd-%{version}
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
|
||||
mkdir source
|
||||
cp -a drbd/. source/. || :
|
||||
@ -89,6 +91,8 @@ for flavor in %{flavors_to_build}; do
|
||||
cp %{_sourcedir}/Module.supported $flavor
|
||||
export DRBDSRC="$PWD/obj/$flavor"
|
||||
make -C %{kernel_source $flavor} modules M=$PWD/$flavor
|
||||
#Check the compat result
|
||||
cat $PWD/$flavor/compat.h
|
||||
done
|
||||
|
||||
%install
|
||||
|
Loading…
Reference in New Issue
Block a user