summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarik Horn <[email protected]>2011-12-16 15:15:12 -0600
committerBrian Behlendorf <[email protected]>2011-12-16 20:02:52 -0800
commit28eb9213d89cb25438fcecb86e735cc3edc26ea4 (patch)
treecc7fd47f23fac75f81ed6d888d6d84aa00711e9c
parente6101ea87f5127c549d520aad124290857218fa5 (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
-rw-r--r--Makefile.in1
-rw-r--r--cmd/Makefile.in1
-rw-r--r--cmd/mount_zfs/Makefile.in1
-rw-r--r--cmd/sas_switch_id/Makefile.in1
-rw-r--r--cmd/zdb/Makefile.in1
-rw-r--r--cmd/zfs/Makefile.in1
-rw-r--r--cmd/zinject/Makefile.in1
-rw-r--r--cmd/zpios/Makefile.in1
-rw-r--r--cmd/zpool/Makefile.in1
-rw-r--r--cmd/zpool_id/Makefile.in1
-rw-r--r--cmd/zpool_layout/Makefile.in1
-rw-r--r--cmd/ztest/Makefile.in1
-rw-r--r--cmd/zvol_id/Makefile.in1
-rw-r--r--config/kernel-set-nlink.m420
-rw-r--r--config/kernel.m41
-rwxr-xr-xconfigure134
-rw-r--r--dracut/90zfs/Makefile.in1
-rw-r--r--dracut/Makefile.in1
-rw-r--r--etc/Makefile.in1
-rw-r--r--etc/init.d/Makefile.in1
-rw-r--r--etc/zfs/Makefile.in1
-rw-r--r--include/Makefile.in1
-rw-r--r--include/linux/Makefile.in1
-rw-r--r--include/linux/vfs_compat.h15
-rw-r--r--include/sys/Makefile.in1
-rw-r--r--include/sys/fm/Makefile.in1
-rw-r--r--include/sys/fm/fs/Makefile.in1
-rw-r--r--include/sys/fs/Makefile.in1
-rw-r--r--lib/Makefile.in1
-rw-r--r--lib/libavl/Makefile.in1
-rw-r--r--lib/libefi/Makefile.in1
-rw-r--r--lib/libnvpair/Makefile.in1
-rw-r--r--lib/libshare/Makefile.in1
-rw-r--r--lib/libspl/Makefile.in1
-rw-r--r--lib/libspl/asm-generic/Makefile.in1
-rw-r--r--lib/libspl/asm-i386/Makefile.in1
-rw-r--r--lib/libspl/asm-x86_64/Makefile.in1
-rw-r--r--lib/libspl/include/Makefile.in1
-rw-r--r--lib/libspl/include/ia32/Makefile.in1
-rw-r--r--lib/libspl/include/ia32/sys/Makefile.in1
-rw-r--r--lib/libspl/include/rpc/Makefile.in1
-rw-r--r--lib/libspl/include/sys/Makefile.in1
-rw-r--r--lib/libspl/include/sys/dktp/Makefile.in1
-rw-r--r--lib/libspl/include/sys/sysevent/Makefile.in1
-rw-r--r--lib/libspl/include/util/Makefile.in1
-rw-r--r--lib/libunicode/Makefile.in1
-rw-r--r--lib/libuutil/Makefile.in1
-rw-r--r--lib/libzfs/Makefile.in1
-rw-r--r--lib/libzpool/Makefile.in1
-rw-r--r--man/Makefile.in1
-rw-r--r--man/man8/Makefile.in1
-rw-r--r--module/zfs/zfs_znode.c2
-rw-r--r--scripts/Makefile.in1
-rw-r--r--scripts/zpios-profile/Makefile.in1
-rw-r--r--scripts/zpios-test/Makefile.in1
-rw-r--r--scripts/zpool-config/Makefile.in1
-rw-r--r--scripts/zpool-layout/Makefile.in1
-rw-r--r--udev/Makefile.in1
-rw-r--r--udev/rules.d/Makefile.in1
-rw-r--r--zfs_config.h.in3
60 files changed, 228 insertions, 1 deletions
diff --git a/Makefile.in b/Makefile.in
index 6c5504060..332efc173 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -91,6 +91,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/cmd/Makefile.in b/cmd/Makefile.in
index f006e4c03..ee3f4bef2 100644
--- a/cmd/Makefile.in
+++ b/cmd/Makefile.in
@@ -68,6 +68,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/cmd/mount_zfs/Makefile.in b/cmd/mount_zfs/Makefile.in
index 3ae2015cf..e7da7c202 100644
--- a/cmd/mount_zfs/Makefile.in
+++ b/cmd/mount_zfs/Makefile.in
@@ -71,6 +71,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/cmd/sas_switch_id/Makefile.in b/cmd/sas_switch_id/Makefile.in
index a23b35d4c..fb6ea65ec 100644
--- a/cmd/sas_switch_id/Makefile.in
+++ b/cmd/sas_switch_id/Makefile.in
@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/cmd/zdb/Makefile.in b/cmd/zdb/Makefile.in
index 7e0a88eb0..da3119592 100644
--- a/cmd/zdb/Makefile.in
+++ b/cmd/zdb/Makefile.in
@@ -71,6 +71,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/cmd/zfs/Makefile.in b/cmd/zfs/Makefile.in
index 759492fa1..55ca80892 100644
--- a/cmd/zfs/Makefile.in
+++ b/cmd/zfs/Makefile.in
@@ -71,6 +71,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/cmd/zinject/Makefile.in b/cmd/zinject/Makefile.in
index 77d8a1084..5e6f90ecb 100644
--- a/cmd/zinject/Makefile.in
+++ b/cmd/zinject/Makefile.in
@@ -71,6 +71,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/cmd/zpios/Makefile.in b/cmd/zpios/Makefile.in
index 1374449ee..cf672f1e1 100644
--- a/cmd/zpios/Makefile.in
+++ b/cmd/zpios/Makefile.in
@@ -71,6 +71,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/cmd/zpool/Makefile.in b/cmd/zpool/Makefile.in
index df27c8c3e..b915006f4 100644
--- a/cmd/zpool/Makefile.in
+++ b/cmd/zpool/Makefile.in
@@ -71,6 +71,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/cmd/zpool_id/Makefile.in b/cmd/zpool_id/Makefile.in
index eefb09a7e..aadd12413 100644
--- a/cmd/zpool_id/Makefile.in
+++ b/cmd/zpool_id/Makefile.in
@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/cmd/zpool_layout/Makefile.in b/cmd/zpool_layout/Makefile.in
index 9914ca177..e1b164313 100644
--- a/cmd/zpool_layout/Makefile.in
+++ b/cmd/zpool_layout/Makefile.in
@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/cmd/ztest/Makefile.in b/cmd/ztest/Makefile.in
index 0ed775417..e99cc9e85 100644
--- a/cmd/ztest/Makefile.in
+++ b/cmd/ztest/Makefile.in
@@ -71,6 +71,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/cmd/zvol_id/Makefile.in b/cmd/zvol_id/Makefile.in
index 6b2af9633..d6719fdb6 100644
--- a/cmd/zvol_id/Makefile.in
+++ b/cmd/zvol_id/Makefile.in
@@ -71,6 +71,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
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"
diff --git a/configure b/configure
index 919a4dda0..e9e2ec1b6 100755
--- a/configure
+++ b/configure
@@ -15226,6 +15226,73 @@ fi
+ { $as_echo "$as_me:$LINENO: checking whether set_nlink() is available" >&5
+$as_echo_n "checking whether set_nlink() is available... " >&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)
+{
+
+ struct inode node;
+ unsigned int link = 0;
+ (void) set_nlink(&node, link);
+
+ ;
+ 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_SET_NLINK 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
+
+
+
+
if test "$LINUX_OBJ" != "$LINUX"; then
KERNELMAKE_PARAMS="$KERNELMAKE_PARAMS O=$LINUX_OBJ"
@@ -19996,6 +20063,73 @@ fi
+ { $as_echo "$as_me:$LINENO: checking whether set_nlink() is available" >&5
+$as_echo_n "checking whether set_nlink() is available... " >&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)
+{
+
+ struct inode node;
+ unsigned int link = 0;
+ (void) set_nlink(&node, link);
+
+ ;
+ 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_SET_NLINK 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
+
+
+
+
if test "$LINUX_OBJ" != "$LINUX"; then
KERNELMAKE_PARAMS="$KERNELMAKE_PARAMS O=$LINUX_OBJ"
diff --git a/dracut/90zfs/Makefile.in b/dracut/90zfs/Makefile.in
index 07bf3f23e..cc7961812 100644
--- a/dracut/90zfs/Makefile.in
+++ b/dracut/90zfs/Makefile.in
@@ -69,6 +69,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/dracut/Makefile.in b/dracut/Makefile.in
index b2769b1a8..1c6b3e609 100644
--- a/dracut/Makefile.in
+++ b/dracut/Makefile.in
@@ -68,6 +68,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/etc/Makefile.in b/etc/Makefile.in
index 594db91dc..a2e398604 100644
--- a/etc/Makefile.in
+++ b/etc/Makefile.in
@@ -68,6 +68,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/etc/init.d/Makefile.in b/etc/init.d/Makefile.in
index 31da3b6ce..9eb8ae7b4 100644
--- a/etc/init.d/Makefile.in
+++ b/etc/init.d/Makefile.in
@@ -69,6 +69,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/etc/zfs/Makefile.in b/etc/zfs/Makefile.in
index 59c7b8ed7..6c81f5d8c 100644
--- a/etc/zfs/Makefile.in
+++ b/etc/zfs/Makefile.in
@@ -69,6 +69,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/include/Makefile.in b/include/Makefile.in
index 9ea2e2f0b..f82fdb267 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/include/linux/Makefile.in b/include/linux/Makefile.in
index 5e04eb4ef..e50b89b9b 100644
--- a/include/linux/Makefile.in
+++ b/include/linux/Makefile.in
@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/include/linux/vfs_compat.h b/include/linux/vfs_compat.h
index 825a7fd3b..371bbc1d1 100644
--- a/include/linux/vfs_compat.h
+++ b/include/linux/vfs_compat.h
@@ -94,4 +94,19 @@ bdi_setup_and_register(struct backing_dev_info *bdi,char *name,unsigned int cap)
}
#endif /* HAVE_BDI && !HAVE_BDI_SETUP_AND_REGISTER */
+/*
+ * 3.2-rc1 API change,
+ * Add set_nlink() if it is not exported by the Linux kernel.
+ *
+ * i_nlink is read-only in Linux 3.2, but it can be set directly in
+ * earlier kernels.
+ */
+#ifndef HAVE_SET_NLINK
+static inline void
+set_nlink(struct inode *inode, unsigned int nlink)
+{
+ inode->i_nlink = nlink;
+}
+#endif /* HAVE_SET_NLINK */
+
#endif /* _ZFS_VFS_H */
diff --git a/include/sys/Makefile.in b/include/sys/Makefile.in
index ad98df9c9..b17649b02 100644
--- a/include/sys/Makefile.in
+++ b/include/sys/Makefile.in
@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/include/sys/fm/Makefile.in b/include/sys/fm/Makefile.in
index b29c9f34d..e3fd84cfd 100644
--- a/include/sys/fm/Makefile.in
+++ b/include/sys/fm/Makefile.in
@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/include/sys/fm/fs/Makefile.in b/include/sys/fm/fs/Makefile.in
index 395e6980b..40952616b 100644
--- a/include/sys/fm/fs/Makefile.in
+++ b/include/sys/fm/fs/Makefile.in
@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/include/sys/fs/Makefile.in b/include/sys/fs/Makefile.in
index c6de71aed..db73ab862 100644
--- a/include/sys/fs/Makefile.in
+++ b/include/sys/fs/Makefile.in
@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/lib/Makefile.in b/lib/Makefile.in
index e132c2018..17f84a548 100644
--- a/lib/Makefile.in
+++ b/lib/Makefile.in
@@ -68,6 +68,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/lib/libavl/Makefile.in b/lib/libavl/Makefile.in
index 38a83579d..55bb04d9f 100644
--- a/lib/libavl/Makefile.in
+++ b/lib/libavl/Makefile.in
@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/lib/libefi/Makefile.in b/lib/libefi/Makefile.in
index 9f236308b..6e4a83b3c 100644
--- a/lib/libefi/Makefile.in
+++ b/lib/libefi/Makefile.in
@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/lib/libnvpair/Makefile.in b/lib/libnvpair/Makefile.in
index 589938eee..60439aece 100644
--- a/lib/libnvpair/Makefile.in
+++ b/lib/libnvpair/Makefile.in
@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/lib/libshare/Makefile.in b/lib/libshare/Makefile.in
index c0c078643..94ea82e90 100644
--- a/lib/libshare/Makefile.in
+++ b/lib/libshare/Makefile.in
@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/lib/libspl/Makefile.in b/lib/libspl/Makefile.in
index f0d3d768f..194679a93 100644
--- a/lib/libspl/Makefile.in
+++ b/lib/libspl/Makefile.in
@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/lib/libspl/asm-generic/Makefile.in b/lib/libspl/asm-generic/Makefile.in
index 2e29d93ca..a9ffb578c 100644
--- a/lib/libspl/asm-generic/Makefile.in
+++ b/lib/libspl/asm-generic/Makefile.in
@@ -69,6 +69,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/lib/libspl/asm-i386/Makefile.in b/lib/libspl/asm-i386/Makefile.in
index d366650aa..ca6573040 100644
--- a/lib/libspl/asm-i386/Makefile.in
+++ b/lib/libspl/asm-i386/Makefile.in
@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/lib/libspl/asm-x86_64/Makefile.in b/lib/libspl/asm-x86_64/Makefile.in
index b3b90420e..2db49b35a 100644
--- a/lib/libspl/asm-x86_64/Makefile.in
+++ b/lib/libspl/asm-x86_64/Makefile.in
@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/lib/libspl/include/Makefile.in b/lib/libspl/include/Makefile.in
index 4653fea58..d7a8f52fc 100644
--- a/lib/libspl/include/Makefile.in
+++ b/lib/libspl/include/Makefile.in
@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/lib/libspl/include/ia32/Makefile.in b/lib/libspl/include/ia32/Makefile.in
index 3782302fd..b60892865 100644
--- a/lib/libspl/include/ia32/Makefile.in
+++ b/lib/libspl/include/ia32/Makefile.in
@@ -68,6 +68,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/lib/libspl/include/ia32/sys/Makefile.in b/lib/libspl/include/ia32/sys/Makefile.in
index 9503ba6a6..36629967e 100644
--- a/lib/libspl/include/ia32/sys/Makefile.in
+++ b/lib/libspl/include/ia32/sys/Makefile.in
@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/lib/libspl/include/rpc/Makefile.in b/lib/libspl/include/rpc/Makefile.in
index f3a7fd39b..68e3c2f12 100644
--- a/lib/libspl/include/rpc/Makefile.in
+++ b/lib/libspl/include/rpc/Makefile.in
@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/lib/libspl/include/sys/Makefile.in b/lib/libspl/include/sys/Makefile.in
index 8a69ebcd9..6851505dd 100644
--- a/lib/libspl/include/sys/Makefile.in
+++ b/lib/libspl/include/sys/Makefile.in
@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/lib/libspl/include/sys/dktp/Makefile.in b/lib/libspl/include/sys/dktp/Makefile.in
index 8cd6cbfb7..89c3285e1 100644
--- a/lib/libspl/include/sys/dktp/Makefile.in
+++ b/lib/libspl/include/sys/dktp/Makefile.in
@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/lib/libspl/include/sys/sysevent/Makefile.in b/lib/libspl/include/sys/sysevent/Makefile.in
index 207802518..de9db421b 100644
--- a/lib/libspl/include/sys/sysevent/Makefile.in
+++ b/lib/libspl/include/sys/sysevent/Makefile.in
@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/lib/libspl/include/util/Makefile.in b/lib/libspl/include/util/Makefile.in
index 91c91fa28..d7cd17c15 100644
--- a/lib/libspl/include/util/Makefile.in
+++ b/lib/libspl/include/util/Makefile.in
@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/lib/libunicode/Makefile.in b/lib/libunicode/Makefile.in
index 932fb8aaf..f6c8690cd 100644
--- a/lib/libunicode/Makefile.in
+++ b/lib/libunicode/Makefile.in
@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/lib/libuutil/Makefile.in b/lib/libuutil/Makefile.in
index c05c31c0c..d44bba2d6 100644
--- a/lib/libuutil/Makefile.in
+++ b/lib/libuutil/Makefile.in
@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/lib/libzfs/Makefile.in b/lib/libzfs/Makefile.in
index 14db984e1..29642b1ac 100644
--- a/lib/libzfs/Makefile.in
+++ b/lib/libzfs/Makefile.in
@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/lib/libzpool/Makefile.in b/lib/libzpool/Makefile.in
index 63297bc4a..0e46c1516 100644
--- a/lib/libzpool/Makefile.in
+++ b/lib/libzpool/Makefile.in
@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/man/Makefile.in b/man/Makefile.in
index e6a82e926..84c6c1706 100644
--- a/man/Makefile.in
+++ b/man/Makefile.in
@@ -68,6 +68,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/man/man8/Makefile.in b/man/man8/Makefile.in
index 98193dbf2..be187c9c0 100644
--- a/man/man8/Makefile.in
+++ b/man/man8/Makefile.in
@@ -68,6 +68,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/module/zfs/zfs_znode.c b/module/zfs/zfs_znode.c
index 1edbd7e2e..a35e3b5f2 100644
--- a/module/zfs/zfs_znode.c
+++ b/module/zfs/zfs_znode.c
@@ -440,7 +440,7 @@ zfs_inode_update(znode_t *zp)
ip->i_generation = zp->z_gen;
ip->i_uid = zp->z_uid;
ip->i_gid = zp->z_gid;
- ip->i_nlink = zp->z_links;
+ set_nlink(ip, zp->z_links);
ip->i_mode = zp->z_mode;
ip->i_blkbits = SPA_MINBLOCKSHIFT;
dmu_object_size_from_db(sa_get_db(zp->z_sa_hdl), &blksize,
diff --git a/scripts/Makefile.in b/scripts/Makefile.in
index 966288d91..5115a9e0b 100644
--- a/scripts/Makefile.in
+++ b/scripts/Makefile.in
@@ -69,6 +69,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/scripts/zpios-profile/Makefile.in b/scripts/zpios-profile/Makefile.in
index a9ba3e7c6..1c59d7475 100644
--- a/scripts/zpios-profile/Makefile.in
+++ b/scripts/zpios-profile/Makefile.in
@@ -69,6 +69,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/scripts/zpios-test/Makefile.in b/scripts/zpios-test/Makefile.in
index e237411f4..fb1114530 100644
--- a/scripts/zpios-test/Makefile.in
+++ b/scripts/zpios-test/Makefile.in
@@ -69,6 +69,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/scripts/zpool-config/Makefile.in b/scripts/zpool-config/Makefile.in
index 1e887e654..2c4fcb976 100644
--- a/scripts/zpool-config/Makefile.in
+++ b/scripts/zpool-config/Makefile.in
@@ -69,6 +69,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/scripts/zpool-layout/Makefile.in b/scripts/zpool-layout/Makefile.in
index 61067566d..bebd47b8f 100644
--- a/scripts/zpool-layout/Makefile.in
+++ b/scripts/zpool-layout/Makefile.in
@@ -69,6 +69,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/udev/Makefile.in b/udev/Makefile.in
index e1e592433..856d11aaf 100644
--- a/udev/Makefile.in
+++ b/udev/Makefile.in
@@ -68,6 +68,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/udev/rules.d/Makefile.in b/udev/rules.d/Makefile.in
index dba7a4511..37eb4c732 100644
--- a/udev/rules.d/Makefile.in
+++ b/udev/rules.d/Makefile.in
@@ -69,6 +69,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(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-truncate-setsize.m4 \
$(top_srcdir)/config/kernel-xattr-handler.m4 \
$(top_srcdir)/config/kernel.m4 \
diff --git a/zfs_config.h.in b/zfs_config.h.in
index 41d7ab152..e0f746704 100644
--- a/zfs_config.h.in
+++ b/zfs_config.h.in
@@ -153,6 +153,9 @@
/* rq_is_sync() is available */
#undef HAVE_RQ_IS_SYNC
+/* set_nlink() is available */
+#undef HAVE_SET_NLINK
+
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H