Skip to content

Commit

Permalink
Linux compat: Minimum kernel version 3.10
Browse files Browse the repository at this point in the history
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 <behlendorf1@llnl.gov>
Closes openzfs#9566
  • Loading branch information
behlendorf committed Nov 12, 2019
1 parent 035ebb3 commit 066e825
Show file tree
Hide file tree
Showing 102 changed files with 1,136 additions and 2,965 deletions.
2 changes: 1 addition & 1 deletion META
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ Release-Tags: relext
License: CDDL
Author: OpenZFS on Linux
Linux-Maximum: 5.1
Linux-Minimum: 2.6.32
Linux-Minimum: 3.10
158 changes: 15 additions & 143 deletions config/kernel-acl.m4
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,10 @@ AC_DEFUN([ZFS_AC_KERNEL_SET_CACHED_ACL_USABLE], [

dnl #
dnl # 3.1 API change,
dnl # posix_acl_chmod_masq() is not exported anymore and posix_acl_chmod()
dnl # was introduced to replace it.
dnl # posix_acl_chmod() was added as the preferred interface.
dnl #
dnl # 3.14 API change,
dnl # posix_acl_chmod() is changed to __posix_acl_chmod()
dnl # posix_acl_chmod() was changed to __posix_acl_chmod()
dnl #
AC_DEFUN([ZFS_AC_KERNEL_SRC_POSIX_ACL_CHMOD], [
ZFS_LINUX_TEST_SRC([posix_acl_chmod], [
Expand All @@ -89,46 +88,45 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_POSIX_ACL_CHMOD], [
])

AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_CHMOD], [
AC_MSG_CHECKING([whether posix_acl_chmod exists])
ZFS_LINUX_TEST_RESULT([posix_acl_chmod], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_POSIX_ACL_CHMOD, 1, [posix_acl_chmod() exists])
],[
AC_MSG_RESULT(no)
])
AC_MSG_CHECKING([whether __posix_acl_chmod exists])
ZFS_LINUX_TEST_RESULT([__posix_acl_chmod], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE___POSIX_ACL_CHMOD, 1,
[__posix_acl_chmod() exists])
],[
AC_MSG_RESULT(no)
AC_MSG_CHECKING([whether posix_acl_chmod exists])
ZFS_LINUX_TEST_RESULT([posix_acl_chmod], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_POSIX_ACL_CHMOD, 1,
[posix_acl_chmod() exists])
],[
ZFS_LINUX_TEST_ERROR([posix_acl_chmod()])
])
])
])

dnl #
dnl # 3.1 API change,
dnl # posix_acl_equiv_mode now wants an umode_t* instead of a mode_t*
dnl # posix_acl_equiv_mode now wants an umode_t instead of a mode_t
dnl #
AC_DEFUN([ZFS_AC_KERNEL_SRC_POSIX_ACL_EQUIV_MODE_WANTS_UMODE_T], [
ZFS_LINUX_TEST_SRC([posix_acl_equiv_mode], [
#include <linux/fs.h>
#include <linux/posix_acl.h>
],[
umode_t tmp;
posix_acl_equiv_mode(NULL,&tmp);
posix_acl_equiv_mode(NULL, &tmp);
])
])

AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_EQUIV_MODE_WANTS_UMODE_T], [
AC_MSG_CHECKING([whether posix_acl_equiv_mode() wants umode_t])
ZFS_LINUX_TEST_RESULT([posix_acl_equiv_mode], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_POSIX_ACL_EQUIV_MODE_UMODE_T, 1,
[posix_acl_equiv_mode wants umode_t*])
],[
AC_MSG_RESULT(no)
ZFS_LINUX_TEST_ERROR([posix_acl_equiv_mode()])
])
])

Expand Down Expand Up @@ -160,123 +158,6 @@ AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_VALID_WITH_NS], [
])
])

dnl #
dnl # 2.6.27 API change,
dnl # Check if inode_operations contains the function permission
dnl # and expects the nameidata structure to have been removed.
dnl #
AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_PERMISSION], [
ZFS_LINUX_TEST_SRC([inode_operations_permission], [
#include <linux/fs.h>
int permission_fn(struct inode *inode, int mask) { return 0; }
static const struct inode_operations
iops __attribute__ ((unused)) = {
.permission = permission_fn,
};
],[])
])

AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_PERMISSION], [
AC_MSG_CHECKING([whether iops->permission() exists])
ZFS_LINUX_TEST_RESULT([inode_operations_permission], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_PERMISSION, 1, [iops->permission() exists])
],[
AC_MSG_RESULT(no)
])
])

dnl #
dnl # 2.6.26 API change,
dnl # Check if inode_operations contains the function permission
dnl # and expects the nameidata structure to be passed.
dnl #
AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_PERMISSION_WITH_NAMEIDATA], [
ZFS_LINUX_TEST_SRC([inode_operations_permission_with_nameidata], [
#include <linux/fs.h>
#include <linux/sched.h>
int permission_fn(struct inode *inode, int mask,
struct nameidata *nd) { return 0; }
static const struct inode_operations
iops __attribute__ ((unused)) = {
.permission = permission_fn,
};
],[])
])

AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_PERMISSION_WITH_NAMEIDATA], [
AC_MSG_CHECKING([whether iops->permission() wants nameidata])
ZFS_LINUX_TEST_RESULT([inode_operations_permission_with_nameidata], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_PERMISSION, 1, [iops->permission() exists])
AC_DEFINE(HAVE_PERMISSION_WITH_NAMEIDATA, 1,
[iops->permission() with nameidata exists])
],[
AC_MSG_RESULT(no)
])
])

