From 95d85f032fc1e6bc0ef8378158b0c74d89610ca4 Mon Sep 17 00:00:00 2001 From: Rob Norris Date: Fri, 16 Aug 2024 16:52:28 +1000 Subject: [PATCH] config: remove HAVE_(GET|PUT)_LINK_DELAYED Sponsored-by: https://despairlabs.com/sponsor/ Reviewed-by: Brian Behlendorf Reviewed-by: Tony Hutter Reviewed-by: Tino Reichardt Signed-off-by: Rob Norris Closes #16479 --- config/kernel-get-link.m4 | 55 --------------------------------- config/kernel-put-link.m4 | 39 ----------------------- config/kernel.m4 | 4 --- module/os/linux/zfs/zpl_inode.c | 46 --------------------------- 4 files changed, 144 deletions(-) delete mode 100644 config/kernel-get-link.m4 delete mode 100644 config/kernel-put-link.m4 diff --git a/config/kernel-get-link.m4 b/config/kernel-get-link.m4 deleted file mode 100644 index 87ad948e3..000000000 --- a/config/kernel-get-link.m4 +++ /dev/null @@ -1,55 +0,0 @@ -dnl # -dnl # Supported get_link() interfaces checked newest to oldest. -dnl # Note this interface used to be named follow_link. -dnl # -AC_DEFUN([ZFS_AC_KERNEL_SRC_GET_LINK], [ - ZFS_LINUX_TEST_SRC([inode_operations_get_link], [ - #include - static const char *get_link(struct dentry *de, struct inode *ip, - struct delayed_call *done) { return "symlink"; } - static struct inode_operations - iops __attribute__ ((unused)) = { - .get_link = get_link, - }; - ],[]) - - ZFS_LINUX_TEST_SRC([inode_operations_follow_link], [ - #include - static const char *follow_link(struct dentry *de, - void **cookie) { return "symlink"; } - static struct inode_operations - iops __attribute__ ((unused)) = { - .follow_link = follow_link, - }; - ],[]) -]) - -AC_DEFUN([ZFS_AC_KERNEL_GET_LINK], [ - dnl # - dnl # 4.5 API change - dnl # The get_link interface has added a delayed done call and - dnl # used it to retire the put_link() interface. - dnl # - AC_MSG_CHECKING([whether iops->get_link() passes delayed]) - ZFS_LINUX_TEST_RESULT([inode_operations_get_link], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_GET_LINK_DELAYED, 1, [iops->get_link() delayed]) - ],[ - AC_MSG_RESULT(no) - - dnl # - dnl # 4.2 API change - dnl # This kernel retired the nameidata structure. - dnl # - AC_MSG_CHECKING( - [whether iops->follow_link() passes cookie]) - ZFS_LINUX_TEST_RESULT([inode_operations_follow_link], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_FOLLOW_LINK_COOKIE, 1, - [iops->follow_link() cookie]) - ],[ - AC_MSG_RESULT(no) - ZFS_LINUX_TEST_ERROR([get_link]) - ]) - ]) -]) diff --git a/config/kernel-put-link.m4 b/config/kernel-put-link.m4 deleted file mode 100644 index 901024718..000000000 --- a/config/kernel-put-link.m4 +++ /dev/null @@ -1,39 +0,0 @@ -dnl # -dnl # Supported symlink APIs -dnl # -AC_DEFUN([ZFS_AC_KERNEL_SRC_PUT_LINK], [ - ZFS_LINUX_TEST_SRC([put_link_cookie], [ - #include - static void put_link(struct inode *ip, void *cookie) - { return; } - static struct inode_operations - iops __attribute__ ((unused)) = { - .put_link = put_link, - }; - ],[]) -]) - -AC_DEFUN([ZFS_AC_KERNEL_PUT_LINK], [ - dnl # - dnl # 4.5 API change - dnl # get_link() uses delayed done, there is no put_link() interface. - dnl # This check initially uses the inode_operations_get_link result - dnl # - ZFS_LINUX_TEST_RESULT([inode_operations_get_link], [ - AC_DEFINE(HAVE_PUT_LINK_DELAYED, 1, [iops->put_link() delayed]) - ],[ - dnl # - dnl # 4.2 API change - dnl # This kernel retired the nameidata structure. - dnl # - AC_MSG_CHECKING([whether iops->put_link() passes cookie]) - ZFS_LINUX_TEST_RESULT([put_link_cookie], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_PUT_LINK_COOKIE, 1, - [iops->put_link() cookie]) - ],[ - AC_MSG_RESULT(no) - ZFS_LINUX_TEST_ERROR([put_link]) - ]) - ]) -]) diff --git a/config/kernel.m4 b/config/kernel.m4 index 33e247721..d6a198f6c 100644 --- a/config/kernel.m4 +++ b/config/kernel.m4 @@ -78,8 +78,6 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [ ZFS_AC_KERNEL_SRC_LOOKUP_FLAGS ZFS_AC_KERNEL_SRC_CREATE ZFS_AC_KERNEL_SRC_PERMISSION - ZFS_AC_KERNEL_SRC_GET_LINK - ZFS_AC_KERNEL_SRC_PUT_LINK ZFS_AC_KERNEL_SRC_TMPFILE ZFS_AC_KERNEL_SRC_AUTOMOUNT ZFS_AC_KERNEL_SRC_COMMIT_METADATA @@ -210,8 +208,6 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [ ZFS_AC_KERNEL_LOOKUP_FLAGS ZFS_AC_KERNEL_CREATE ZFS_AC_KERNEL_PERMISSION - ZFS_AC_KERNEL_GET_LINK - ZFS_AC_KERNEL_PUT_LINK ZFS_AC_KERNEL_TMPFILE ZFS_AC_KERNEL_AUTOMOUNT ZFS_AC_KERNEL_COMMIT_METADATA diff --git a/module/os/linux/zfs/zpl_inode.c b/module/os/linux/zfs/zpl_inode.c index 863e439f4..9d9c49d18 100644 --- a/module/os/linux/zfs/zpl_inode.c +++ b/module/os/linux/zfs/zpl_inode.c @@ -647,19 +647,11 @@ zpl_symlink(struct inode *dir, struct dentry *dentry, const char *name) return (error); } -#if defined(HAVE_PUT_LINK_COOKIE) -static void -zpl_put_link(struct inode *unused, void *cookie) -{ - kmem_free(cookie, MAXPATHLEN); -} -#elif defined(HAVE_PUT_LINK_DELAYED) static void zpl_put_link(void *ptr) { kmem_free(ptr, MAXPATHLEN); } -#endif static int zpl_get_link_common(struct dentry *dentry, struct inode *ip, char **link) @@ -691,7 +683,6 @@ zpl_get_link_common(struct dentry *dentry, struct inode *ip, char **link) return (error); } -#if defined(HAVE_GET_LINK_DELAYED) static const char * zpl_get_link(struct dentry *dentry, struct inode *inode, struct delayed_call *done) @@ -710,36 +701,6 @@ zpl_get_link(struct dentry *dentry, struct inode *inode, return (link); } -#elif defined(HAVE_GET_LINK_COOKIE) -static const char * -zpl_get_link(struct dentry *dentry, struct inode *inode, void **cookie) -{ - char *link = NULL; - int error; - - if (!dentry) - return (ERR_PTR(-ECHILD)); - - error = zpl_get_link_common(dentry, inode, &link); - if (error) - return (ERR_PTR(error)); - - return (*cookie = link); -} -#elif defined(HAVE_FOLLOW_LINK_COOKIE) -static const char * -zpl_follow_link(struct dentry *dentry, void **cookie) -{ - char *link = NULL; - int error; - - error = zpl_get_link_common(dentry, dentry->d_inode, &link); - if (error) - return (ERR_PTR(error)); - - return (*cookie = link); -} -#endif static int zpl_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry) @@ -835,14 +796,7 @@ const struct inode_operations zpl_symlink_inode_operations = { #ifdef HAVE_GENERIC_READLINK .readlink = generic_readlink, #endif -#if defined(HAVE_GET_LINK_DELAYED) || defined(HAVE_GET_LINK_COOKIE) .get_link = zpl_get_link, -#elif defined(HAVE_FOLLOW_LINK_COOKIE) - .follow_link = zpl_follow_link, -#endif -#if defined(HAVE_PUT_LINK_COOKIE) - .put_link = zpl_put_link, -#endif .setattr = zpl_setattr, .getattr = zpl_getattr, #ifdef HAVE_GENERIC_SETXATTR