From baf067a765ba658ea16e8f81909d6a364a6f5b18 Mon Sep 17 00:00:00 2001 From: Peng Tao Date: Mon, 23 Jan 2012 11:05:34 +0800 Subject: [PATCH] LU-709 build: clean up HAVE_CAN_SLEEP_ARG and HAVE_F_OP_FLOCK 1. flock_lock_file_wait only has two arguments ever since v2.6.12 2. file_operations.flock exists since v2.6.12 Signed-off-by: Peng Tao Change-Id: I92406f1042dab71ade780b02500fba4404a56a2b Reviewed-on: http://review.whamcloud.com/2315 Tested-by: Hudson Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/autoconf/lustre-core.m4 | 46 ---------------------------------- lustre/include/linux/lustre_compat25.h | 8 ------ lustre/llite/file.c | 8 +----- 3 files changed, 1 insertion(+), 61 deletions(-) diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index 5e4f034..eec0990 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -474,50 +474,6 @@ AC_DEFUN([LC_CONFIG_GSS], fi ]) -# -# LC_FUNC_HAVE_CAN_SLEEP_ARG -# -# 2.6.5 kernel has third arg can_sleep in fs/locks.c: flock_lock_file_wait() -# -AC_DEFUN([LC_FUNC_HAVE_CAN_SLEEP_ARG], -[AC_MSG_CHECKING([if kernel has third arg can_sleep in fs/locks.c: flock_lock_file_wait()]) -LB_LINUX_TRY_COMPILE([ - #include -],[ - int cansleep; - struct file *file; - struct file_lock *file_lock; - flock_lock_file_wait(file, file_lock, cansleep); -],[ - AC_DEFINE(HAVE_CAN_SLEEP_ARG, 1, - [kernel has third arg can_sleep in fs/locks.c: flock_lock_file_wait()]) - AC_MSG_RESULT([yes]) -],[ - AC_MSG_RESULT([no]) -]) -]) - -# -# LC_FUNC_F_OP_FLOCK -# -# rhel4.2 kernel has f_op->flock field -# -AC_DEFUN([LC_FUNC_F_OP_FLOCK], -[AC_MSG_CHECKING([if struct file_operations has flock field]) -LB_LINUX_TRY_COMPILE([ - #include -],[ - struct file_operations ll_file_operations_flock; - ll_file_operations_flock.flock = NULL; -],[ - AC_DEFINE(HAVE_F_OP_FLOCK, 1, - [struct file_operations has flock field]) - AC_MSG_RESULT([yes]) -],[ - AC_MSG_RESULT([no]) -]) -]) - AC_DEFUN([LC_QUOTA_READ], [AC_MSG_CHECKING([if kernel supports quota_read]) LB_LINUX_TRY_COMPILE([ @@ -2043,8 +1999,6 @@ AC_DEFUN([LC_PROG_LINUX], LC_CAPA_CRYPTO LC_CONFIG_RMTCLIENT LC_CONFIG_GSS - LC_FUNC_HAVE_CAN_SLEEP_ARG - LC_FUNC_F_OP_FLOCK LC_QUOTA_READ LC_COOKIE_FOLLOW_LINK LC_FUNC_RCU diff --git a/lustre/include/linux/lustre_compat25.h b/lustre/include/linux/lustre_compat25.h index 8e07133..0a97aa1 100644 --- a/lustre/include/linux/lustre_compat25.h +++ b/lustre/include/linux/lustre_compat25.h @@ -265,14 +265,6 @@ static inline int cfs_cleanup_group_info(void) extern void __d_rehash(struct dentry *dentry, int lock); #endif -#ifdef HAVE_CAN_SLEEP_ARG -#define ll_flock_lock_file_wait(file, lock, can_sleep) \ - flock_lock_file_wait(file, lock, can_sleep) -#else -#define ll_flock_lock_file_wait(file, lock, can_sleep) \ - flock_lock_file_wait(file, lock) -#endif - #define CheckWriteback(page, cmd) \ ((!PageWriteback(page) && (cmd & OBD_BRW_READ)) || \ (PageWriteback(page) && (cmd & OBD_BRW_WRITE))) diff --git a/lustre/llite/file.c b/lustre/llite/file.c index 3027d1d..0c6b792 100644 --- a/lustre/llite/file.c +++ b/lustre/llite/file.c @@ -2180,13 +2180,11 @@ int ll_file_flock(struct file *file, int cmd, struct file_lock *file_lock) if ((file_lock->fl_flags & FL_FLOCK) && (rc == 0 || file_lock->fl_type == F_UNLCK)) - ll_flock_lock_file_wait(file, file_lock, (cmd == F_SETLKW)); -#ifdef HAVE_F_OP_FLOCK + flock_lock_file_wait(file, file_lock); if ((file_lock->fl_flags & FL_POSIX) && (rc == 0 || file_lock->fl_type == F_UNLCK) && !(flags & LDLM_FL_TEST_LOCK)) posix_lock_file_wait(file, file_lock); -#endif RETURN(rc); } @@ -2630,9 +2628,7 @@ struct file_operations ll_file_operations_flock = { #endif .fsync = ll_fsync, .flush = ll_flush, -#ifdef HAVE_F_OP_FLOCK .flock = ll_file_flock, -#endif .lock = ll_file_flock }; @@ -2659,9 +2655,7 @@ struct file_operations ll_file_operations_noflock = { #endif .fsync = ll_fsync, .flush = ll_flush, -#ifdef HAVE_F_OP_FLOCK .flock = ll_file_noflock, -#endif .lock = ll_file_noflock }; -- 1.8.3.1