Skip to content

Commit

Permalink
Linux 3.3 compat, sops->show_options()
Browse files Browse the repository at this point in the history
The second argument of sops->show_options() was changed from a
'struct vfsmount *' to a 'struct dentry *'.  Add an autoconf check
to detect the API change and then conditionally define the expected
interface.  In either case we are only interested in the zfs_sb_t.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes openzfs#549
  • Loading branch information
behlendorf committed Feb 3, 2012
1 parent d7e398c commit 47621f3
Show file tree
Hide file tree
Showing 59 changed files with 234 additions and 7 deletions.
1 change: 1 addition & 0 deletions Makefile.in
Expand Up @@ -92,6 +92,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
$(top_srcdir)/config/kernel-security-inode-init.m4 \
$(top_srcdir)/config/kernel-set-nlink.m4 \
$(top_srcdir)/config/kernel-show-options.m4 \
$(top_srcdir)/config/kernel-shrink.m4 \
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
Expand Down
1 change: 1 addition & 0 deletions cmd/Makefile.in
Expand Up @@ -69,6 +69,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
$(top_srcdir)/config/kernel-security-inode-init.m4 \
$(top_srcdir)/config/kernel-set-nlink.m4 \
$(top_srcdir)/config/kernel-show-options.m4 \
$(top_srcdir)/config/kernel-shrink.m4 \
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
Expand Down
1 change: 1 addition & 0 deletions cmd/mount_zfs/Makefile.in
Expand Up @@ -72,6 +72,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
$(top_srcdir)/config/kernel-security-inode-init.m4 \
$(top_srcdir)/config/kernel-set-nlink.m4 \
$(top_srcdir)/config/kernel-show-options.m4 \
$(top_srcdir)/config/kernel-shrink.m4 \
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
Expand Down
1 change: 1 addition & 0 deletions cmd/sas_switch_id/Makefile.in
Expand Up @@ -71,6 +71,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
$(top_srcdir)/config/kernel-security-inode-init.m4 \
$(top_srcdir)/config/kernel-set-nlink.m4 \
$(top_srcdir)/config/kernel-show-options.m4 \
$(top_srcdir)/config/kernel-shrink.m4 \
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
Expand Down
1 change: 1 addition & 0 deletions cmd/zdb/Makefile.in
Expand Up @@ -72,6 +72,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
$(top_srcdir)/config/kernel-security-inode-init.m4 \
$(top_srcdir)/config/kernel-set-nlink.m4 \
$(top_srcdir)/config/kernel-show-options.m4 \
$(top_srcdir)/config/kernel-shrink.m4 \
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
Expand Down
1 change: 1 addition & 0 deletions cmd/zfs/Makefile.in
Expand Up @@ -72,6 +72,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
$(top_srcdir)/config/kernel-security-inode-init.m4 \
$(top_srcdir)/config/kernel-set-nlink.m4 \
$(top_srcdir)/config/kernel-show-options.m4 \
$(top_srcdir)/config/kernel-shrink.m4 \
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
Expand Down
1 change: 1 addition & 0 deletions cmd/zinject/Makefile.in
Expand Up @@ -72,6 +72,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
$(top_srcdir)/config/kernel-security-inode-init.m4 \
$(top_srcdir)/config/kernel-set-nlink.m4 \
$(top_srcdir)/config/kernel-show-options.m4 \
$(top_srcdir)/config/kernel-shrink.m4 \
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
Expand Down
1 change: 1 addition & 0 deletions cmd/zpios/Makefile.in
Expand Up @@ -72,6 +72,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
$(top_srcdir)/config/kernel-security-inode-init.m4 \
$(top_srcdir)/config/kernel-set-nlink.m4 \
$(top_srcdir)/config/kernel-show-options.m4 \
$(top_srcdir)/config/kernel-shrink.m4 \
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
Expand Down
1 change: 1 addition & 0 deletions cmd/zpool/Makefile.in
Expand Up @@ -72,6 +72,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
$(top_srcdir)/config/kernel-security-inode-init.m4 \
$(top_srcdir)/config/kernel-set-nlink.m4 \
$(top_srcdir)/config/kernel-show-options.m4 \
$(top_srcdir)/config/kernel-shrink.m4 \
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
Expand Down
1 change: 1 addition & 0 deletions cmd/zpool_id/Makefile.in
Expand Up @@ -71,6 +71,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
$(top_srcdir)/config/kernel-security-inode-init.m4 \
$(top_srcdir)/config/kernel-set-nlink.m4 \
$(top_srcdir)/config/kernel-show-options.m4 \
$(top_srcdir)/config/kernel-shrink.m4 \
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
Expand Down
1 change: 1 addition & 0 deletions cmd/zpool_layout/Makefile.in
Expand Up @@ -71,6 +71,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
$(top_srcdir)/config/kernel-security-inode-init.m4 \
$(top_srcdir)/config/kernel-set-nlink.m4 \
$(top_srcdir)/config/kernel-show-options.m4 \
$(top_srcdir)/config/kernel-shrink.m4 \
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
Expand Down
1 change: 1 addition & 0 deletions cmd/ztest/Makefile.in
Expand Up @@ -72,6 +72,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
$(top_srcdir)/config/kernel-security-inode-init.m4 \
$(top_srcdir)/config/kernel-set-nlink.m4 \
$(top_srcdir)/config/kernel-show-options.m4 \
$(top_srcdir)/config/kernel-shrink.m4 \
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
Expand Down
1 change: 1 addition & 0 deletions cmd/zvol_id/Makefile.in
Expand Up @@ -72,6 +72,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
$(top_srcdir)/config/kernel-security-inode-init.m4 \
$(top_srcdir)/config/kernel-set-nlink.m4 \
$(top_srcdir)/config/kernel-show-options.m4 \
$(top_srcdir)/config/kernel-shrink.m4 \
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
Expand Down
21 changes: 21 additions & 0 deletions config/kernel-show-options.m4
@@ -0,0 +1,21 @@
dnl #
dnl # Linux 3.3 API
dnl #
AC_DEFUN([ZFS_AC_KERNEL_SHOW_OPTIONS], [
AC_MSG_CHECKING([whether sops->show_options() wants dentry])
ZFS_LINUX_TRY_COMPILE([
#include <linux/fs.h>
],[
int (*show_options) (struct seq_file *, struct dentry *) = NULL;
struct super_operations sops __attribute__ ((unused));
sops.show_options = show_options;
],[
AC_MSG_RESULT([yes])
AC_DEFINE(HAVE_SHOW_OPTIONS_WITH_DENTRY, 1,
[sops->show_options() with dentry])
],[
AC_MSG_RESULT([no])
])
])
1 change: 1 addition & 0 deletions config/kernel.m4
Expand Up @@ -32,6 +32,7 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [
ZFS_AC_KERNEL_CONST_XATTR_HANDLER
ZFS_AC_KERNEL_XATTR_HANDLER_GET
ZFS_AC_KERNEL_XATTR_HANDLER_SET
ZFS_AC_KERNEL_SHOW_OPTIONS
ZFS_AC_KERNEL_FSYNC
ZFS_AC_KERNEL_EVICT_INODE
ZFS_AC_KERNEL_NR_CACHED_OBJECTS
Expand Down
138 changes: 138 additions & 0 deletions configure
Expand Up @@ -14514,6 +14514,75 @@ fi



{ $as_echo "$as_me:$LINENO: checking whether sops->show_options() wants dentry" >&5
$as_echo_n "checking whether sops->show_options() wants dentry... " >&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 <linux/fs.h>

int
main (void)
{

int (*show_options) (struct seq_file *, struct dentry *) = NULL;
struct super_operations sops __attribute__ ((unused));

sops.show_options = show_options;

;
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_SHOW_OPTIONS_WITH_DENTRY 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




{ $as_echo "$as_me:$LINENO: checking whether fops->fsync() wants" >&5
$as_echo_n "checking whether fops->fsync() wants... " >&6; }

Expand Down Expand Up @@ -19641,6 +19710,75 @@ fi



{ $as_echo "$as_me:$LINENO: checking whether sops->show_options() wants dentry" >&5
$as_echo_n "checking whether sops->show_options() wants dentry... " >&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 <linux/fs.h>

int
main (void)
{

int (*show_options) (struct seq_file *, struct dentry *) = NULL;
struct super_operations sops __attribute__ ((unused));

sops.show_options = show_options;

;
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_SHOW_OPTIONS_WITH_DENTRY 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




{ $as_echo "$as_me:$LINENO: checking whether fops->fsync() wants" >&5
$as_echo_n "checking whether fops->fsync() wants... " >&6; }

Expand Down
1 change: 1 addition & 0 deletions dracut/90zfs/Makefile.in
Expand Up @@ -70,6 +70,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
$(top_srcdir)/config/kernel-security-inode-init.m4 \
$(top_srcdir)/config/kernel-set-nlink.m4 \
$(top_srcdir)/config/kernel-show-options.m4 \
$(top_srcdir)/config/kernel-shrink.m4 \
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
Expand Down
1 change: 1 addition & 0 deletions dracut/Makefile.in
Expand Up @@ -69,6 +69,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
$(top_srcdir)/config/kernel-security-inode-init.m4 \
$(top_srcdir)/config/kernel-set-nlink.m4 \
$(top_srcdir)/config/kernel-show-options.m4 \
$(top_srcdir)/config/kernel-shrink.m4 \
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
Expand Down
1 change: 1 addition & 0 deletions etc/Makefile.in
Expand Up @@ -69,6 +69,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
$(top_srcdir)/config/kernel-security-inode-init.m4 \
$(top_srcdir)/config/kernel-set-nlink.m4 \
$(top_srcdir)/config/kernel-show-options.m4 \
$(top_srcdir)/config/kernel-shrink.m4 \
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
Expand Down
1 change: 1 addition & 0 deletions etc/init.d/Makefile.in
Expand Up @@ -70,6 +70,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
$(top_srcdir)/config/kernel-security-inode-init.m4 \
$(top_srcdir)/config/kernel-set-nlink.m4 \
$(top_srcdir)/config/kernel-show-options.m4 \
$(top_srcdir)/config/kernel-shrink.m4 \
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
Expand Down
1 change: 1 addition & 0 deletions etc/zfs/Makefile.in
Expand Up @@ -70,6 +70,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
$(top_srcdir)/config/kernel-security-inode-init.m4 \
$(top_srcdir)/config/kernel-set-nlink.m4 \
$(top_srcdir)/config/kernel-show-options.m4 \
$(top_srcdir)/config/kernel-shrink.m4 \
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
Expand Down
1 change: 1 addition & 0 deletions include/Makefile.in
Expand Up @@ -71,6 +71,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
$(top_srcdir)/config/kernel-security-inode-init.m4 \
$(top_srcdir)/config/kernel-set-nlink.m4 \
$(top_srcdir)/config/kernel-show-options.m4 \
$(top_srcdir)/config/kernel-shrink.m4 \
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
Expand Down
1 change: 1 addition & 0 deletions include/linux/Makefile.in
Expand Up @@ -71,6 +71,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
$(top_srcdir)/config/kernel-security-inode-init.m4 \
$(top_srcdir)/config/kernel-set-nlink.m4 \
$(top_srcdir)/config/kernel-show-options.m4 \
$(top_srcdir)/config/kernel-shrink.m4 \
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
Expand Down
1 change: 1 addition & 0 deletions include/sys/Makefile.in
Expand Up @@ -71,6 +71,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
$(top_srcdir)/config/kernel-security-inode-init.m4 \
$(top_srcdir)/config/kernel-set-nlink.m4 \
$(top_srcdir)/config/kernel-show-options.m4 \
$(top_srcdir)/config/kernel-shrink.m4 \
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
Expand Down
1 change: 1 addition & 0 deletions include/sys/fm/Makefile.in
Expand Up @@ -71,6 +71,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
$(top_srcdir)/config/kernel-security-inode-init.m4 \
$(top_srcdir)/config/kernel-set-nlink.m4 \
$(top_srcdir)/config/kernel-show-options.m4 \
$(top_srcdir)/config/kernel-shrink.m4 \
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
Expand Down
1 change: 1 addition & 0 deletions include/sys/fm/fs/Makefile.in
Expand Up @@ -71,6 +71,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
$(top_srcdir)/config/kernel-security-inode-init.m4 \
$(top_srcdir)/config/kernel-set-nlink.m4 \
$(top_srcdir)/config/kernel-show-options.m4 \
$(top_srcdir)/config/kernel-shrink.m4 \
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
Expand Down
1 change: 1 addition & 0 deletions include/sys/fs/Makefile.in
Expand Up @@ -71,6 +71,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
$(top_srcdir)/config/kernel-security-inode-init.m4 \
$(top_srcdir)/config/kernel-set-nlink.m4 \
$(top_srcdir)/config/kernel-show-options.m4 \
$(top_srcdir)/config/kernel-shrink.m4 \
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
Expand Down
1 change: 1 addition & 0 deletions lib/Makefile.in
Expand Up @@ -69,6 +69,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
$(top_srcdir)/config/kernel-security-inode-init.m4 \
$(top_srcdir)/config/kernel-set-nlink.m4 \
$(top_srcdir)/config/kernel-show-options.m4 \
$(top_srcdir)/config/kernel-shrink.m4 \
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
Expand Down
1 change: 1 addition & 0 deletions lib/libavl/Makefile.in
Expand Up @@ -71,6 +71,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
$(top_srcdir)/config/kernel-security-inode-init.m4 \
$(top_srcdir)/config/kernel-set-nlink.m4 \
$(top_srcdir)/config/kernel-show-options.m4 \
$(top_srcdir)/config/kernel-shrink.m4 \
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
Expand Down
1 change: 1 addition & 0 deletions lib/libefi/Makefile.in
Expand Up @@ -71,6 +71,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
$(top_srcdir)/config/kernel-security-inode-init.m4 \
$(top_srcdir)/config/kernel-set-nlink.m4 \
$(top_srcdir)/config/kernel-show-options.m4 \
$(top_srcdir)/config/kernel-shrink.m4 \
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
Expand Down

0 comments on commit 47621f3

Please sign in to comment.