Whamcloud - gitweb
LU-506 kernel: FC15 - super_operations add evict_inode method.
authoryangsheng <ys@whamcloud.com>
Wed, 31 Aug 2011 18:28:56 +0000 (02:28 +0800)
committerOleg Drokin <green@whamcloud.com>
Thu, 29 Dec 2011 15:45:53 +0000 (10:45 -0500)
super_operations add a new method evict_inode(), it hybird of
delete_inode() and clear_inode().

Change-Id: Ifa6de3bca16294386f33404b5a42ff749e1d0665
Signed-off-by: Yang Sheng <ys@whamcloud.com>
Reviewed-on: http://review.whamcloud.com/1844
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Tested-by: Hudson
Reviewed-by: Lai Siyao <laisiyao@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/autoconf/lustre-core.m4
lustre/llite/llite_lib.c
lustre/llite/super25.c

index 2611478..455ec77 100644 (file)
@@ -2103,6 +2103,25 @@ LB_LINUX_TRY_COMPILE([
 ])
 
 #
+# 2.6.36 super_operations add evict_inode method. it hybird of
+# delete_inode & clear_inode.
+#
+AC_DEFUN([LC_SBOPS_EVICT_INODE],
+[AC_MSG_CHECKING([if super_operations.evict_inode exist])
+LB_LINUX_TRY_COMPILE([
+        #include <linux/fs.h>
+],[
+        ((struct super_operations *)0)->evict_inode(NULL);
+],[
+        AC_DEFINE(HAVE_SBOPS_EVICT_INODE, 1,
+                [super_operations.evict_inode() is exist in kernel])
+        AC_MSG_RESULT([yes])
+],[
+        AC_MSG_RESULT([no])
+])
+])
+
+#
 # 2.6.38 export blkdev_get_by_dev
 #
 AC_DEFUN([LC_BLKDEV_GET_BY_DEV],
@@ -2308,6 +2327,9 @@ AC_DEFUN([LC_PROG_LINUX],
          LC_BLK_QUEUE_MAX_SEGMENTS
          LC_SET_CPUS_ALLOWED
 
+         # 2.6.36
+         LC_SBOPS_EVICT_INODE
+
          # 2.6.38
          LC_BLKDEV_GET_BY_DEV
          LC_GENERIC_PERMISSION
index 713d581..6bcc212 100644 (file)
@@ -1797,7 +1797,12 @@ void ll_delete_inode(struct inode *inode)
         }
         /* Workaround end */
 
+#ifdef HAVE_SBOPS_EVICT_INODE
+        ll_clear_inode(inode);
+        end_writeback(inode);
+#else
         clear_inode(inode);
+#endif
 
         EXIT;
 }
index 5f27094..1e426d4 100644 (file)
@@ -92,8 +92,12 @@ struct super_operations lustre_super_operations =
 {
         .alloc_inode   = ll_alloc_inode,
         .destroy_inode = ll_destroy_inode,
+#ifdef HAVE_SBOPS_EVICT_INODE
+        .evict_inode   = ll_delete_inode,
+#else
         .clear_inode   = ll_clear_inode,
         .delete_inode  = ll_delete_inode,
+#endif
         .put_super     = ll_put_super,
         .statfs        = ll_statfs,
         .umount_begin  = ll_umount_begin,