From 739a1a82e0f366923e8d9bc8f9ad4b1c680a780b Mon Sep 17 00:00:00 2001 From: Richard Yao Date: Mon, 23 Jul 2012 11:39:25 -0700 Subject: [PATCH] Linux 3.5 compat, end_writeback() changed to clear_inode() The end_writeback() function was changed by moving the call to inode_sync_wait() earlier in to evict(). This effecitvely changes the ordering of the sync but it does not impact the details of the zfs implementation. However, as part of this change end_writeback() was renamed to clear_inode() to reflect the new semantics. This change does impact us and clear_inode() now maps to end_writeback() for kernels prior to 3.5. Signed-off-by: Richard Yao Signed-off-by: Brian Behlendorf Closes #784 --- Makefile.in | 1 + cmd/Makefile.in | 1 + cmd/mount_zfs/Makefile.in | 1 + cmd/vdev_id/Makefile.in | 1 + cmd/zdb/Makefile.in | 1 + cmd/zfs/Makefile.in | 1 + cmd/zinject/Makefile.in | 1 + cmd/zpios/Makefile.in | 1 + cmd/zpool/Makefile.in | 1 + cmd/zpool_id/Makefile.in | 1 + cmd/zpool_layout/Makefile.in | 1 + cmd/ztest/Makefile.in | 1 + cmd/zvol_id/Makefile.in | 1 + config/kernel-clear-inode.m4 | 29 ++++++ config/kernel.m4 | 1 + configure | 106 ++++++++++++++++++++ dracut/90zfs/Makefile.in | 1 + dracut/Makefile.in | 1 + etc/Makefile.in | 1 + etc/init.d/Makefile.in | 1 + etc/zfs/Makefile.in | 1 + include/Makefile.in | 1 + include/linux/Makefile.in | 1 + include/linux/vfs_compat.h | 10 ++ include/sys/Makefile.in | 1 + include/sys/fm/Makefile.in | 1 + include/sys/fm/fs/Makefile.in | 1 + include/sys/fs/Makefile.in | 1 + lib/Makefile.in | 1 + lib/libavl/Makefile.in | 1 + lib/libefi/Makefile.in | 1 + lib/libnvpair/Makefile.in | 1 + lib/libshare/Makefile.in | 1 + lib/libspl/Makefile.in | 1 + lib/libspl/asm-generic/Makefile.in | 1 + lib/libspl/asm-i386/Makefile.in | 1 + lib/libspl/asm-x86_64/Makefile.in | 1 + lib/libspl/include/Makefile.in | 1 + lib/libspl/include/ia32/Makefile.in | 1 + lib/libspl/include/ia32/sys/Makefile.in | 1 + lib/libspl/include/rpc/Makefile.in | 1 + lib/libspl/include/sys/Makefile.in | 1 + lib/libspl/include/sys/dktp/Makefile.in | 1 + lib/libspl/include/sys/sysevent/Makefile.in | 1 + lib/libspl/include/util/Makefile.in | 1 + lib/libunicode/Makefile.in | 1 + lib/libuutil/Makefile.in | 1 + lib/libzfs/Makefile.in | 1 + lib/libzpool/Makefile.in | 1 + man/Makefile.in | 1 + man/man5/Makefile.in | 1 + man/man8/Makefile.in | 1 + module/zfs/zpl_super.c | 15 ++- scripts/Makefile.in | 1 + scripts/zpios-profile/Makefile.in | 1 + scripts/zpios-test/Makefile.in | 1 + scripts/zpool-config/Makefile.in | 1 + scripts/zpool-layout/Makefile.in | 1 + udev/Makefile.in | 1 + udev/rules.d/Makefile.in | 1 + zfs_config.h.in | 3 + 61 files changed, 214 insertions(+), 5 deletions(-) create mode 100644 config/kernel-clear-inode.m4 diff --git a/Makefile.in b/Makefile.in index 1b3cf4a888..060299b7f7 100644 --- a/Makefile.in +++ b/Makefile.in @@ -87,6 +87,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/cmd/Makefile.in b/cmd/Makefile.in index 91b580d46e..bd03b3558b 100644 --- a/cmd/Makefile.in +++ b/cmd/Makefile.in @@ -64,6 +64,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/cmd/mount_zfs/Makefile.in b/cmd/mount_zfs/Makefile.in index 02ad8bb7a3..0a6ca2e09a 100644 --- a/cmd/mount_zfs/Makefile.in +++ b/cmd/mount_zfs/Makefile.in @@ -67,6 +67,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/cmd/vdev_id/Makefile.in b/cmd/vdev_id/Makefile.in index 7022207812..4a8ecfd4a0 100644 --- a/cmd/vdev_id/Makefile.in +++ b/cmd/vdev_id/Makefile.in @@ -66,6 +66,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/cmd/zdb/Makefile.in b/cmd/zdb/Makefile.in index 6ec74c8979..6842334f55 100644 --- a/cmd/zdb/Makefile.in +++ b/cmd/zdb/Makefile.in @@ -67,6 +67,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/cmd/zfs/Makefile.in b/cmd/zfs/Makefile.in index 7dd2889ba6..582604b694 100644 --- a/cmd/zfs/Makefile.in +++ b/cmd/zfs/Makefile.in @@ -67,6 +67,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/cmd/zinject/Makefile.in b/cmd/zinject/Makefile.in index de34212870..1a8a7837fd 100644 --- a/cmd/zinject/Makefile.in +++ b/cmd/zinject/Makefile.in @@ -67,6 +67,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/cmd/zpios/Makefile.in b/cmd/zpios/Makefile.in index 59aa15557a..6bfb81c9ea 100644 --- a/cmd/zpios/Makefile.in +++ b/cmd/zpios/Makefile.in @@ -67,6 +67,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/cmd/zpool/Makefile.in b/cmd/zpool/Makefile.in index 320ae0f898..9ac1d2e77c 100644 --- a/cmd/zpool/Makefile.in +++ b/cmd/zpool/Makefile.in @@ -67,6 +67,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/cmd/zpool_id/Makefile.in b/cmd/zpool_id/Makefile.in index 1ec069ebaf..67812174f5 100644 --- a/cmd/zpool_id/Makefile.in +++ b/cmd/zpool_id/Makefile.in @@ -66,6 +66,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/cmd/zpool_layout/Makefile.in b/cmd/zpool_layout/Makefile.in index 24f1b275b3..c6a2f0db4a 100644 --- a/cmd/zpool_layout/Makefile.in +++ b/cmd/zpool_layout/Makefile.in @@ -66,6 +66,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/cmd/ztest/Makefile.in b/cmd/ztest/Makefile.in index 06cf365de0..2dbdfd4d7e 100644 --- a/cmd/ztest/Makefile.in +++ b/cmd/ztest/Makefile.in @@ -67,6 +67,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/cmd/zvol_id/Makefile.in b/cmd/zvol_id/Makefile.in index 4c27c8711b..d16e5b75cd 100644 --- a/cmd/zvol_id/Makefile.in +++ b/cmd/zvol_id/Makefile.in @@ -67,6 +67,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/config/kernel-clear-inode.m4 b/config/kernel-clear-inode.m4 new file mode 100644 index 0000000000..e3eace2b26 --- /dev/null +++ b/config/kernel-clear-inode.m4 @@ -0,0 +1,29 @@ +dnl # +dnl # 3.5.0 API change +dnl # torvalds/linux@dbd5768f87ff6fb0a4fe09c4d7b6c4a24de99430 and +dnl # torvalds/linux@7994e6f7254354e03028a11f98a27bd67dace9f1 reworked +dnl # where inode_sync_wait() is called. +dnl # +dnl # Prior to these changes it would occur in end_writeback() but due +dnl # to various issues (described in the above commits) it has been +dnl # moved to evict(). This changes the ordering is which sync occurs +dnl # but otherwise doesn't impact the zpl implementation. +dnl # +dnl # The major impact here is the renaming of end_writeback() to +dnl # clear_inode(). However, care must be taken when detecting this +dnl # API change because as recently as 2.6.35 there was a clear_inode() +dnl # function. However, it was made obsolete by the evict_inode() API +dnl # change at the same time. +dnl # +dnl # Therefore, to ensure we have the correct API we only allow the +dnl # clear_inode() compatibility code to be defined iff the evict_inode() +dnl # functionality is also detected. +dnl # +AC_DEFUN([ZFS_AC_KERNEL_CLEAR_INODE], [ + ZFS_CHECK_SYMBOL_EXPORT( + [clear_inode], + [fs/inode.c], + [AC_DEFINE(HAVE_CLEAR_INODE, 1, + [clear_inode() is available])], + []) +]) diff --git a/config/kernel.m4 b/config/kernel.m4 index 55609cdf13..c65c58cc0f 100644 --- a/config/kernel.m4 +++ b/config/kernel.m4 @@ -51,6 +51,7 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [ ZFS_AC_KERNEL_CREATE_UMODE_T ZFS_AC_KERNEL_AUTOMOUNT ZFS_AC_KERNEL_ENCODE_FH_WITH_INODE + ZFS_AC_KERNEL_CLEAR_INODE ZFS_AC_KERNEL_INSERT_INODE_LOCKED ZFS_AC_KERNEL_D_MAKE_ROOT ZFS_AC_KERNEL_D_OBTAIN_ALIAS diff --git a/configure b/configure index 7c6890bd7c..22687f5197 100755 --- a/configure +++ b/configure @@ -16410,6 +16410,59 @@ fi + { $as_echo "$as_me:$LINENO: checking whether symbol clear_inode is exported" >&5 +$as_echo_n "checking whether symbol clear_inode is exported... " >&6; } + grep -q -E '[[:space:]]clear_inode[[:space:]]' \ + $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null + rc=$? + if test $rc -ne 0; then + + export=0 + for file in fs/inode.c; do + grep -q -E "EXPORT_SYMBOL.*(clear_inode)" "$LINUX/$file" 2>/dev/null + rc=$? + if test $rc -eq 0; then + + export=1 + break; + +fi + + done + if test $export -eq 0; then + + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + + +else + + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + +cat >>confdefs.h <<\_ACEOF +#define HAVE_CLEAR_INODE 1 +_ACEOF + + +fi + + +else + + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + +cat >>confdefs.h <<\_ACEOF +#define HAVE_CLEAR_INODE 1 +_ACEOF + + +fi + + + + { $as_echo "$as_me:$LINENO: checking whether symbol insert_inode_locked is exported" >&5 $as_echo_n "checking whether symbol insert_inode_locked is exported... " >&6; } grep -q -E '[[:space:]]insert_inode_locked[[:space:]]' \ @@ -23076,6 +23129,59 @@ fi + { $as_echo "$as_me:$LINENO: checking whether symbol clear_inode is exported" >&5 +$as_echo_n "checking whether symbol clear_inode is exported... " >&6; } + grep -q -E '[[:space:]]clear_inode[[:space:]]' \ + $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null + rc=$? + if test $rc -ne 0; then + + export=0 + for file in fs/inode.c; do + grep -q -E "EXPORT_SYMBOL.*(clear_inode)" "$LINUX/$file" 2>/dev/null + rc=$? + if test $rc -eq 0; then + + export=1 + break; + +fi + + done + if test $export -eq 0; then + + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + + +else + + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + +cat >>confdefs.h <<\_ACEOF +#define HAVE_CLEAR_INODE 1 +_ACEOF + + +fi + + +else + + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + +cat >>confdefs.h <<\_ACEOF +#define HAVE_CLEAR_INODE 1 +_ACEOF + + +fi + + + + { $as_echo "$as_me:$LINENO: checking whether symbol insert_inode_locked is exported" >&5 $as_echo_n "checking whether symbol insert_inode_locked is exported... " >&6; } grep -q -E '[[:space:]]insert_inode_locked[[:space:]]' \ diff --git a/dracut/90zfs/Makefile.in b/dracut/90zfs/Makefile.in index 9d2d3b0c87..956e458606 100644 --- a/dracut/90zfs/Makefile.in +++ b/dracut/90zfs/Makefile.in @@ -65,6 +65,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/dracut/Makefile.in b/dracut/Makefile.in index 9e1d6e1cce..0e98a6ca97 100644 --- a/dracut/Makefile.in +++ b/dracut/Makefile.in @@ -64,6 +64,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/etc/Makefile.in b/etc/Makefile.in index 5aa22229db..850bff29c0 100644 --- a/etc/Makefile.in +++ b/etc/Makefile.in @@ -64,6 +64,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/etc/init.d/Makefile.in b/etc/init.d/Makefile.in index f3bf8760b8..0ddd918ee5 100644 --- a/etc/init.d/Makefile.in +++ b/etc/init.d/Makefile.in @@ -65,6 +65,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/etc/zfs/Makefile.in b/etc/zfs/Makefile.in index 755736ba12..b9fbd17275 100644 --- a/etc/zfs/Makefile.in +++ b/etc/zfs/Makefile.in @@ -65,6 +65,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/include/Makefile.in b/include/Makefile.in index 0eae5fb432..4bacc977d9 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -66,6 +66,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/include/linux/Makefile.in b/include/linux/Makefile.in index f4fe8f60c8..cdf0e1c62f 100644 --- a/include/linux/Makefile.in +++ b/include/linux/Makefile.in @@ -66,6 +66,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/include/linux/vfs_compat.h b/include/linux/vfs_compat.h index 74ec95f086..9343f99a5a 100644 --- a/include/linux/vfs_compat.h +++ b/include/linux/vfs_compat.h @@ -121,4 +121,14 @@ typedef umode_t zpl_umode_t; typedef int zpl_umode_t; #endif +/* + * 3.5 API change, + * The clear_inode() function replaces end_writeback() and introduces an + * ordering change regarding when the inode_sync_wait() occurs. See the + * configure check in config/kernel-clear-inode.m4 for full details. + */ +#if defined(HAVE_EVICT_INODE) && !defined(HAVE_CLEAR_INODE) +#define clear_inode(ip) end_writeback(ip) +#endif /* HAVE_EVICT_INODE && !HAVE_CLEAR_INODE */ + #endif /* _ZFS_VFS_H */ diff --git a/include/sys/Makefile.in b/include/sys/Makefile.in index b86bfd8cb8..e6e880bab0 100644 --- a/include/sys/Makefile.in +++ b/include/sys/Makefile.in @@ -66,6 +66,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/include/sys/fm/Makefile.in b/include/sys/fm/Makefile.in index 349f9a5519..9d2aff60b7 100644 --- a/include/sys/fm/Makefile.in +++ b/include/sys/fm/Makefile.in @@ -66,6 +66,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/include/sys/fm/fs/Makefile.in b/include/sys/fm/fs/Makefile.in index 810a599831..feac8f9fb2 100644 --- a/include/sys/fm/fs/Makefile.in +++ b/include/sys/fm/fs/Makefile.in @@ -66,6 +66,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/include/sys/fs/Makefile.in b/include/sys/fs/Makefile.in index 137f73e24c..c1bff97bbd 100644 --- a/include/sys/fs/Makefile.in +++ b/include/sys/fs/Makefile.in @@ -66,6 +66,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/lib/Makefile.in b/lib/Makefile.in index 9957fbc178..87dfb2fbaf 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -64,6 +64,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/lib/libavl/Makefile.in b/lib/libavl/Makefile.in index 9e2c62238c..26dacbec95 100644 --- a/lib/libavl/Makefile.in +++ b/lib/libavl/Makefile.in @@ -66,6 +66,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/lib/libefi/Makefile.in b/lib/libefi/Makefile.in index f9dc1ea7c3..e9b8f95591 100644 --- a/lib/libefi/Makefile.in +++ b/lib/libefi/Makefile.in @@ -66,6 +66,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/lib/libnvpair/Makefile.in b/lib/libnvpair/Makefile.in index 1a5843c1f6..0f36765c12 100644 --- a/lib/libnvpair/Makefile.in +++ b/lib/libnvpair/Makefile.in @@ -66,6 +66,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/lib/libshare/Makefile.in b/lib/libshare/Makefile.in index 0949b08d8b..811b05101d 100644 --- a/lib/libshare/Makefile.in +++ b/lib/libshare/Makefile.in @@ -66,6 +66,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/lib/libspl/Makefile.in b/lib/libspl/Makefile.in index 286ddb3926..88ded3bb94 100644 --- a/lib/libspl/Makefile.in +++ b/lib/libspl/Makefile.in @@ -66,6 +66,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/lib/libspl/asm-generic/Makefile.in b/lib/libspl/asm-generic/Makefile.in index c00266d730..b8ba11408f 100644 --- a/lib/libspl/asm-generic/Makefile.in +++ b/lib/libspl/asm-generic/Makefile.in @@ -65,6 +65,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/lib/libspl/asm-i386/Makefile.in b/lib/libspl/asm-i386/Makefile.in index 3efb3d275c..7cd6977b2e 100644 --- a/lib/libspl/asm-i386/Makefile.in +++ b/lib/libspl/asm-i386/Makefile.in @@ -66,6 +66,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/lib/libspl/asm-x86_64/Makefile.in b/lib/libspl/asm-x86_64/Makefile.in index c0ff5963f3..083fee5d50 100644 --- a/lib/libspl/asm-x86_64/Makefile.in +++ b/lib/libspl/asm-x86_64/Makefile.in @@ -66,6 +66,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/lib/libspl/include/Makefile.in b/lib/libspl/include/Makefile.in index 02c0a0dd21..0c6fdcf69d 100644 --- a/lib/libspl/include/Makefile.in +++ b/lib/libspl/include/Makefile.in @@ -66,6 +66,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/lib/libspl/include/ia32/Makefile.in b/lib/libspl/include/ia32/Makefile.in index 82e9617f82..02186ac393 100644 --- a/lib/libspl/include/ia32/Makefile.in +++ b/lib/libspl/include/ia32/Makefile.in @@ -64,6 +64,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/lib/libspl/include/ia32/sys/Makefile.in b/lib/libspl/include/ia32/sys/Makefile.in index 1d73388d76..f9e0236bc2 100644 --- a/lib/libspl/include/ia32/sys/Makefile.in +++ b/lib/libspl/include/ia32/sys/Makefile.in @@ -66,6 +66,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/lib/libspl/include/rpc/Makefile.in b/lib/libspl/include/rpc/Makefile.in index aca26057f6..b601bc1250 100644 --- a/lib/libspl/include/rpc/Makefile.in +++ b/lib/libspl/include/rpc/Makefile.in @@ -66,6 +66,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/lib/libspl/include/sys/Makefile.in b/lib/libspl/include/sys/Makefile.in index d29cd2f74a..8258f0fe02 100644 --- a/lib/libspl/include/sys/Makefile.in +++ b/lib/libspl/include/sys/Makefile.in @@ -66,6 +66,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/lib/libspl/include/sys/dktp/Makefile.in b/lib/libspl/include/sys/dktp/Makefile.in index 787b28b2ae..9ea3a27c20 100644 --- a/lib/libspl/include/sys/dktp/Makefile.in +++ b/lib/libspl/include/sys/dktp/Makefile.in @@ -66,6 +66,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/lib/libspl/include/sys/sysevent/Makefile.in b/lib/libspl/include/sys/sysevent/Makefile.in index 780b9d8260..62b8761370 100644 --- a/lib/libspl/include/sys/sysevent/Makefile.in +++ b/lib/libspl/include/sys/sysevent/Makefile.in @@ -66,6 +66,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/lib/libspl/include/util/Makefile.in b/lib/libspl/include/util/Makefile.in index 205bfd7b68..cf37f1639e 100644 --- a/lib/libspl/include/util/Makefile.in +++ b/lib/libspl/include/util/Makefile.in @@ -66,6 +66,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/lib/libunicode/Makefile.in b/lib/libunicode/Makefile.in index e6cf844abd..4ca9682412 100644 --- a/lib/libunicode/Makefile.in +++ b/lib/libunicode/Makefile.in @@ -66,6 +66,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/lib/libuutil/Makefile.in b/lib/libuutil/Makefile.in index c0cf1ff986..a90c890cb5 100644 --- a/lib/libuutil/Makefile.in +++ b/lib/libuutil/Makefile.in @@ -66,6 +66,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/lib/libzfs/Makefile.in b/lib/libzfs/Makefile.in index 0bd4d17d66..e05a8a4fe3 100644 --- a/lib/libzfs/Makefile.in +++ b/lib/libzfs/Makefile.in @@ -66,6 +66,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/lib/libzpool/Makefile.in b/lib/libzpool/Makefile.in index c57bdfebff..a94b7e1cd2 100644 --- a/lib/libzpool/Makefile.in +++ b/lib/libzpool/Makefile.in @@ -66,6 +66,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/man/Makefile.in b/man/Makefile.in index 10a9daf8a7..1996ca2e5c 100644 --- a/man/Makefile.in +++ b/man/Makefile.in @@ -64,6 +64,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/man/man5/Makefile.in b/man/man5/Makefile.in index 2dc5ba77bc..b0346ccfed 100644 --- a/man/man5/Makefile.in +++ b/man/man5/Makefile.in @@ -64,6 +64,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/man/man8/Makefile.in b/man/man8/Makefile.in index 127f8405b6..c918944247 100644 --- a/man/man8/Makefile.in +++ b/man/man8/Makefile.in @@ -64,6 +64,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/module/zfs/zpl_super.c b/module/zfs/zpl_super.c index 98d0a03127..29d7f7dfbb 100644 --- a/module/zfs/zpl_super.c +++ b/module/zfs/zpl_super.c @@ -64,10 +64,15 @@ zpl_inode_destroy(struct inode *ip) * This elaborate mechanism was replaced by ->evict_inode() which * does the job of both ->delete_inode() and ->clear_inode(). It * will be called exactly once, and when it returns the inode must - * be in a state where it can simply be freed. The ->evict_inode() - * callback must minimally truncate the inode pages, and call - * end_writeback() to complete all outstanding writeback for the - * inode. After this is complete evict inode can cleanup any + * be in a state where it can simply be freed.i + * + * The ->evict_inode() callback must minimally truncate the inode pages, + * and call clear_inode(). For 2.6.35 and later kernels this will + * simply update the inode state, with the sync occurring before the + * truncate in evict(). For earlier kernels clear_inode() maps to + * end_writeback() which is responsible for completing all outstanding + * write back. In either case, once this is done it is safe to cleanup + * any remaining inode specific data via zfs_inactive(). * remaining filesystem specific data. */ #ifdef HAVE_EVICT_INODE @@ -75,7 +80,7 @@ static void zpl_evict_inode(struct inode *ip) { truncate_setsize(ip, 0); - end_writeback(ip); + clear_inode(ip); zfs_inactive(ip); } diff --git a/scripts/Makefile.in b/scripts/Makefile.in index 4e3e31b6c6..3bc46fcbfc 100644 --- a/scripts/Makefile.in +++ b/scripts/Makefile.in @@ -65,6 +65,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/scripts/zpios-profile/Makefile.in b/scripts/zpios-profile/Makefile.in index da5dbf16f7..c51db42367 100644 --- a/scripts/zpios-profile/Makefile.in +++ b/scripts/zpios-profile/Makefile.in @@ -65,6 +65,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/scripts/zpios-test/Makefile.in b/scripts/zpios-test/Makefile.in index 79ed32f400..c05e18b9a4 100644 --- a/scripts/zpios-test/Makefile.in +++ b/scripts/zpios-test/Makefile.in @@ -65,6 +65,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/scripts/zpool-config/Makefile.in b/scripts/zpool-config/Makefile.in index de63817bfb..17043188e0 100644 --- a/scripts/zpool-config/Makefile.in +++ b/scripts/zpool-config/Makefile.in @@ -65,6 +65,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/scripts/zpool-layout/Makefile.in b/scripts/zpool-layout/Makefile.in index 890062ef34..1f82746ab7 100644 --- a/scripts/zpool-layout/Makefile.in +++ b/scripts/zpool-layout/Makefile.in @@ -65,6 +65,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/udev/Makefile.in b/udev/Makefile.in index 8c4ea1e6d4..33b2c58525 100644 --- a/udev/Makefile.in +++ b/udev/Makefile.in @@ -64,6 +64,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/udev/rules.d/Makefile.in b/udev/rules.d/Makefile.in index a700205bae..f0c78e091d 100644 --- a/udev/rules.d/Makefile.in +++ b/udev/rules.d/Makefile.in @@ -65,6 +65,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-blkdev-get.m4 \ $(top_srcdir)/config/kernel-check-disk-size-change.m4 \ + $(top_srcdir)/config/kernel-clear-inode.m4 \ $(top_srcdir)/config/kernel-create-umode-t.m4 \ $(top_srcdir)/config/kernel-d-make-root.m4 \ $(top_srcdir)/config/kernel-d-obtain-alias.m4 \ diff --git a/zfs_config.h.in b/zfs_config.h.in index a284126c79..15f5a5cae2 100644 --- a/zfs_config.h.in +++ b/zfs_config.h.in @@ -105,6 +105,9 @@ /* check_disk_size_change() is available */ #undef HAVE_CHECK_DISK_SIZE_CHANGE +/* clear_inode() is available */ +#undef HAVE_CLEAR_INODE + /* super_block uses const struct xattr_hander */ #undef HAVE_CONST_XATTR_HANDLER