From ff3c1a0c6d43fb210faa5e0705241672e0754ce4 Mon Sep 17 00:00:00 2001 From: yang sheng Date: Thu, 6 Dec 2012 03:38:15 +0800 Subject: [PATCH 1/1] LU-1994 llite: kernel 3.5 renames end_writeback to clear_inode kernel commit dbd5768f8 renames end_writeback to clear_inode, which used to exist for ~2.6.36 kernels. Signed-off-by: Peng Tao Signed-off-by: yang sheng Change-Id: I2435e820092085c0fb55539818f4bad9e48ff386 Reviewed-on: http://review.whamcloud.com/3756 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Yang Sheng Reviewed-by: Andreas Dilger --- lustre/autoconf/lustre-core.m4 | 22 ++++++++++++++++++++++ lustre/include/linux/lustre_compat25.h | 4 ++++ lustre/llite/llite_lib.c | 6 ++---- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index ba2571d..c47dbc4 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -2066,6 +2066,25 @@ LB_LINUX_TRY_COMPILE([ ]) # +# 3.5 renames end_writeback() back to clear_inode()... +# see kernel commit dbd5768f87ff6fb0a4fe09c4d7b6c4a24de99430 +# +AC_DEFUN([LC_HAVE_CLEAR_INODE], +[AC_MSG_CHECKING([if have clear_inode]) +LB_LINUX_TRY_COMPILE([ + #include +],[ + clear_inode((struct inode *)NULL); +],[ + AC_DEFINE(HAVE_CLEAR_INODE, 1, + [have clear_inode]) + AC_MSG_RESULT([yes]) +],[ + AC_MSG_RESULT([no]) +]) +]) + +# # LC_PROG_LINUX # # Lustre linux kernel checks @@ -2230,6 +2249,9 @@ AC_DEFUN([LC_PROG_LINUX], LC_HAVE_D_MAKE_ROOT LC_KMAP_ATOMIC_HAS_1ARG + # 3.5 + LC_HAVE_CLEAR_INODE + # if test x$enable_server = xyes ; then AC_DEFINE(HAVE_SERVER_SUPPORT, 1, [support server]) diff --git a/lustre/include/linux/lustre_compat25.h b/lustre/include/linux/lustre_compat25.h index e5d6622..7cba933 100644 --- a/lustre/include/linux/lustre_compat25.h +++ b/lustre/include/linux/lustre_compat25.h @@ -619,6 +619,10 @@ static inline int ll_quota_off(struct super_block *sb, int off, int remount) #define ll_kunmap_atomic(a, b) kunmap_atomic(a, b) #endif +#ifndef HAVE_CLEAR_INODE +#define clear_inode(i) end_writeback(i) +#endif + #ifndef HAVE_BI_HW_SEGMENTS #define bio_hw_segments(q, bio) 0 diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index e91259c..acdec48 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -1895,11 +1895,9 @@ 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); + ll_clear_inode(inode); #endif + clear_inode(inode); EXIT; } -- 1.8.3.1