From 777d4af89137907adc91377327505f40c296035d Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Thu, 10 Feb 2011 16:16:52 -0800 Subject: [PATCH] Linux 2.6.35 compat, const struct xattr_handler The const keyword was added to the 'struct xattr_handler' in the generic Linux super_block structure. To handle this we define an appropriate xattr_handler_t typedef which can be used. This was the preferred solution because it keeps the code clean and readable. --- Makefile.in | 1 + cmd/Makefile.in | 1 + cmd/zdb/Makefile.in | 1 + cmd/zfs/Makefile.in | 1 + cmd/zinject/Makefile.in | 1 + cmd/zpios/Makefile.in | 1 + cmd/zpool/Makefile.in | 1 + cmd/zpool_id/Makefile.in | 1 + cmd/zpool_layout/Makefile.in | 1 + cmd/ztest/Makefile.in | 1 + config/kernel-xattr-handler.m4 | 32 ++++ config/kernel.m4 | 1 + configure | 154 ++++++++++++++++++++ etc/Makefile.in | 1 + include/Makefile.in | 1 + include/linux/Makefile.am | 1 + include/linux/Makefile.in | 2 + include/linux/xattr_compat.h | 42 ++++++ include/sys/Makefile.in | 1 + include/sys/fm/Makefile.in | 1 + include/sys/fm/fs/Makefile.in | 1 + include/sys/fs/Makefile.in | 1 + include/sys/zpl.h | 3 +- lib/Makefile.in | 1 + lib/libavl/Makefile.in | 1 + lib/libefi/Makefile.in | 1 + lib/libnvpair/Makefile.in | 1 + lib/libspl/Makefile.in | 1 + lib/libspl/asm-generic/Makefile.in | 1 + lib/libspl/asm-i386/Makefile.in | 1 + lib/libspl/asm-x86_64/Makefile.in | 1 + lib/libspl/include/Makefile.in | 1 + lib/libspl/include/ia32/Makefile.in | 1 + lib/libspl/include/ia32/sys/Makefile.in | 1 + lib/libspl/include/rpc/Makefile.in | 1 + lib/libspl/include/sys/Makefile.in | 1 + lib/libspl/include/sys/dktp/Makefile.in | 1 + lib/libspl/include/sys/sysevent/Makefile.in | 1 + lib/libspl/include/util/Makefile.in | 1 + lib/libunicode/Makefile.in | 1 + lib/libuutil/Makefile.in | 1 + lib/libzfs/Makefile.in | 1 + lib/libzpool/Makefile.in | 1 + man/Makefile.in | 1 + man/man8/Makefile.in | 1 + module/zfs/zpl_xattr.c | 8 +- scripts/Makefile.in | 1 + scripts/zpios-profile/Makefile.in | 1 + scripts/zpios-test/Makefile.in | 1 + scripts/zpool-config/Makefile.in | 1 + scripts/zpool-layout/Makefile.in | 1 + zfs_config.h.in | 3 + 52 files changed, 284 insertions(+), 5 deletions(-) create mode 100644 config/kernel-xattr-handler.m4 create mode 100644 include/linux/xattr_compat.h diff --git a/Makefile.in b/Makefile.in index 0d10478d86..f772c3ba41 100644 --- a/Makefile.in +++ b/Makefile.in @@ -72,6 +72,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \ $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ + $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ $(top_srcdir)/config/user-arch.m4 \ $(top_srcdir)/config/user-frame-larger-than.m4 \ diff --git a/cmd/Makefile.in b/cmd/Makefile.in index 016045a6a6..9c56ab45fd 100644 --- a/cmd/Makefile.in +++ b/cmd/Makefile.in @@ -57,6 +57,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \ $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ + $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ $(top_srcdir)/config/user-arch.m4 \ $(top_srcdir)/config/user-frame-larger-than.m4 \ diff --git a/cmd/zdb/Makefile.in b/cmd/zdb/Makefile.in index 08f8377e30..8d215ea477 100644 --- a/cmd/zdb/Makefile.in +++ b/cmd/zdb/Makefile.in @@ -60,6 +60,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \ $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ + $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ $(top_srcdir)/config/user-arch.m4 \ $(top_srcdir)/config/user-frame-larger-than.m4 \ diff --git a/cmd/zfs/Makefile.in b/cmd/zfs/Makefile.in index 44fff71f14..4db2632717 100644 --- a/cmd/zfs/Makefile.in +++ b/cmd/zfs/Makefile.in @@ -60,6 +60,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \ $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ + $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ $(top_srcdir)/config/user-arch.m4 \ $(top_srcdir)/config/user-frame-larger-than.m4 \ diff --git a/cmd/zinject/Makefile.in b/cmd/zinject/Makefile.in index 1141281002..6952f9c2b6 100644 --- a/cmd/zinject/Makefile.in +++ b/cmd/zinject/Makefile.in @@ -60,6 +60,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \ $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ + $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ $(top_srcdir)/config/user-arch.m4 \ $(top_srcdir)/config/user-frame-larger-than.m4 \ diff --git a/cmd/zpios/Makefile.in b/cmd/zpios/Makefile.in index 69747f368d..e280583191 100644 --- a/cmd/zpios/Makefile.in +++ b/cmd/zpios/Makefile.in @@ -60,6 +60,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \ $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ + $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ $(top_srcdir)/config/user-arch.m4 \ $(top_srcdir)/config/user-frame-larger-than.m4 \ diff --git a/cmd/zpool/Makefile.in b/cmd/zpool/Makefile.in index f800e6bc0c..c19f9bc7ce 100644 --- a/cmd/zpool/Makefile.in +++ b/cmd/zpool/Makefile.in @@ -60,6 +60,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \ $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ + $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ $(top_srcdir)/config/user-arch.m4 \ $(top_srcdir)/config/user-frame-larger-than.m4 \ diff --git a/cmd/zpool_id/Makefile.in b/cmd/zpool_id/Makefile.in index 5d32e8106e..828621d87e 100644 --- a/cmd/zpool_id/Makefile.in +++ b/cmd/zpool_id/Makefile.in @@ -59,6 +59,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \ $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ + $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ $(top_srcdir)/config/user-arch.m4 \ $(top_srcdir)/config/user-frame-larger-than.m4 \ diff --git a/cmd/zpool_layout/Makefile.in b/cmd/zpool_layout/Makefile.in index ef53493a55..bc9f465818 100644 --- a/cmd/zpool_layout/Makefile.in +++ b/cmd/zpool_layout/Makefile.in @@ -59,6 +59,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \ $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ + $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ $(top_srcdir)/config/user-arch.m4 \ $(top_srcdir)/config/user-frame-larger-than.m4 \ diff --git a/cmd/ztest/Makefile.in b/cmd/ztest/Makefile.in index ec16a73942..ead68085ff 100644 --- a/cmd/ztest/Makefile.in +++ b/cmd/ztest/Makefile.in @@ -60,6 +60,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \ $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ + $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ $(top_srcdir)/config/user-arch.m4 \ $(top_srcdir)/config/user-frame-larger-than.m4 \ diff --git a/config/kernel-xattr-handler.m4 b/config/kernel-xattr-handler.m4 new file mode 100644 index 0000000000..fa7294597e --- /dev/null +++ b/config/kernel-xattr-handler.m4 @@ -0,0 +1,32 @@ +dnl # +dnl # 2.6.35 API change, +dnl # The 'struct xattr_handler' was constified in the generic +dnl # super_block structure. +dnl # +AC_DEFUN([ZFS_AC_KERNEL_CONST_XATTR_HANDLER], + [AC_MSG_CHECKING([whether super_block uses const struct xattr_hander]) + ZFS_LINUX_TRY_COMPILE([ + #include + #include + + const struct xattr_handler xattr_test_handler = { + .prefix = "test", + .get = NULL, + .set = NULL, + }; + + const struct xattr_handler *xattr_handlers[] = { + &xattr_test_handler, + }; + ],[ + struct super_block sb; + + sb.s_xattr = xattr_handlers; + ],[ + AC_MSG_RESULT([yes]) + AC_DEFINE(HAVE_CONST_XATTR_HANDLER, 1, + [super_block uses const struct xattr_hander]) + ],[ + AC_MSG_RESULT([no]) + ]) +]) diff --git a/config/kernel.m4 b/config/kernel.m4 index 2c83dc5906..d1ed54fba7 100644 --- a/config/kernel.m4 +++ b/config/kernel.m4 @@ -28,6 +28,7 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [ ZFS_AC_KERNEL_GET_DISK_RO ZFS_AC_KERNEL_RQ_IS_SYNC ZFS_AC_KERNEL_RQ_FOR_EACH_SEGMENT + ZFS_AC_KERNEL_CONST_XATTR_HANDLER if test "$LINUX_OBJ" != "$LINUX"; then KERNELMAKE_PARAMS="$KERNELMAKE_PARAMS O=$LINUX_OBJ" diff --git a/configure b/configure index 716a73feef..19123d9bee 100755 --- a/configure +++ b/configure @@ -13816,6 +13816,83 @@ $as_echo "no" >&6; } +fi + + rm -Rf build + + + + { $as_echo "$as_me:$LINENO: checking whether super_block uses const struct xattr_hander" >&5 +$as_echo_n "checking whether super_block uses const struct xattr_hander... " >&6; } + + +cat confdefs.h - <<_ACEOF >conftest.c +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + + #include + #include + + const struct xattr_handler xattr_test_handler = { + .prefix = "test", + .get = NULL, + .set = NULL, + }; + + const struct xattr_handler *xattr_handlers[] = { + &xattr_test_handler, + }; + +int +main (void) +{ + + struct super_block sb; + + sb.s_xattr = xattr_handlers; + + ; + return 0; +} + +_ACEOF + + + rm -Rf build && mkdir -p build + echo "obj-m := conftest.o" >build/Makefile + if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } >/dev/null && { ac_try='test -s build/conftest.o' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + +cat >>confdefs.h <<\_ACEOF +#define HAVE_CONST_XATTR_HANDLER 1 +_ACEOF + + +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + + + fi rm -Rf build @@ -17343,6 +17420,83 @@ $as_echo "no" >&6; } +fi + + rm -Rf build + + + + { $as_echo "$as_me:$LINENO: checking whether super_block uses const struct xattr_hander" >&5 +$as_echo_n "checking whether super_block uses const struct xattr_hander... " >&6; } + + +cat confdefs.h - <<_ACEOF >conftest.c +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + + #include + #include + + const struct xattr_handler xattr_test_handler = { + .prefix = "test", + .get = NULL, + .set = NULL, + }; + + const struct xattr_handler *xattr_handlers[] = { + &xattr_test_handler, + }; + +int +main (void) +{ + + struct super_block sb; + + sb.s_xattr = xattr_handlers; + + ; + return 0; +} + +_ACEOF + + + rm -Rf build && mkdir -p build + echo "obj-m := conftest.o" >build/Makefile + if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } >/dev/null && { ac_try='test -s build/conftest.o' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + +cat >>confdefs.h <<\_ACEOF +#define HAVE_CONST_XATTR_HANDLER 1 +_ACEOF + + +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + + + fi rm -Rf build diff --git a/etc/Makefile.in b/etc/Makefile.in index 4d39394618..b9f7f36851 100644 --- a/etc/Makefile.in +++ b/etc/Makefile.in @@ -59,6 +59,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \ $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ + $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ $(top_srcdir)/config/user-arch.m4 \ $(top_srcdir)/config/user-frame-larger-than.m4 \ diff --git a/include/Makefile.in b/include/Makefile.in index f87cd7929c..8be6edc8a7 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -59,6 +59,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \ $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ + $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ $(top_srcdir)/config/user-arch.m4 \ $(top_srcdir)/config/user-frame-larger-than.m4 \ diff --git a/include/linux/Makefile.am b/include/linux/Makefile.am index 4ccd7b1245..67b56f83d6 100644 --- a/include/linux/Makefile.am +++ b/include/linux/Makefile.am @@ -2,6 +2,7 @@ COMMON_H = KERNEL_H = \ $(top_srcdir)/include/linux/dcache_compat.h + $(top_srcdir)/include/linux/xattr_compat.h USER_H = diff --git a/include/linux/Makefile.in b/include/linux/Makefile.in index 51d0a6d5bd..bd6db6f53b 100644 --- a/include/linux/Makefile.in +++ b/include/linux/Makefile.in @@ -59,6 +59,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \ $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ + $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ $(top_srcdir)/config/user-arch.m4 \ $(top_srcdir)/config/user-frame-larger-than.m4 \ @@ -562,6 +563,7 @@ uninstall-am: uninstall-kernelHEADERS uninstall-libzfsHEADERS ps ps-am tags uninstall uninstall-am uninstall-kernelHEADERS \ uninstall-libzfsHEADERS + $(top_srcdir)/include/linux/xattr_compat.h # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/include/linux/xattr_compat.h b/include/linux/xattr_compat.h new file mode 100644 index 0000000000..dfa92acab7 --- /dev/null +++ b/include/linux/xattr_compat.h @@ -0,0 +1,42 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (C) 2011 Lawrence Livermore National Security, LLC. + */ + +#ifndef _ZFS_XATTR_H +#define _ZFS_XATTR_H + +/* + * 2.6.35 API change, + * The const keyword was added to the 'struct xattr_handler' in the + * generic Linux super_block structure. To handle this we define an + * appropriate xattr_handler_t typedef which can be used. This was + * the preferred solution because it keeps the code clean and readable. + */ +#ifdef HAVE_CONST_XATTR_HANDLER +typedef const struct xattr_handler xattr_handler_t; +#else +typedef struct xattr_handler xattr_handler_t; +#endif + +#endif /* _ZFS_XATTR_H */ diff --git a/include/sys/Makefile.in b/include/sys/Makefile.in index 1525d1d07a..e95245f7e7 100644 --- a/include/sys/Makefile.in +++ b/include/sys/Makefile.in @@ -59,6 +59,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \ $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ + $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ $(top_srcdir)/config/user-arch.m4 \ $(top_srcdir)/config/user-frame-larger-than.m4 \ diff --git a/include/sys/fm/Makefile.in b/include/sys/fm/Makefile.in index 4099398b32..fe92c17a04 100644 --- a/include/sys/fm/Makefile.in +++ b/include/sys/fm/Makefile.in @@ -59,6 +59,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \ $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ + $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ $(top_srcdir)/config/user-arch.m4 \ $(top_srcdir)/config/user-frame-larger-than.m4 \ diff --git a/include/sys/fm/fs/Makefile.in b/include/sys/fm/fs/Makefile.in index ddad52360d..2e78a76457 100644 --- a/include/sys/fm/fs/Makefile.in +++ b/include/sys/fm/fs/Makefile.in @@ -59,6 +59,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \ $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ + $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ $(top_srcdir)/config/user-arch.m4 \ $(top_srcdir)/config/user-frame-larger-than.m4 \ diff --git a/include/sys/fs/Makefile.in b/include/sys/fs/Makefile.in index 903b08d37f..968a9f27f1 100644 --- a/include/sys/fs/Makefile.in +++ b/include/sys/fs/Makefile.in @@ -59,6 +59,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \ $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ + $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ $(top_srcdir)/config/user-arch.m4 \ $(top_srcdir)/config/user-frame-larger-than.m4 \ diff --git a/include/sys/zpl.h b/include/sys/zpl.h index 33f4f621f0..b8c3d09854 100644 --- a/include/sys/zpl.h +++ b/include/sys/zpl.h @@ -26,6 +26,7 @@ #define _SYS_ZPL_H #include +#include /* zpl_inode.c */ extern const struct inode_operations zpl_inode_operations; @@ -58,6 +59,6 @@ extern struct file_system_type zpl_fs_type; extern ssize_t zpl_xattr_list(struct dentry *dentry, char *buf, size_t size); extern int zpl_xattr_security_init(struct inode *ip, struct inode *dip); -extern struct xattr_handler *zpl_xattr_handlers[]; +extern xattr_handler_t *zpl_xattr_handlers[]; #endif /* _SYS_ZPL_H */ diff --git a/lib/Makefile.in b/lib/Makefile.in index d607102b11..de0b8b7162 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -57,6 +57,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \ $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ + $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ $(top_srcdir)/config/user-arch.m4 \ $(top_srcdir)/config/user-frame-larger-than.m4 \ diff --git a/lib/libavl/Makefile.in b/lib/libavl/Makefile.in index 91590932a3..3c249ea7ec 100644 --- a/lib/libavl/Makefile.in +++ b/lib/libavl/Makefile.in @@ -59,6 +59,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \ $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ + $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ $(top_srcdir)/config/user-arch.m4 \ $(top_srcdir)/config/user-frame-larger-than.m4 \ diff --git a/lib/libefi/Makefile.in b/lib/libefi/Makefile.in index 7839c13540..f162acffe4 100644 --- a/lib/libefi/Makefile.in +++ b/lib/libefi/Makefile.in @@ -59,6 +59,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \ $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ + $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ $(top_srcdir)/config/user-arch.m4 \ $(top_srcdir)/config/user-frame-larger-than.m4 \ diff --git a/lib/libnvpair/Makefile.in b/lib/libnvpair/Makefile.in index 0bafbab1c8..f0da5c4a90 100644 --- a/lib/libnvpair/Makefile.in +++ b/lib/libnvpair/Makefile.in @@ -59,6 +59,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \ $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ + $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ $(top_srcdir)/config/user-arch.m4 \ $(top_srcdir)/config/user-frame-larger-than.m4 \ diff --git a/lib/libspl/Makefile.in b/lib/libspl/Makefile.in index 8aa947ab42..b21c56dbb3 100644 --- a/lib/libspl/Makefile.in +++ b/lib/libspl/Makefile.in @@ -59,6 +59,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \ $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ + $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ $(top_srcdir)/config/user-arch.m4 \ $(top_srcdir)/config/user-frame-larger-than.m4 \ diff --git a/lib/libspl/asm-generic/Makefile.in b/lib/libspl/asm-generic/Makefile.in index 0a8ff7c258..7d30489950 100644 --- a/lib/libspl/asm-generic/Makefile.in +++ b/lib/libspl/asm-generic/Makefile.in @@ -58,6 +58,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \ $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ + $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ $(top_srcdir)/config/user-arch.m4 \ $(top_srcdir)/config/user-frame-larger-than.m4 \ diff --git a/lib/libspl/asm-i386/Makefile.in b/lib/libspl/asm-i386/Makefile.in index 6ef74836a2..9050242741 100644 --- a/lib/libspl/asm-i386/Makefile.in +++ b/lib/libspl/asm-i386/Makefile.in @@ -59,6 +59,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \ $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ + $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ $(top_srcdir)/config/user-arch.m4 \ $(top_srcdir)/config/user-frame-larger-than.m4 \ diff --git a/lib/libspl/asm-x86_64/Makefile.in b/lib/libspl/asm-x86_64/Makefile.in index 5c1aeafeec..028d192988 100644 --- a/lib/libspl/asm-x86_64/Makefile.in +++ b/lib/libspl/asm-x86_64/Makefile.in @@ -59,6 +59,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \ $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ + $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ $(top_srcdir)/config/user-arch.m4 \ $(top_srcdir)/config/user-frame-larger-than.m4 \ diff --git a/lib/libspl/include/Makefile.in b/lib/libspl/include/Makefile.in index 0f2a688aef..d72b0aadd0 100644 --- a/lib/libspl/include/Makefile.in +++ b/lib/libspl/include/Makefile.in @@ -59,6 +59,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \ $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ + $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ $(top_srcdir)/config/user-arch.m4 \ $(top_srcdir)/config/user-frame-larger-than.m4 \ diff --git a/lib/libspl/include/ia32/Makefile.in b/lib/libspl/include/ia32/Makefile.in index d3a8f6fa25..295310bc68 100644 --- a/lib/libspl/include/ia32/Makefile.in +++ b/lib/libspl/include/ia32/Makefile.in @@ -57,6 +57,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \ $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ + $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ $(top_srcdir)/config/user-arch.m4 \ $(top_srcdir)/config/user-frame-larger-than.m4 \ diff --git a/lib/libspl/include/ia32/sys/Makefile.in b/lib/libspl/include/ia32/sys/Makefile.in index 5f7e05fdd5..a6f6072375 100644 --- a/lib/libspl/include/ia32/sys/Makefile.in +++ b/lib/libspl/include/ia32/sys/Makefile.in @@ -59,6 +59,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \ $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ + $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ $(top_srcdir)/config/user-arch.m4 \ $(top_srcdir)/config/user-frame-larger-than.m4 \ diff --git a/lib/libspl/include/rpc/Makefile.in b/lib/libspl/include/rpc/Makefile.in index 850f045421..96fdca6805 100644 --- a/lib/libspl/include/rpc/Makefile.in +++ b/lib/libspl/include/rpc/Makefile.in @@ -59,6 +59,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \ $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ + $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ $(top_srcdir)/config/user-arch.m4 \ $(top_srcdir)/config/user-frame-larger-than.m4 \ diff --git a/lib/libspl/include/sys/Makefile.in b/lib/libspl/include/sys/Makefile.in index f8f8294d99..8bde0cbd64 100644 --- a/lib/libspl/include/sys/Makefile.in +++ b/lib/libspl/include/sys/Makefile.in @@ -59,6 +59,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \ $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ + $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ $(top_srcdir)/config/user-arch.m4 \ $(top_srcdir)/config/user-frame-larger-than.m4 \ diff --git a/lib/libspl/include/sys/dktp/Makefile.in b/lib/libspl/include/sys/dktp/Makefile.in index 19b0f3bcb9..ec4a3a9dc7 100644 --- a/lib/libspl/include/sys/dktp/Makefile.in +++ b/lib/libspl/include/sys/dktp/Makefile.in @@ -59,6 +59,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \ $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ + $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ $(top_srcdir)/config/user-arch.m4 \ $(top_srcdir)/config/user-frame-larger-than.m4 \ diff --git a/lib/libspl/include/sys/sysevent/Makefile.in b/lib/libspl/include/sys/sysevent/Makefile.in index 96af2d3b1c..8d71235666 100644 --- a/lib/libspl/include/sys/sysevent/Makefile.in +++ b/lib/libspl/include/sys/sysevent/Makefile.in @@ -59,6 +59,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \ $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ + $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ $(top_srcdir)/config/user-arch.m4 \ $(top_srcdir)/config/user-frame-larger-than.m4 \ diff --git a/lib/libspl/include/util/Makefile.in b/lib/libspl/include/util/Makefile.in index bfaec7a2e3..daa1c57c8b 100644 --- a/lib/libspl/include/util/Makefile.in +++ b/lib/libspl/include/util/Makefile.in @@ -59,6 +59,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \ $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ + $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ $(top_srcdir)/config/user-arch.m4 \ $(top_srcdir)/config/user-frame-larger-than.m4 \ diff --git a/lib/libunicode/Makefile.in b/lib/libunicode/Makefile.in index fb075e8bf6..9cb8129692 100644 --- a/lib/libunicode/Makefile.in +++ b/lib/libunicode/Makefile.in @@ -59,6 +59,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \ $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ + $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ $(top_srcdir)/config/user-arch.m4 \ $(top_srcdir)/config/user-frame-larger-than.m4 \ diff --git a/lib/libuutil/Makefile.in b/lib/libuutil/Makefile.in index 32d6a7404f..1cd7310e88 100644 --- a/lib/libuutil/Makefile.in +++ b/lib/libuutil/Makefile.in @@ -59,6 +59,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \ $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ + $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ $(top_srcdir)/config/user-arch.m4 \ $(top_srcdir)/config/user-frame-larger-than.m4 \ diff --git a/lib/libzfs/Makefile.in b/lib/libzfs/Makefile.in index 1dbecc3352..000f3aa26f 100644 --- a/lib/libzfs/Makefile.in +++ b/lib/libzfs/Makefile.in @@ -59,6 +59,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \ $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ + $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ $(top_srcdir)/config/user-arch.m4 \ $(top_srcdir)/config/user-frame-larger-than.m4 \ diff --git a/lib/libzpool/Makefile.in b/lib/libzpool/Makefile.in index 344612d319..14a2b17cfe 100644 --- a/lib/libzpool/Makefile.in +++ b/lib/libzpool/Makefile.in @@ -59,6 +59,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \ $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ + $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ $(top_srcdir)/config/user-arch.m4 \ $(top_srcdir)/config/user-frame-larger-than.m4 \ diff --git a/man/Makefile.in b/man/Makefile.in index 3dbed30947..f0b9b705e4 100644 --- a/man/Makefile.in +++ b/man/Makefile.in @@ -57,6 +57,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \ $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ + $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ $(top_srcdir)/config/user-arch.m4 \ $(top_srcdir)/config/user-frame-larger-than.m4 \ diff --git a/man/man8/Makefile.in b/man/man8/Makefile.in index f3cd856375..58e804b262 100644 --- a/man/man8/Makefile.in +++ b/man/man8/Makefile.in @@ -57,6 +57,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \ $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ + $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ $(top_srcdir)/config/user-arch.m4 \ $(top_srcdir)/config/user-frame-larger-than.m4 \ diff --git a/module/zfs/zpl_xattr.c b/module/zfs/zpl_xattr.c index 910500a722..86e52f791e 100644 --- a/module/zfs/zpl_xattr.c +++ b/module/zfs/zpl_xattr.c @@ -305,7 +305,7 @@ zpl_xattr_user_set(struct inode *ip, const char *name, return (error); } -struct xattr_handler zpl_xattr_user_handler = { +xattr_handler_t zpl_xattr_user_handler = { .prefix = XATTR_USER_PREFIX, .get = zpl_xattr_user_get, .set = zpl_xattr_user_set, @@ -351,7 +351,7 @@ zpl_xattr_trusted_set(struct inode *ip, const char *name, return (error); } -struct xattr_handler zpl_xattr_trusted_handler = { +xattr_handler_t zpl_xattr_trusted_handler = { .prefix = XATTR_TRUSTED_PREFIX, .get = zpl_xattr_trusted_get, .set = zpl_xattr_trusted_set, @@ -415,13 +415,13 @@ zpl_xattr_security_init(struct inode *ip, struct inode *dip) return (error); } -struct xattr_handler zpl_xattr_security_handler = { +xattr_handler_t zpl_xattr_security_handler = { .prefix = XATTR_SECURITY_PREFIX, .get = zpl_xattr_security_get, .set = zpl_xattr_security_set, }; -struct xattr_handler *zpl_xattr_handlers[] = { +xattr_handler_t *zpl_xattr_handlers[] = { &zpl_xattr_security_handler, &zpl_xattr_trusted_handler, &zpl_xattr_user_handler, diff --git a/scripts/Makefile.in b/scripts/Makefile.in index 6653bf3851..2b2e30d603 100644 --- a/scripts/Makefile.in +++ b/scripts/Makefile.in @@ -58,6 +58,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \ $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ + $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ $(top_srcdir)/config/user-arch.m4 \ $(top_srcdir)/config/user-frame-larger-than.m4 \ diff --git a/scripts/zpios-profile/Makefile.in b/scripts/zpios-profile/Makefile.in index fd95774cbe..f369bbc2c1 100644 --- a/scripts/zpios-profile/Makefile.in +++ b/scripts/zpios-profile/Makefile.in @@ -58,6 +58,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \ $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ + $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ $(top_srcdir)/config/user-arch.m4 \ $(top_srcdir)/config/user-frame-larger-than.m4 \ diff --git a/scripts/zpios-test/Makefile.in b/scripts/zpios-test/Makefile.in index fcb6dfedde..9dfbe107f2 100644 --- a/scripts/zpios-test/Makefile.in +++ b/scripts/zpios-test/Makefile.in @@ -58,6 +58,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \ $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ + $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ $(top_srcdir)/config/user-arch.m4 \ $(top_srcdir)/config/user-frame-larger-than.m4 \ diff --git a/scripts/zpool-config/Makefile.in b/scripts/zpool-config/Makefile.in index da8b65e7c5..cc3e557e93 100644 --- a/scripts/zpool-config/Makefile.in +++ b/scripts/zpool-config/Makefile.in @@ -58,6 +58,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \ $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ + $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ $(top_srcdir)/config/user-arch.m4 \ $(top_srcdir)/config/user-frame-larger-than.m4 \ diff --git a/scripts/zpool-layout/Makefile.in b/scripts/zpool-layout/Makefile.in index dde427b3ff..881676cddc 100644 --- a/scripts/zpool-layout/Makefile.in +++ b/scripts/zpool-layout/Makefile.in @@ -58,6 +58,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \ $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ + $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ $(top_srcdir)/config/user-arch.m4 \ $(top_srcdir)/config/user-frame-larger-than.m4 \ diff --git a/zfs_config.h.in b/zfs_config.h.in index f8e218259f..52061a039f 100644 --- a/zfs_config.h.in +++ b/zfs_config.h.in @@ -54,6 +54,9 @@ /* blk_rq_sectors() is available */ #undef HAVE_BLK_RQ_SECTORS +/* super_block uses const struct xattr_hander */ +#undef HAVE_CONST_XATTR_HANDLER + /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H