The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/contrib/openzfs/config/kernel-rename.m4

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 AC_DEFUN([ZFS_AC_KERNEL_SRC_RENAME], [
    2         dnl #
    3         dnl # 3.9 (to 4.9) API change,
    4         dnl #
    5         dnl # A new version of iops->rename() was added (rename2) that takes a flag
    6         dnl # argument (to support renameat2). However this separate function was
    7         dnl # merged back into iops->rename() in Linux 4.9.
    8         dnl #
    9         ZFS_LINUX_TEST_SRC([inode_operations_rename2], [
   10                 #include <linux/fs.h>
   11                 int rename2_fn(struct inode *sip, struct dentry *sdp,
   12                         struct inode *tip, struct dentry *tdp,
   13                         unsigned int flags) { return 0; }
   14 
   15                 static const struct inode_operations
   16                     iops __attribute__ ((unused)) = {
   17                         .rename2 = rename2_fn,
   18                 };
   19         ],[])
   20 
   21         dnl #
   22         dnl # 4.9 API change,
   23         dnl #
   24         dnl # iops->rename2() merged into iops->rename(), and iops->rename() now
   25         dnl # wants flags.
   26         dnl #
   27         ZFS_LINUX_TEST_SRC([inode_operations_rename_flags], [
   28                 #include <linux/fs.h>
   29                 int rename_fn(struct inode *sip, struct dentry *sdp,
   30                         struct inode *tip, struct dentry *tdp,
   31                         unsigned int flags) { return 0; }
   32 
   33                 static const struct inode_operations
   34                     iops __attribute__ ((unused)) = {
   35                         .rename = rename_fn,
   36                 };
   37         ],[])
   38 
   39         dnl #
   40         dnl # EL7 compatibility
   41         dnl #
   42         dnl # EL7 has backported renameat2 support, but it's done by defining a
   43         dnl # separate iops wrapper structure that takes the .renameat2 function.
   44         dnl #
   45         ZFS_LINUX_TEST_SRC([dir_inode_operations_wrapper_rename2], [
   46                 #include <linux/fs.h>
   47                 int rename2_fn(struct inode *sip, struct dentry *sdp,
   48                         struct inode *tip, struct dentry *tdp,
   49                         unsigned int flags) { return 0; }
   50 
   51                 static const struct inode_operations_wrapper
   52                     iops __attribute__ ((unused)) = {
   53                         .rename2 = rename2_fn,
   54                 };
   55         ],[])
   56 
   57         dnl #
   58         dnl # 5.12 API change,
   59         dnl #
   60         dnl # Linux 5.12 introduced passing struct user_namespace* as the first
   61         dnl # argument of the rename() and other inode_operations members.
   62         dnl #
   63         ZFS_LINUX_TEST_SRC([inode_operations_rename_userns], [
   64                 #include <linux/fs.h>
   65                 int rename_fn(struct user_namespace *user_ns, struct inode *sip,
   66                         struct dentry *sdp, struct inode *tip, struct dentry *tdp,
   67                         unsigned int flags) { return 0; }
   68 
   69                 static const struct inode_operations
   70                     iops __attribute__ ((unused)) = {
   71                         .rename = rename_fn,
   72                 };
   73         ],[])
   74 ])
   75 
   76 AC_DEFUN([ZFS_AC_KERNEL_RENAME], [
   77         AC_MSG_CHECKING([whether iops->rename() takes struct user_namespace*])
   78         ZFS_LINUX_TEST_RESULT([inode_operations_rename_userns], [
   79                 AC_MSG_RESULT(yes)
   80                 AC_DEFINE(HAVE_IOPS_RENAME_USERNS, 1,
   81                     [iops->rename() takes struct user_namespace*])
   82         ],[
   83                 AC_MSG_RESULT(no)
   84 
   85                 AC_MSG_CHECKING([whether iops->rename2() exists])
   86                 ZFS_LINUX_TEST_RESULT([inode_operations_rename2], [
   87                         AC_MSG_RESULT(yes)
   88                         AC_DEFINE(HAVE_RENAME2, 1, [iops->rename2() exists])
   89                 ],[
   90                         AC_MSG_RESULT(no)
   91 
   92                         AC_MSG_CHECKING([whether iops->rename() wants flags])
   93                         ZFS_LINUX_TEST_RESULT([inode_operations_rename_flags], [
   94                                 AC_MSG_RESULT(yes)
   95                                 AC_DEFINE(HAVE_RENAME_WANTS_FLAGS, 1,
   96                                         [iops->rename() wants flags])
   97                         ],[
   98                                 AC_MSG_RESULT(no)
   99 
  100                                 AC_MSG_CHECKING([whether struct inode_operations_wrapper takes .rename2()])
  101                                 ZFS_LINUX_TEST_RESULT([dir_inode_operations_wrapper_rename2], [
  102                                         AC_MSG_RESULT(yes)
  103                                         AC_DEFINE(HAVE_RENAME2_OPERATIONS_WRAPPER, 1,
  104                                                 [struct inode_operations_wrapper takes .rename2()])
  105                                 ],[
  106                                         AC_MSG_RESULT(no)
  107                                 ])
  108                         ])
  109                 ])
  110         ])
  111 ])

Cache object: 022e86c7bd76a3808162e34ab7b9458d


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.