Whamcloud - gitweb
LU-3831 llite: Remove touch_atime() call in ll_readdir() 64/8664/4
authorSwapnil Pimpale <spimpale@ddn.com>
Thu, 26 Dec 2013 10:37:43 +0000 (16:07 +0530)
committerOleg Drokin <oleg.drokin@intel.com>
Sat, 1 Mar 2014 02:22:21 +0000 (02:22 +0000)
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 <spimpale@ddn.com>
Change-Id: Iedd3be29adae80427d71a7eb5a0f8c0d1f1d2924
Reviewed-on: http://review.whamcloud.com/8664
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Yang Sheng <yang.sheng@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/autoconf/lustre-core.m4
lustre/llite/dir.c

index e6207c9..1d964cb 100644 (file)
@@ -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 <linux/fs.h>
-],[
-       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
 #
 # 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 <linux/fs.h>
-],[
-       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],
 # 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_HAVE_CACHE_REGISTER
 
         # 3.4
-        LC_TOUCH_ATIME_1ARG
         LC_HAVE_D_MAKE_ROOT
         LC_KMAP_ATOMIC_HAS_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
 
         # 3.9
         LC_HAVE_HLIST_FOR_EACH_3ARG
-        LC_HAVE_F_PATH_MNT
 
         # 3.10
         LC_HAVE_ONLY_PROCFS_SEQ
 
         # 3.10
         LC_HAVE_ONLY_PROCFS_SEQ
index 27f23e4..136b9b3 100644 (file)
@@ -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;
        struct md_op_data       *op_data;
        __u64                   pos;
        int                     rc;
-#ifdef HAVE_TOUCH_ATIME_1ARG
-       struct path             path;
-#endif
        ENTRY;
 
        if (lfd != NULL)
        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;
 
        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)
 
 out:
        if (!rc)