aboutsummaryrefslogtreecommitdiffstats
path: root/include/os/linux/spl/sys
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2019-11-12 08:59:06 -0800
committerGitHub <[email protected]>2019-11-12 08:59:06 -0800
commit066e825221012e1e81ccf46b0448772bdd7e5483 (patch)
tree7e071cb3446bccc4ae45c7db7aa5f84cc4a9c8c2 /include/os/linux/spl/sys
parent035ebb365383dcca71c4c542093ea1ad2b8e1dea (diff)
Linux compat: Minimum kernel version 3.10
Increase the minimum supported kernel version from 2.6.32 to 3.10. This removes support for the following Linux enterprise distributions. Distribution | Kernel | End of Life ---------------- | ------ | ------------- Ubuntu 12.04 LTS | 3.2 | Apr 28, 2017 SLES 11 | 3.0 | Mar 32, 2019 RHEL / CentOS 6 | 2.6.32 | Nov 30, 2020 The following changes were made as part of removing support. * Updated `configure` to enforce a minimum kernel version as specified in the META file (Linux-Minimum: 3.10). configure: error: *** Cannot build against kernel version 2.6.32. *** The minimum supported kernel version is 3.10. * Removed all `configure` kABI checks and matching C code for interfaces which solely predate the Linux 3.10 kernel. * Updated all `configure` kABI checks to fail when an interface is missing which was in the 3.10 kernel up to the latest 5.1 kernel. Removed the HAVE_* preprocessor defines for these checks and updated the code to unconditionally use the verified interface. * Inverted the detection logic in several kABI checks to match the new interface as it appears in 3.10 and newer and not the legacy interface. * Consolidated the following checks in to individual files. Due the large number of changes in the checks it made sense to handle this now. It would be desirable to group other related checks in the same fashion, but this as left as future work. - config/kernel-blkdev.m4 - Block device kABI checks - config/kernel-blk-queue.m4 - Block queue kABI checks - config/kernel-bio.m4 - Bio interface kABI checks * Removed the kABI checks for sops->nr_cached_objects() and sops->free_cached_objects(). These interfaces are currently unused. Signed-off-by: Brian Behlendorf <[email protected]> Closes #9566
Diffstat (limited to 'include/os/linux/spl/sys')
-rw-r--r--include/os/linux/spl/sys/cred.h12
-rw-r--r--include/os/linux/spl/sys/proc.h4
-rw-r--r--include/os/linux/spl/sys/shrinker.h59
-rw-r--r--include/os/linux/spl/sys/strings.h4
-rw-r--r--include/os/linux/spl/sys/sysmacros.h4
-rw-r--r--include/os/linux/spl/sys/timer.h14
-rw-r--r--include/os/linux/spl/sys/zmod.h8
7 files changed, 2 insertions, 103 deletions
diff --git a/include/os/linux/spl/sys/cred.h b/include/os/linux/spl/sys/cred.h
index fd063399b..0b07c4369 100644
--- a/include/os/linux/spl/sys/cred.h
+++ b/include/os/linux/spl/sys/cred.h
@@ -40,24 +40,12 @@ typedef struct cred cred_t;
#define GROUP_AT(gi, i) ((gi)->gid[i])
#endif
-#ifdef HAVE_KUIDGID_T
-
#define KUID_TO_SUID(x) (__kuid_val(x))
#define KGID_TO_SGID(x) (__kgid_val(x))
#define SUID_TO_KUID(x) (KUIDT_INIT(x))
#define SGID_TO_KGID(x) (KGIDT_INIT(x))
#define KGIDP_TO_SGIDP(x) (&(x)->val)
-#else /* HAVE_KUIDGID_T */
-
-#define KUID_TO_SUID(x) (x)
-#define KGID_TO_SGID(x) (x)
-#define SUID_TO_KUID(x) (x)
-#define SGID_TO_KGID(x) (x)
-#define KGIDP_TO_SGIDP(x) (x)
-
-#endif /* HAVE_KUIDGID_T */
-
extern void crhold(cred_t *cr);
extern void crfree(cred_t *cr);
extern uid_t crgetuid(const cred_t *cr);
diff --git a/include/os/linux/spl/sys/proc.h b/include/os/linux/spl/sys/proc.h
index 05c44bca5..287683920 100644
--- a/include/os/linux/spl/sys/proc.h
+++ b/include/os/linux/spl/sys/proc.h
@@ -27,10 +27,6 @@
#include <linux/proc_fs.h>
-#ifndef HAVE_PDE_DATA
-#define PDE_DATA(x) (PDE(x)->data)
-#endif
-
extern struct proc_dir_entry *proc_spl_kstat;
int spl_proc_init(void);
diff --git a/include/os/linux/spl/sys/shrinker.h b/include/os/linux/spl/sys/shrinker.h
index 28c1fa78c..4193bc5c4 100644
--- a/include/os/linux/spl/sys/shrinker.h
+++ b/include/os/linux/spl/sys/shrinker.h
@@ -28,13 +28,6 @@
#include <linux/mm.h>
#include <linux/fs.h>
-#if !defined(HAVE_SHRINK_CONTROL_STRUCT)
-struct shrink_control {
- gfp_t gfp_mask;
- unsigned long nr_to_scan;
-};
-#endif /* HAVE_SHRINK_CONTROL_STRUCT */
-
/*
* Due to frequent changes in the shrinker API the following
* compatibility wrappers should be used. They are as follows:
@@ -85,59 +78,9 @@ struct shrink_control {
#define spl_unregister_shrinker(x) unregister_shrinker(x)
/*
- * Linux 2.6.23 - 2.6.34 Shrinker API Compatibility.
- */
-#if defined(HAVE_2ARGS_OLD_SHRINKER_CALLBACK)
-#define SPL_SHRINKER_DECLARE(s, x, y) \
-static struct shrinker s = { \
- .shrink = x, \
- .seeks = y \
-}
-
-#define SPL_SHRINKER_CALLBACK_FWD_DECLARE(fn) \
-static int fn(int nr_to_scan, unsigned int gfp_mask)
-
-#define SPL_SHRINKER_CALLBACK_WRAPPER(fn) \
-static int \
-fn(int nr_to_scan, unsigned int gfp_mask) \
-{ \
- struct shrink_control sc; \
- \
- sc.nr_to_scan = nr_to_scan; \
- sc.gfp_mask = gfp_mask; \
- \
- return (__ ## fn(NULL, &sc)); \
-}
-
-/*
- * Linux 2.6.35 to 2.6.39 Shrinker API Compatibility.
- */
-#elif defined(HAVE_3ARGS_SHRINKER_CALLBACK)
-#define SPL_SHRINKER_DECLARE(s, x, y) \
-static struct shrinker s = { \
- .shrink = x, \
- .seeks = y \
-}
-
-#define SPL_SHRINKER_CALLBACK_FWD_DECLARE(fn) \
-static int fn(struct shrinker *, int, unsigned int)
-
-#define SPL_SHRINKER_CALLBACK_WRAPPER(fn) \
-static int \
-fn(struct shrinker *shrink, int nr_to_scan, unsigned int gfp_mask) \
-{ \
- struct shrink_control sc; \
- \
- sc.nr_to_scan = nr_to_scan; \
- sc.gfp_mask = gfp_mask; \
- \
- return (__ ## fn(shrink, &sc)); \
-}
-
-/*
* Linux 3.0 to 3.11 Shrinker API Compatibility.
*/
-#elif defined(HAVE_2ARGS_NEW_SHRINKER_CALLBACK)
+#if defined(HAVE_SINGLE_SHRINKER_CALLBACK)
#define SPL_SHRINKER_DECLARE(s, x, y) \
static struct shrinker s = { \
.shrink = x, \
diff --git a/include/os/linux/spl/sys/strings.h b/include/os/linux/spl/sys/strings.h
index 8b810c9af..4fb803206 100644
--- a/include/os/linux/spl/sys/strings.h
+++ b/include/os/linux/spl/sys/strings.h
@@ -28,8 +28,4 @@
#define bcopy(src, dest, size) memmove(dest, src, size)
#define bcmp(src, dest, size) memcmp((src), (dest), (size_t)(size))
-#ifndef HAVE_KSTRTOUL
-#define kstrtoul strict_strtoul
-#endif
-
#endif /* _SPL_SYS_STRINGS_H */
diff --git a/include/os/linux/spl/sys/sysmacros.h b/include/os/linux/spl/sys/sysmacros.h
index c0bf4f531..c9d33f407 100644
--- a/include/os/linux/spl/sys/sysmacros.h
+++ b/include/os/linux/spl/sys/sysmacros.h
@@ -27,15 +27,13 @@
#include <linux/module.h>
#include <linux/sched.h>
+#include <linux/sched/rt.h>
#include <linux/cpumask.h>
#include <sys/debug.h>
#include <sys/zone.h>
#include <sys/signal.h>
#include <asm/page.h>
-#ifdef HAVE_SCHED_RT_HEADER
-#include <linux/sched/rt.h>
-#endif
#ifndef _KERNEL
#define _KERNEL __KERNEL__
diff --git a/include/os/linux/spl/sys/timer.h b/include/os/linux/spl/sys/timer.h
index 31d89d3b9..40be12047 100644
--- a/include/os/linux/spl/sys/timer.h
+++ b/include/os/linux/spl/sys/timer.h
@@ -53,20 +53,6 @@
#define delay(ticks) schedule_timeout_uninterruptible(ticks)
-/* usleep_range() introduced in 2.6.36 */
-#ifndef HAVE_USLEEP_RANGE
-static inline void
-usleep_range(unsigned long min, unsigned long max)
-{
- unsigned int min_ms = min / USEC_PER_MSEC;
-
- if (min >= MAX_UDELAY_MS)
- msleep(min_ms);
- else
- udelay(min);
-}
-#endif /* HAVE_USLEEP_RANGE */
-
#define SEC_TO_TICK(sec) ((sec) * HZ)
#define MSEC_TO_TICK(ms) msecs_to_jiffies(ms)
#define USEC_TO_TICK(us) usecs_to_jiffies(us)
diff --git a/include/os/linux/spl/sys/zmod.h b/include/os/linux/spl/sys/zmod.h
index 95c1a3ed7..5380bd6fd 100644
--- a/include/os/linux/spl/sys/zmod.h
+++ b/include/os/linux/spl/sys/zmod.h
@@ -59,14 +59,6 @@
#include <sys/types.h>
#include <linux/zlib.h>
-#ifdef HAVE_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE
-#define spl_zlib_deflate_workspacesize(wb, ml) \
- zlib_deflate_workspacesize(wb, ml)
-#else
-#define spl_zlib_deflate_workspacesize(wb, ml) \
- zlib_deflate_workspacesize()
-#endif /* HAVE_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE */
-
extern int z_compress_level(void *dest, size_t *destLen, const void *source,
size_t sourceLen, int level);
extern int z_uncompress(void *dest, size_t *destLen, const void *source,