mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2025-01-14 12:10:26 +03:00
config: remove HAVE_(GET|PUT)_LINK_DELAYED
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
This commit is contained in:
parent
7cc89f83ff
commit
95d85f032f
@ -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 <linux/fs.h>
|
|
||||||
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 <linux/fs.h>
|
|
||||||
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])
|
|
||||||
])
|
|
||||||
])
|
|
||||||
])
|
|
@ -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 <linux/fs.h>
|
|
||||||
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])
|
|
||||||
])
|
|
||||||
])
|
|
||||||
])
|
|
@ -78,8 +78,6 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [
|
|||||||
ZFS_AC_KERNEL_SRC_LOOKUP_FLAGS
|
ZFS_AC_KERNEL_SRC_LOOKUP_FLAGS
|
||||||
ZFS_AC_KERNEL_SRC_CREATE
|
ZFS_AC_KERNEL_SRC_CREATE
|
||||||
ZFS_AC_KERNEL_SRC_PERMISSION
|
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_TMPFILE
|
||||||
ZFS_AC_KERNEL_SRC_AUTOMOUNT
|
ZFS_AC_KERNEL_SRC_AUTOMOUNT
|
||||||
ZFS_AC_KERNEL_SRC_COMMIT_METADATA
|
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_LOOKUP_FLAGS
|
||||||
ZFS_AC_KERNEL_CREATE
|
ZFS_AC_KERNEL_CREATE
|
||||||
ZFS_AC_KERNEL_PERMISSION
|
ZFS_AC_KERNEL_PERMISSION
|
||||||
ZFS_AC_KERNEL_GET_LINK
|
|
||||||
ZFS_AC_KERNEL_PUT_LINK
|
|
||||||
ZFS_AC_KERNEL_TMPFILE
|
ZFS_AC_KERNEL_TMPFILE
|
||||||
ZFS_AC_KERNEL_AUTOMOUNT
|
ZFS_AC_KERNEL_AUTOMOUNT
|
||||||
ZFS_AC_KERNEL_COMMIT_METADATA
|
ZFS_AC_KERNEL_COMMIT_METADATA
|
||||||
|
@ -647,19 +647,11 @@ zpl_symlink(struct inode *dir, struct dentry *dentry, const char *name)
|
|||||||
return (error);
|
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
|
static void
|
||||||
zpl_put_link(void *ptr)
|
zpl_put_link(void *ptr)
|
||||||
{
|
{
|
||||||
kmem_free(ptr, MAXPATHLEN);
|
kmem_free(ptr, MAXPATHLEN);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
zpl_get_link_common(struct dentry *dentry, struct inode *ip, char **link)
|
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);
|
return (error);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(HAVE_GET_LINK_DELAYED)
|
|
||||||
static const char *
|
static const char *
|
||||||
zpl_get_link(struct dentry *dentry, struct inode *inode,
|
zpl_get_link(struct dentry *dentry, struct inode *inode,
|
||||||
struct delayed_call *done)
|
struct delayed_call *done)
|
||||||
@ -710,36 +701,6 @@ zpl_get_link(struct dentry *dentry, struct inode *inode,
|
|||||||
|
|
||||||
return (link);
|
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
|
static int
|
||||||
zpl_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry)
|
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
|
#ifdef HAVE_GENERIC_READLINK
|
||||||
.readlink = generic_readlink,
|
.readlink = generic_readlink,
|
||||||
#endif
|
#endif
|
||||||
#if defined(HAVE_GET_LINK_DELAYED) || defined(HAVE_GET_LINK_COOKIE)
|
|
||||||
.get_link = zpl_get_link,
|
.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,
|
.setattr = zpl_setattr,
|
||||||
.getattr = zpl_getattr,
|
.getattr = zpl_getattr,
|
||||||
#ifdef HAVE_GENERIC_SETXATTR
|
#ifdef HAVE_GENERIC_SETXATTR
|
||||||
|
Loading…
Reference in New Issue
Block a user