diff options
author | Luca Coelho <luciano.coelho@intel.com> | 2016-06-22 16:20:56 +0300 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2017-02-06 14:57:40 +0100 |
commit | 822f2e2c077c3c2e6f5034188b6af7cd6b23a73a (patch) | |
tree | 90be30c6ae573459a79d2ebf59cabcd197c61920 | |
parent | c526cd643b35170377954c87ce093677011aade3 (diff) |
backports: add backport for old devcoredumpm (i.e. < 4.7)
The API has changed in kernel version 4.7. So now we need to backport
to this intermediate version if the kernel is > 3.18, but < 4.7.
To do so, add wrappers around the old functions and save the functions
passed by the caller so that they can be passed by the wrappers.
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r-- | backport/backport-include/linux/bp-devcoredump.h | 27 | ||||
-rw-r--r-- | patches/backport-adjustments/devcoredump.patch | 10 |
2 files changed, 37 insertions, 0 deletions
diff --git a/backport/backport-include/linux/bp-devcoredump.h b/backport/backport-include/linux/bp-devcoredump.h new file mode 100644 index 00000000..f116bd2e --- /dev/null +++ b/backport/backport-include/linux/bp-devcoredump.h @@ -0,0 +1,27 @@ +#ifndef __BACKPORT_LINUX_DEVCOREDUMP_H +#define __BACKPORT_LINUX_DEVCOREDUMP_H +#include <linux/version.h> + +/* We only need to add our wrapper inside the range from 3.18 until + * 4.6, outside that we can let our BPAUTO mechanism handle it. + */ +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0) && \ + LINUX_VERSION_CODE < KERNEL_VERSION(4,7,0)) +static inline +void backport_dev_coredumpm(struct device *dev, struct module *owner, + void *data, size_t datalen, gfp_t gfp, + ssize_t (*read_fn)(char *buffer, loff_t offset, + size_t count, void *data, + size_t datalen), + void (*free_fn)(void *data)) +{ + return dev_coredumpm(dev, owner, (const void *)data, datalen, gfp, + (void *)read_fn, (void *)free_fn); +} + +#define dev_coredumpm LINUX_BACKPORT(dev_coredumpm) + +#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0) && \ + LINUX_VERSION_CODE < KERNEL_VERSION(4,7,0)) */ + +#endif /* __BACKPORT_LINUX_DEVCOREDUMP_H */ diff --git a/patches/backport-adjustments/devcoredump.patch b/patches/backport-adjustments/devcoredump.patch index 397b3175..9235565f 100644 --- a/patches/backport-adjustments/devcoredump.patch +++ b/patches/backport-adjustments/devcoredump.patch @@ -114,3 +114,13 @@ +#endif /* CPTCFG_BPAUTO_WANT_DEV_COREDUMP */ #endif /* __DEVCOREDUMP_H */ +--- a/include/linux/devcoredump.h ++++ b/include/linux/devcoredump.h +@@ -1,6 +1,7 @@ + /* Automatically created during backport process */ + #ifndef CPTCFG_BPAUTO_BUILD_WANT_DEV_COREDUMP + #include_next <linux/devcoredump.h> ++#include <linux/bp-devcoredump.h> + #else + #undef dev_coredumpv + #define dev_coredumpv LINUX_BACKPORT(dev_coredumpv) |