]> git.proxmox.com Git - mirror_zfs.git/commitdiff
config: remove HAVE_USER_NS_COMMON_INUM
authorRob Norris <robn@despairlabs.com>
Sun, 4 Aug 2024 00:26:48 +0000 (10:26 +1000)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 18 Sep 2024 18:23:50 +0000 (11:23 -0700)
Sponsored-by: https://despairlabs.com/sponsor/
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Closes #16479

config/kernel-user-ns-inum.m4 [deleted file]
config/kernel.m4
module/os/linux/spl/spl-zone.c

diff --git a/config/kernel-user-ns-inum.m4 b/config/kernel-user-ns-inum.m4
deleted file mode 100644 (file)
index 2207a4a..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-dnl #
-dnl # 3.18 API change
-dnl # struct user_namespace inum moved from .proc_inum to .ns.inum.
-dnl #
-AC_DEFUN([ZFS_AC_KERNEL_SRC_USER_NS_COMMON_INUM], [
-       ZFS_LINUX_TEST_SRC([user_ns_common_inum], [
-               #include <linux/user_namespace.h>
-       ], [
-               struct user_namespace uns;
-               uns.ns.inum = 0;
-       ])
-])
-
-AC_DEFUN([ZFS_AC_KERNEL_USER_NS_COMMON_INUM], [
-       AC_MSG_CHECKING([whether user_namespace->ns.inum exists])
-       ZFS_LINUX_TEST_RESULT([user_ns_common_inum], [
-               AC_MSG_RESULT(yes)
-               AC_DEFINE(HAVE_USER_NS_COMMON_INUM, 1,
-                   [user_namespace->ns.inum exists])
-       ],[
-               AC_MSG_RESULT(no)
-       ])
-])
index 68329afedcf3d32cc4a370e47b5b1b957023f605..803a95c0684105aefb7a156e583d44b1aafa568f 100644 (file)
@@ -146,7 +146,6 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [
        ZFS_AC_KERNEL_SRC_KTHREAD
        ZFS_AC_KERNEL_SRC_ZERO_PAGE
        ZFS_AC_KERNEL_SRC___COPY_FROM_USER_INATOMIC
-       ZFS_AC_KERNEL_SRC_USER_NS_COMMON_INUM
        ZFS_AC_KERNEL_SRC_IDMAP_MNT_API
        ZFS_AC_KERNEL_SRC_IDMAP_NO_USERNS
        ZFS_AC_KERNEL_SRC_IATTR_VFSID
@@ -288,7 +287,6 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [
        ZFS_AC_KERNEL_KTHREAD
        ZFS_AC_KERNEL_ZERO_PAGE
        ZFS_AC_KERNEL___COPY_FROM_USER_INATOMIC
-       ZFS_AC_KERNEL_USER_NS_COMMON_INUM
        ZFS_AC_KERNEL_IDMAP_MNT_API
        ZFS_AC_KERNEL_IDMAP_NO_USERNS
        ZFS_AC_KERNEL_IATTR_VFSID
index d0d0cca154a72c159e5dde480aa4e013f19b13a6..58b5e0dc44b77c79b3a7048bf1289421e3b2151c 100644 (file)
@@ -54,7 +54,7 @@ typedef struct zone_dataset {
        char zd_dsname[];               /* name of the member dataset */
 } zone_dataset_t;
 
-#if defined(CONFIG_USER_NS) && defined(HAVE_USER_NS_COMMON_INUM)
+#ifdef CONFIG_USER_NS
 /*
  * Returns:
  * - 0 on success
@@ -95,18 +95,14 @@ done:
 
        return (error);
 }
-#endif /* defined(CONFIG_USER_NS) && defined(HAVE_USER_NS_COMMON_INUM) */
+#endif /* CONFIG_USER_NS */
 
 static unsigned int
 user_ns_zoneid(struct user_namespace *user_ns)
 {
        unsigned int r;
 
-#if defined(HAVE_USER_NS_COMMON_INUM)
        r = user_ns->ns.inum;
-#else
-       r = user_ns->proc_inum;
-#endif
 
        return (r);
 }
@@ -123,7 +119,7 @@ zone_datasets_lookup(unsigned int nsinum)
        return (NULL);
 }
 
-#if defined(CONFIG_USER_NS) && defined(HAVE_USER_NS_COMMON_INUM)
+#ifdef CONFIG_USER_NS
 static struct zone_dataset *
 zone_dataset_lookup(zone_datasets_t *zds, const char *dataset, size_t dsnamelen)
 {
@@ -148,7 +144,7 @@ zone_dataset_cred_check(cred_t *cred)
 
        return (0);
 }
-#endif /* defined(CONFIG_USER_NS) && defined(HAVE_USER_NS_COMMON_INUM) */
+#endif /* CONFIG_USER_NS */
 
 static int
 zone_dataset_name_check(const char *dataset, size_t *dsnamelen)
@@ -168,7 +164,7 @@ zone_dataset_name_check(const char *dataset, size_t *dsnamelen)
 int
 zone_dataset_attach(cred_t *cred, const char *dataset, int userns_fd)
 {
-#if defined(CONFIG_USER_NS) && defined(HAVE_USER_NS_COMMON_INUM)
+#ifdef CONFIG_USER_NS
        struct user_namespace *userns;
        zone_datasets_t *zds;
        zone_dataset_t *zd;
@@ -213,14 +209,14 @@ zone_dataset_attach(cred_t *cred, const char *dataset, int userns_fd)
        return (0);
 #else
        return (ENXIO);
-#endif /* defined(CONFIG_USER_NS) && defined(HAVE_USER_NS_COMMON_INUM) */
+#endif /* CONFIG_USER_NS */
 }
 EXPORT_SYMBOL(zone_dataset_attach);
 
 int
 zone_dataset_detach(cred_t *cred, const char *dataset, int userns_fd)
 {
-#if defined(CONFIG_USER_NS) && defined(HAVE_USER_NS_COMMON_INUM)
+#ifdef CONFIG_USER_NS
        struct user_namespace *userns;
        zone_datasets_t *zds;
        zone_dataset_t *zd;
@@ -262,7 +258,7 @@ zone_dataset_detach(cred_t *cred, const char *dataset, int userns_fd)
        return (0);
 #else
        return (ENXIO);
-#endif /* defined(CONFIG_USER_NS) && defined(HAVE_USER_NS_COMMON_INUM) */
+#endif /* CONFIG_USER_NS */
 }
 EXPORT_SYMBOL(zone_dataset_detach);