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>
])
#
+# 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],
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
}
/* Workaround end */
+#ifdef HAVE_SBOPS_EVICT_INODE
+ ll_clear_inode(inode);
+ end_writeback(inode);
+#else
clear_inode(inode);
+#endif
EXIT;
}
{
.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,