dnl #
dnl # 2.6.32 API change,
dnl # Check if inode_operations contains the function check_acl
dnl #
AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_CHECK_ACL], [
ZFS_LINUX_TEST_SRC([inode_operations_check_acl], [
#include <linux/fs.h>
int check_acl_fn(struct inode *inode, int mask) { return 0; }
static const struct inode_operations
iops __attribute__ ((unused)) = {
.check_acl = check_acl_fn,
};
],[])
])

AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_CHECK_ACL], [
AC_MSG_CHECKING([whether iops->check_acl() exists])
ZFS_LINUX_TEST_RESULT([inode_operations_check_acl], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_CHECK_ACL, 1, [iops->check_acl() exists])
],[
AC_MSG_RESULT(no)
])
])

dnl #
dnl # 2.6.38 API change,
dnl # The function check_acl gained a new parameter: flags
dnl #
AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_CHECK_ACL_WITH_FLAGS], [
ZFS_LINUX_TEST_SRC([inode_operations_check_acl_with_flags], [
#include <linux/fs.h>
int check_acl_fn(struct inode *inode, int mask,
unsigned int flags) { return 0; }
static const struct inode_operations
iops __attribute__ ((unused)) = {
.check_acl = check_acl_fn,
};
],[])
])

AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_CHECK_ACL_WITH_FLAGS], [
AC_MSG_CHECKING([whether iops->check_acl() wants flags])
ZFS_LINUX_TEST_RESULT([inode_operations_check_acl_with_flags], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_CHECK_ACL, 1, [iops->check_acl() exists])
AC_DEFINE(HAVE_CHECK_ACL_WITH_FLAGS, 1,
[iops->check_acl() wants flags])
],[
AC_MSG_RESULT(no)
])
])

dnl #
dnl # 3.1 API change,
dnl # Check if inode_operations contains the function get_acl
Expand All @@ -299,9 +180,8 @@ AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_GET_ACL], [
AC_MSG_CHECKING([whether iops->get_acl() exists])
ZFS_LINUX_TEST_RESULT([inode_operations_get_acl], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_GET_ACL, 1, [iops->get_acl() exists])
],[
AC_MSG_RESULT(no)
ZFS_LINUX_TEST_ERROR([iops->get_acl()])
])
])

Expand Down Expand Up @@ -390,10 +270,6 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_ACL], [
ZFS_AC_KERNEL_SRC_POSIX_ACL_CHMOD
ZFS_AC_KERNEL_SRC_POSIX_ACL_EQUIV_MODE_WANTS_UMODE_T
ZFS_AC_KERNEL_SRC_POSIX_ACL_VALID_WITH_NS
ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_PERMISSION
ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_PERMISSION_WITH_NAMEIDATA
ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_CHECK_ACL
ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_CHECK_ACL_WITH_FLAGS
ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_GET_ACL
ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_SET_ACL
ZFS_AC_KERNEL_SRC_GET_ACL_HANDLE_CACHE
Expand All @@ -406,10 +282,6 @@ AC_DEFUN([ZFS_AC_KERNEL_ACL], [
ZFS_AC_KERNEL_POSIX_ACL_CHMOD
ZFS_AC_KERNEL_POSIX_ACL_EQUIV_MODE_WANTS_UMODE_T
ZFS_AC_KERNEL_POSIX_ACL_VALID_WITH_NS
ZFS_AC_KERNEL_INODE_OPERATIONS_PERMISSION
ZFS_AC_KERNEL_INODE_OPERATIONS_PERMISSION_WITH_NAMEIDATA
ZFS_AC_KERNEL_INODE_OPERATIONS_CHECK_ACL
ZFS_AC_KERNEL_INODE_OPERATIONS_CHECK_ACL_WITH_FLAGS
ZFS_AC_KERNEL_INODE_OPERATIONS_GET_ACL
ZFS_AC_KERNEL_INODE_OPERATIONS_SET_ACL
ZFS_AC_KERNEL_GET_ACL_HANDLE_CACHE
Expand Down
5 changes: 2 additions & 3 deletions config/kernel-automount.m4
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_AUTOMOUNT], [
struct dentry_operations dops __attribute__ ((unused)) = {
.d_automount = d_automount,
};
],[])
])
])

AC_DEFUN([ZFS_AC_KERNEL_AUTOMOUNT], [
AC_MSG_CHECKING([whether dops->d_automount() exists])
ZFS_LINUX_TEST_RESULT([dentry_operations_d_automount], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_AUTOMOUNT, 1, [dops->automount() exists])
],[
AC_MSG_RESULT(no)
ZFS_LINUX_TEST_ERROR([dops->d_automount()])
])
])
26 changes: 0 additions & 26 deletions config/kernel-bdev-logical-size.m4

This file was deleted.

40 changes: 0 additions & 40 deletions config/kernel-bdev-physical-size.m4

This file was deleted.

6 changes: 1 addition & 5 deletions config/kernel-bdi.m4
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,7 @@ AC_DEFUN([ZFS_AC_KERNEL_BDI], [
AC_DEFINE(HAVE_3ARGS_BDI_SETUP_AND_REGISTER, 1,
[bdi_setup_and_register() wants 3 args])
], [
dnl #
dnl # 2.6.32 - 2.6.33, bdi_setup_and_register()
dnl # is not exported.
dnl #
AC_MSG_RESULT(no)
ZFS_LINUX_TEST_ERROR([bdi_setup])
])
])
])
Expand Down
23 changes: 0 additions & 23 deletions config/kernel-bio-bvec-iter.m4

This file was deleted.

Loading

0 comments on commit 066e825

Please sign in to comment.