diff options
author | Darik Horn <[email protected]> | 2011-12-16 15:15:12 -0600 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2011-12-16 20:02:52 -0800 |
commit | 28eb9213d89cb25438fcecb86e735cc3edc26ea4 (patch) | |
tree | cc7fd47f23fac75f81ed6d888d6d84aa00711e9c /config | |
parent | e6101ea87f5127c549d520aad124290857218fa5 (diff) |
Linux 3.2 compat: set_nlink()
Directly changing inode->i_nlink is deprecated in Linux 3.2 by commit
SHA: bfe8684869601dacfcb2cd69ef8cfd9045f62170
Use the new set_nlink() kernel function instead.
Signed-off-by: Brian Behlendorf <[email protected]>
Closes: #462
Diffstat (limited to 'config')
-rw-r--r-- | config/kernel-set-nlink.m4 | 20 | ||||
-rw-r--r-- | config/kernel.m4 | 1 |
2 files changed, 21 insertions, 0 deletions
diff --git a/config/kernel-set-nlink.m4 b/config/kernel-set-nlink.m4 new file mode 100644 index 000000000..f7ffc0d3a --- /dev/null +++ b/config/kernel-set-nlink.m4 @@ -0,0 +1,20 @@ +dnl # +dnl # Linux v3.2-rc1 API change +dnl # SHA: bfe8684869601dacfcb2cd69ef8cfd9045f62170 +dnl # +AC_DEFUN([ZFS_AC_KERNEL_SET_NLINK], [ + AC_MSG_CHECKING([whether set_nlink() is available]) + ZFS_LINUX_TRY_COMPILE([ + #include <linux/fs.h> + ],[ + struct inode node; + unsigned int link = 0; + (void) set_nlink(&node, link); + ],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_SET_NLINK, 1, + [set_nlink() is available]) + ],[ + AC_MSG_RESULT(no) + ]) +]) diff --git a/config/kernel.m4 b/config/kernel.m4 index 8cfbccfc5..63a3237ec 100644 --- a/config/kernel.m4 +++ b/config/kernel.m4 @@ -42,6 +42,7 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [ ZFS_AC_KERNEL_MOUNT_NODEV ZFS_AC_KERNEL_BDI ZFS_AC_KERNEL_BDI_SETUP_AND_REGISTER + ZFS_AC_KERNEL_SET_NLINK AS_IF([test "$LINUX_OBJ" != "$LINUX"], [ KERNELMAKE_PARAMS="$KERNELMAKE_PARAMS O=$LINUX_OBJ" |