From: yangsheng Date: Wed, 31 Aug 2011 18:28:56 +0000 (+0800) Subject: LU-506 kernel: FC15 - super_operations add evict_inode method. X-Git-Tag: 2.1.53~4 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=f7c68d305568873509766b3aff46e11ce3922d6f LU-506 kernel: FC15 - super_operations add evict_inode method. super_operations add a new method evict_inode(), it hybird of delete_inode() and clear_inode(). Change-Id: Ifa6de3bca16294386f33404b5a42ff749e1d0665 Signed-off-by: Yang Sheng Reviewed-on: http://review.whamcloud.com/1844 Reviewed-by: Andreas Dilger Tested-by: Maloo Tested-by: Hudson Reviewed-by: Lai Siyao Reviewed-by: Oleg Drokin --- diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index 2611478..455ec77 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -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 +],[ + ((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 diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index 713d581..6bcc212 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -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; } diff --git a/lustre/llite/super25.c b/lustre/llite/super25.c index 5f27094..1e426d4 100644 --- a/lustre/llite/super25.c +++ b/lustre/llite/super25.c @@ -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,