diff options
-rw-r--r-- | config/kernel-sget-args.m4 | 23 | ||||
-rw-r--r-- | config/kernel.m4 | 1 | ||||
-rw-r--r-- | include/linux/vfs_compat.h | 10 | ||||
-rw-r--r-- | module/zfs/zfs_ctldir.c | 4 |
4 files changed, 36 insertions, 2 deletions
diff --git a/config/kernel-sget-args.m4 b/config/kernel-sget-args.m4 new file mode 100644 index 000000000..9d1745925 --- /dev/null +++ b/config/kernel-sget-args.m4 @@ -0,0 +1,23 @@ +dnl # +dnl # 3.6 API change, +dnl # 'sget' now takes the mount flags as an argument. +dnl # +AC_DEFUN([ZFS_AC_KERNEL_5ARG_SGET], + [AC_MSG_CHECKING([whether sget() wants 5 args]) + ZFS_LINUX_TRY_COMPILE([ + #include <linux/fs.h> + ],[ + struct file_system_type *type = NULL; + int (*test)(struct super_block *,void *) = NULL; + int (*set)(struct super_block *,void *) = NULL; + int flags = 0; + void *data = NULL; + (void) sget(type, test, set, flags, data); + ],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_5ARG_SGET, 1, [sget() wants 5 args]) + ],[ + AC_MSG_RESULT(no) + ]) +]) + diff --git a/config/kernel.m4 b/config/kernel.m4 index 89b0a9806..3a144a337 100644 --- a/config/kernel.m4 +++ b/config/kernel.m4 @@ -68,6 +68,7 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [ ZFS_AC_KERNEL_BDI_SETUP_AND_REGISTER ZFS_AC_KERNEL_SET_NLINK ZFS_AC_KERNEL_ELEVATOR_CHANGE + ZFS_AC_KERNEL_5ARG_SGET AS_IF([test "$LINUX_OBJ" != "$LINUX"], [ KERNELMAKE_PARAMS="$KERNELMAKE_PARAMS O=$LINUX_OBJ" diff --git a/include/linux/vfs_compat.h b/include/linux/vfs_compat.h index 9343f99a5..7181625df 100644 --- a/include/linux/vfs_compat.h +++ b/include/linux/vfs_compat.h @@ -131,4 +131,14 @@ typedef int zpl_umode_t; #define clear_inode(ip) end_writeback(ip) #endif /* HAVE_EVICT_INODE && !HAVE_CLEAR_INODE */ +/* + * 3.6 API change, + * The sget() helper function now takes the mount flags as an argument. + */ +#ifdef HAVE_5ARG_SGET +#define zpl_sget(type, cmp, set, fl, mtd) sget(type, cmp, set, fl, mtd) +#else +#define zpl_sget(type, cmp, set, fl, mtd) sget(type, cmp, set, mtd) +#endif /* HAVE_5ARG_SGET */ + #endif /* _ZFS_VFS_H */ diff --git a/module/zfs/zfs_ctldir.c b/module/zfs/zfs_ctldir.c index c49d7172a..55d169654 100644 --- a/module/zfs/zfs_ctldir.c +++ b/module/zfs/zfs_ctldir.c @@ -920,8 +920,8 @@ zfsctl_lookup_objset(struct super_block *sb, uint64_t objsetid, zfs_sb_t **zsbp) * race cannot occur to an expired mount point because * we hold the zsb->z_ctldir_lock to prevent the race. */ - sbp = sget(&zpl_fs_type, zfsctl_test_super, - zfsctl_set_super, &id); + sbp = zpl_sget(&zpl_fs_type, zfsctl_test_super, + zfsctl_set_super, 0, &id); if (IS_ERR(sbp)) { error = -PTR_ERR(sbp); } else { |