Permalink
Browse files

Linux 3.6 fixes (part 1):

- sget() now takes one more arguments, which is the mount flag.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
  • Loading branch information...
1 parent 87d98ef commit 3b70152fa38bf5c3a9c36f7d10206e16a7a0be89 @nialv7 nialv7 committed with Oct 12, 2012
Showing with 24 additions and 0 deletions.
  1. +18 −0 config/kernel-sget-args.m4
  2. +1 −0 config/kernel.m4
  3. +5 −0 module/zfs/zfs_ctldir.c
View
@@ -0,0 +1,18 @@
+dnl #
+dnl # 3.6 API change,
+dnl # 'sget' now takes one more 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>
+ ],[
+ (void) sget(NULL, NULL, NULL, 0, NULL);
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_5ARG_SGET, 1, [sget() wants 5 args])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+])
+
View
@@ -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"
View
@@ -920,8 +920,13 @@ 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.
*/
+#ifdef HAVE_5ARG_SGET
+ sbp = sget(&zpl_fs_type, zfsctl_test_super,
+ zfsctl_set_super, 0, &id);
+#else
sbp = sget(&zpl_fs_type, zfsctl_test_super,
zfsctl_set_super, &id);
+#endif
if (IS_ERR(sbp)) {
error = -PTR_ERR(sbp);
} else {

0 comments on commit 3b70152

Please sign in to comment.