From 93d1c2d39fd9bf5eedf577a3667dff2618efba8f Mon Sep 17 00:00:00 2001 From: Swapnil Pimpale Date: Thu, 26 Dec 2013 16:07:43 +0530 Subject: [PATCH] LU-3831 llite: Remove touch_atime() call in ll_readdir() In 2.6.32 vfs_readdir() calls file_accessed() which checks for O_NOATIME and calls touch_atime() appropriately. In 3.11, the same is true of iterate_dir(). Hence removed the call to touch_atime() in ll_readdir(). Also, removed the HAVE_TOUCH_ATIME_1ARG and HAVE_F_PATH_MNT autocrud since ll_readdir() was the last caller of touch_atime() in the lustre tree. Signed-off-by: Swapnil Pimpale Change-Id: Iedd3be29adae80427d71a7eb5a0f8c0d1f1d2924 Reviewed-on: http://review.whamcloud.com/8664 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Lai Siyao Reviewed-by: Yang Sheng Reviewed-by: Oleg Drokin --- lustre/autoconf/lustre-core.m4 | 43 ------------------------------------------ lustre/llite/dir.c | 14 -------------- 2 files changed, 57 deletions(-) diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index e6207c9..1d964cb 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -1021,25 +1021,6 @@ LB_LINUX_TRY_COMPILE([ ]) # -# 3.4 switchs touch_atime to struct path -# see kernel commit 68ac1234fb949b66941d94dce4157742799fc581 -# -AC_DEFUN([LC_TOUCH_ATIME_1ARG], -[AC_MSG_CHECKING([if touch_atime use one argument]) -LB_LINUX_TRY_COMPILE([ - #include -],[ - touch_atime((struct path *)NULL); -],[ - AC_DEFINE(HAVE_TOUCH_ATIME_1ARG, 1, - [touch_atime use one argument]) - AC_MSG_RESULT([yes]) -],[ - AC_MSG_RESULT([no]) -]) -]) - -# # 3.4 converts d_alloc_root to d_make_root # see kernel commit 32991ab305ace7017c62f8eecbe5eb36dc32e13b # @@ -1291,28 +1272,6 @@ LB_LINUX_TRY_COMPILE([ ]) # -# 3.9 killed f_vfsmnt by -# 182be684784334598eee1d90274e7f7aa0063616 -# replacement is f_path.mnt -# -AC_DEFUN([LC_HAVE_F_PATH_MNT], -[AC_MSG_CHECKING([if struct file has f_path.mnt]) -LB_LINUX_TRY_COMPILE([ - #include -],[ - struct file *fp = NULL; - struct path path; - - path.mnt = fp->f_path.mnt; -],[ - AC_DEFINE(HAVE_F_PATH_MNT,1,[yes]) - AC_MSG_RESULT([yes]) -],[ - AC_MSG_RESULT([no]) -]) -]) - -# # 3.10+ only supports procfs seq_files handling # AC_DEFUN([LC_HAVE_ONLY_PROCFS_SEQ], @@ -1493,7 +1452,6 @@ AC_DEFUN([LC_PROG_LINUX], LC_HAVE_CACHE_REGISTER # 3.4 - LC_TOUCH_ATIME_1ARG LC_HAVE_D_MAKE_ROOT LC_KMAP_ATOMIC_HAS_1ARG @@ -1516,7 +1474,6 @@ AC_DEFUN([LC_PROG_LINUX], # 3.9 LC_HAVE_HLIST_FOR_EACH_3ARG - LC_HAVE_F_PATH_MNT # 3.10 LC_HAVE_ONLY_PROCFS_SEQ diff --git a/lustre/llite/dir.c b/lustre/llite/dir.c index 27f23e4..136b9b3 100644 --- a/lustre/llite/dir.c +++ b/lustre/llite/dir.c @@ -278,9 +278,6 @@ static int ll_readdir(struct file *filp, void *cookie, filldir_t filldir) struct md_op_data *op_data; __u64 pos; int rc; -#ifdef HAVE_TOUCH_ATIME_1ARG - struct path path; -#endif ENTRY; if (lfd != NULL) @@ -323,17 +320,6 @@ static int ll_readdir(struct file *filp, void *cookie, filldir_t filldir) ll_finish_md_op_data(op_data); filp->f_version = inode->i_version; -#ifdef HAVE_TOUCH_ATIME_1ARG -#ifdef HAVE_F_PATH_MNT - path.mnt = filp->f_path.mnt; -#else - path.mnt = filp->f_vfsmnt; -#endif - path.dentry = filp->f_dentry; - touch_atime(&path); -#else - touch_atime(filp->f_vfsmnt, filp->f_dentry); -#endif out: if (!rc) -- 1.8.3.1