Whamcloud - gitweb
LU-5584 llite: call truncate_inode_page_final() in evict_inode 09/12009/3
authorYang Sheng <yang.sheng@intel.com>
Mon, 22 Sep 2014 18:12:11 +0000 (02:12 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 26 Sep 2014 23:05:41 +0000 (23:05 +0000)
In evict_inode we should invoke truncate_inode_pages_final()
as inode will cleanup.

Signed-off-by: Yang Sheng <yang.sheng@intel.com>
Change-Id: Ifba1014cf997475a248bf3d0898ae373bd3a7f9c
Reviewed-on: http://review.whamcloud.com/12009
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/autoconf/lustre-core.m4
lustre/include/linux/lustre_compat25.h
lustre/llite/llite_lib.c

index 3293137..b59aa2e 100644 (file)
@@ -1490,6 +1490,22 @@ have_bvec_iter, [
 ]) # LC_HAVE_BVEC_ITER
 
 #
+# LC_HAVE_TRUNCATE_IPAGE_FINAL
+#
+# 3.14 bring truncate_inode_pages_final for evict_inode
+#
+AC_DEFUN([LC_HAVE_TRUNCATE_IPAGES_FINAL], [
+LB_CHECK_COMPILE([if Linux kernel has truncate_inode_pages_final],
+truncate_ipages_final, [
+       #include <linux/mm.h>
+],[
+       truncate_inode_pages_final(NULL);
+], [
+       AC_DEFINE(HAVE_TRUNCATE_INODE_PAGES_FINAL, 1,
+               [kernel has truncate_inode_pages_final])
+])
+]) # LC_HAVE_TRUNCATE_IPAGES_FINAL
+#
 # LC_VFS_RENAME_6ARGS
 #
 # 3.15 has vfs_rename with 6 args
@@ -1627,6 +1643,7 @@ AC_DEFUN([LC_PROG_LINUX], [
 
        # 3.14
        LC_HAVE_BVEC_ITER
+       LC_HAVE_TRUNCATE_IPAGES_FINAL
 
        # 3.15
        LC_VFS_RENAME_6ARGS
index 79c6db0..e2e46f9 100644 (file)
@@ -367,6 +367,10 @@ static inline int radix_tree_exceptional_entry(void *arg)
 }
 #endif
 
+#ifndef HAVE_TRUNCATE_INODE_PAGES_FINAL
+# define truncate_inode_pages_final(map) truncate_inode_pages(map, 0)
+#endif
+
 #ifndef SIZE_MAX
 #define SIZE_MAX       (~(size_t)0)
 #endif
index a398c1b..3d1c9a3 100644 (file)
@@ -2168,7 +2168,7 @@ void ll_delete_inode(struct inode *inode)
                cl_sync_file_range(inode, 0, OBD_OBJECT_EOF,
                                   CL_FSYNC_DISCARD, 1);
 
-        truncate_inode_pages(&inode->i_data, 0);
+       truncate_inode_pages_final(&inode->i_data);
 
         /* Workaround for LU-118 */
         if (inode->i_data.nrpages) {