switch touch_atime to struct path
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 15 Mar 2012 12:21:57 +0000 (08:21 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 21 Mar 2012 01:29:41 +0000 (21:29 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/cachefiles/namei.c
fs/ecryptfs/file.c
fs/inode.c
fs/namei.c
fs/nfsd/vfs.c
fs/stat.c
include/linux/fs.h
net/unix/af_unix.c

index a0358c2189cb5aba26de002d93727dedd5b7a3fe..7f0771d3894e7a17bbd01ec1bf9fc8c988918d08 100644 (file)
@@ -646,7 +646,8 @@ lookup_again:
                 * (this is used to keep track of culling, and atimes are only
                 * updated by read, write and readdir but not lookup or
                 * open) */
-               touch_atime(cache->mnt, next);
+               path.dentry = next;
+               touch_atime(&path);
        }
 
        /* open a file interface onto a data file */
index d3f95f941c47e68a1d0a2cbe60371f148d64e124..2b17f2f9b121d0ee89e7d00cb1e93d7f9cf9dca4 100644 (file)
@@ -48,8 +48,7 @@ static ssize_t ecryptfs_read_update_atime(struct kiocb *iocb,
                                unsigned long nr_segs, loff_t pos)
 {
        ssize_t rc;
-       struct dentry *lower_dentry;
-       struct vfsmount *lower_vfsmount;
+       struct path lower;
        struct file *file = iocb->ki_filp;
 
        rc = generic_file_aio_read(iocb, iov, nr_segs, pos);
@@ -60,9 +59,9 @@ static ssize_t ecryptfs_read_update_atime(struct kiocb *iocb,
        if (-EIOCBQUEUED == rc)
                rc = wait_on_sync_kiocb(iocb);
        if (rc >= 0) {
-               lower_dentry = ecryptfs_dentry_to_lower(file->f_path.dentry);
-               lower_vfsmount = ecryptfs_dentry_to_lower_mnt(file->f_path.dentry);
-               touch_atime(lower_vfsmount, lower_dentry);
+               lower.dentry = ecryptfs_dentry_to_lower(file->f_path.dentry);
+               lower.mnt = ecryptfs_dentry_to_lower_mnt(file->f_path.dentry);
+               touch_atime(&lower);
        }
        return rc;
 }
index 92de04b0baa25f9dd23a96aea5458be0e6a53b76..8b612813a6a74b2eeec407a65998191f5db9e8cf 100644 (file)
@@ -1499,9 +1499,10 @@ static int relatime_need_update(struct vfsmount *mnt, struct inode *inode,
  *     This function automatically handles read only file systems and media,
  *     as well as the "noatime" flag and inode specific "noatime" markers.
  */
-void touch_atime(struct vfsmount *mnt, struct dentry *dentry)
+void touch_atime(struct path *path)
 {
-       struct inode *inode = dentry->d_inode;
+       struct vfsmount *mnt = path->mnt;
+       struct inode *inode = path->dentry->d_inode;
        struct timespec now;
 
        if (inode->i_flags & S_NOATIME)
index a0b82762e8fcc484972f1235dc877a2eede75c19..0ccc74ee92fb659a25414c833fe58904726868df 100644 (file)
@@ -642,7 +642,7 @@ follow_link(struct path *link, struct nameidata *nd, void **p)
        cond_resched();
        current->total_link_count++;
 
-       touch_atime(link->mnt, dentry);
+       touch_atime(link);
        nd_set_link(nd, NULL);
 
        error = security_inode_follow_link(link->dentry, nd);
index edf6d3ed87778822d85c32929cab580c93ed3c7a..e59f71d0cf73d355c5a71bffc1cfc7bf1eb11b02 100644 (file)
@@ -1541,30 +1541,31 @@ do_nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
 __be32
 nfsd_readlink(struct svc_rqst *rqstp, struct svc_fh *fhp, char *buf, int *lenp)
 {
-       struct dentry   *dentry;
        struct inode    *inode;
        mm_segment_t    oldfs;
        __be32          err;
        int             host_err;
+       struct path path;
 
        err = fh_verify(rqstp, fhp, S_IFLNK, NFSD_MAY_NOP);
        if (err)
                goto out;
 
-       dentry = fhp->fh_dentry;
-       inode = dentry->d_inode;
+       path.mnt = fhp->fh_export->ex_path.mnt;
+       path.dentry = fhp->fh_dentry;
+       inode = path.dentry->d_inode;
 
        err = nfserr_inval;
        if (!inode->i_op->readlink)
                goto out;
 
-       touch_atime(fhp->fh_export->ex_path.mnt, dentry);
+       touch_atime(&path);
        /* N.B. Why does this call need a get_fs()??
         * Remove the set_fs and watch the fireworks:-) --okir
         */
 
        oldfs = get_fs(); set_fs(KERNEL_DS);
-       host_err = inode->i_op->readlink(dentry, buf, *lenp);
+       host_err = inode->i_op->readlink(path.dentry, buf, *lenp);
        set_fs(oldfs);
 
        if (host_err < 0)
index 8806b8997d2efcfd73944df9f3695d40207fb6bf..86f13563a463bf4f00b27ae88e43af3019819495 100644 (file)
--- a/fs/stat.c
+++ b/fs/stat.c
@@ -307,7 +307,7 @@ SYSCALL_DEFINE4(readlinkat, int, dfd, const char __user *, pathname,
                if (inode->i_op->readlink) {
                        error = security_inode_readlink(path.dentry);
                        if (!error) {
-                               touch_atime(path.mnt, path.dentry);
+                               touch_atime(&path);
                                error = inode->i_op->readlink(path.dentry,
                                                              buf, bufsiz);
                        }
index b89dc4d60d991bd4ba6099d907eba424e6f28c4a..9bbe1a9ac432d12f78960da276cb4ea197ecd3ae 100644 (file)
@@ -1812,11 +1812,11 @@ static inline void inode_inc_iversion(struct inode *inode)
        spin_unlock(&inode->i_lock);
 }
 
-extern void touch_atime(struct vfsmount *mnt, struct dentry *dentry);
+extern void touch_atime(struct path *);
 static inline void file_accessed(struct file *file)
 {
        if (!(file->f_flags & O_NOATIME))
-               touch_atime(file->f_path.mnt, file->f_path.dentry);
+               touch_atime(&file->f_path);
 }
 
 int sync_inode(struct inode *inode, struct writeback_control *wbc);
index ef4b780ef63df8428c0a70a32544fb145edd6cb4..081679444a6ee7e1b08a63f186233b58faf6e499 100644 (file)
@@ -771,7 +771,7 @@ static struct sock *unix_find_other(struct net *net,
                        goto put_fail;
 
                if (u->sk_type == type)
-                       touch_atime(path.mnt, path.dentry);
+                       touch_atime(&path);
 
                path_put(&path);
 
@@ -787,7 +787,7 @@ static struct sock *unix_find_other(struct net *net,
                        struct dentry *dentry;
                        dentry = unix_sk(u)->path.dentry;
                        if (dentry)
-                               touch_atime(unix_sk(u)->path.mnt, dentry);
+                               touch_atime(&unix_sk(u)->path);
                } else
                        goto fail;
        }