diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-03-15 08:21:57 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-03-20 21:29:41 -0400 |
commit | 68ac1234fb949b66941d94dce4157742799fc581 (patch) | |
tree | 04059b7dbaed92d672b8ceef1fcf25c6185e06f8 /fs | |
parent | 40ffe67d2e89c7a475421d007becc11a2f88ea3d (diff) |
switch touch_atime to struct path
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/cachefiles/namei.c | 3 | ||||
-rw-r--r-- | fs/ecryptfs/file.c | 9 | ||||
-rw-r--r-- | fs/inode.c | 5 | ||||
-rw-r--r-- | fs/namei.c | 2 | ||||
-rw-r--r-- | fs/nfsd/vfs.c | 11 | ||||
-rw-r--r-- | fs/stat.c | 2 |
6 files changed, 17 insertions, 15 deletions
diff --git a/fs/cachefiles/namei.c b/fs/cachefiles/namei.c index a0358c2189cb..7f0771d3894e 100644 --- a/fs/cachefiles/namei.c +++ b/fs/cachefiles/namei.c | |||
@@ -646,7 +646,8 @@ lookup_again: | |||
646 | * (this is used to keep track of culling, and atimes are only | 646 | * (this is used to keep track of culling, and atimes are only |
647 | * updated by read, write and readdir but not lookup or | 647 | * updated by read, write and readdir but not lookup or |
648 | * open) */ | 648 | * open) */ |
649 | touch_atime(cache->mnt, next); | 649 | path.dentry = next; |
650 | touch_atime(&path); | ||
650 | } | 651 | } |
651 | 652 | ||
652 | /* open a file interface onto a data file */ | 653 | /* open a file interface onto a data file */ |
diff --git a/fs/ecryptfs/file.c b/fs/ecryptfs/file.c index d3f95f941c47..2b17f2f9b121 100644 --- a/fs/ecryptfs/file.c +++ b/fs/ecryptfs/file.c | |||
@@ -48,8 +48,7 @@ static ssize_t ecryptfs_read_update_atime(struct kiocb *iocb, | |||
48 | unsigned long nr_segs, loff_t pos) | 48 | unsigned long nr_segs, loff_t pos) |
49 | { | 49 | { |
50 | ssize_t rc; | 50 | ssize_t rc; |
51 | struct dentry *lower_dentry; | 51 | struct path lower; |
52 | struct vfsmount *lower_vfsmount; | ||
53 | struct file *file = iocb->ki_filp; | 52 | struct file *file = iocb->ki_filp; |
54 | 53 | ||
55 | rc = generic_file_aio_read(iocb, iov, nr_segs, pos); | 54 | rc = generic_file_aio_read(iocb, iov, nr_segs, pos); |
@@ -60,9 +59,9 @@ static ssize_t ecryptfs_read_update_atime(struct kiocb *iocb, | |||
60 | if (-EIOCBQUEUED == rc) | 59 | if (-EIOCBQUEUED == rc) |
61 | rc = wait_on_sync_kiocb(iocb); | 60 | rc = wait_on_sync_kiocb(iocb); |
62 | if (rc >= 0) { | 61 | if (rc >= 0) { |
63 | lower_dentry = ecryptfs_dentry_to_lower(file->f_path.dentry); | 62 | lower.dentry = ecryptfs_dentry_to_lower(file->f_path.dentry); |
64 | lower_vfsmount = ecryptfs_dentry_to_lower_mnt(file->f_path.dentry); | 63 | lower.mnt = ecryptfs_dentry_to_lower_mnt(file->f_path.dentry); |
65 | touch_atime(lower_vfsmount, lower_dentry); | 64 | touch_atime(&lower); |
66 | } | 65 | } |
67 | return rc; | 66 | return rc; |
68 | } | 67 | } |
diff --git a/fs/inode.c b/fs/inode.c index 92de04b0baa2..8b612813a6a7 100644 --- a/fs/inode.c +++ b/fs/inode.c | |||
@@ -1499,9 +1499,10 @@ static int relatime_need_update(struct vfsmount *mnt, struct inode *inode, | |||
1499 | * This function automatically handles read only file systems and media, | 1499 | * This function automatically handles read only file systems and media, |
1500 | * as well as the "noatime" flag and inode specific "noatime" markers. | 1500 | * as well as the "noatime" flag and inode specific "noatime" markers. |
1501 | */ | 1501 | */ |
1502 | void touch_atime(struct vfsmount *mnt, struct dentry *dentry) | 1502 | void touch_atime(struct path *path) |
1503 | { | 1503 | { |
1504 | struct inode *inode = dentry->d_inode; | 1504 | struct vfsmount *mnt = path->mnt; |
1505 | struct inode *inode = path->dentry->d_inode; | ||
1505 | struct timespec now; | 1506 | struct timespec now; |
1506 | 1507 | ||
1507 | if (inode->i_flags & S_NOATIME) | 1508 | if (inode->i_flags & S_NOATIME) |
diff --git a/fs/namei.c b/fs/namei.c index a0b82762e8fc..0ccc74ee92fb 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -642,7 +642,7 @@ follow_link(struct path *link, struct nameidata *nd, void **p) | |||
642 | cond_resched(); | 642 | cond_resched(); |
643 | current->total_link_count++; | 643 | current->total_link_count++; |
644 | 644 | ||
645 | touch_atime(link->mnt, dentry); | 645 | touch_atime(link); |
646 | nd_set_link(nd, NULL); | 646 | nd_set_link(nd, NULL); |
647 | 647 | ||
648 | error = security_inode_follow_link(link->dentry, nd); | 648 | error = security_inode_follow_link(link->dentry, nd); |
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index edf6d3ed8777..e59f71d0cf73 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c | |||
@@ -1541,30 +1541,31 @@ do_nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp, | |||
1541 | __be32 | 1541 | __be32 |
1542 | nfsd_readlink(struct svc_rqst *rqstp, struct svc_fh *fhp, char *buf, int *lenp) | 1542 | nfsd_readlink(struct svc_rqst *rqstp, struct svc_fh *fhp, char *buf, int *lenp) |
1543 | { | 1543 | { |
1544 | struct dentry *dentry; | ||
1545 | struct inode *inode; | 1544 | struct inode *inode; |
1546 | mm_segment_t oldfs; | 1545 | mm_segment_t oldfs; |
1547 | __be32 err; | 1546 | __be32 err; |
1548 | int host_err; | 1547 | int host_err; |
1548 | struct path path; | ||
1549 | 1549 | ||
1550 | err = fh_verify(rqstp, fhp, S_IFLNK, NFSD_MAY_NOP); | 1550 | err = fh_verify(rqstp, fhp, S_IFLNK, NFSD_MAY_NOP); |
1551 | if (err) | 1551 | if (err) |
1552 | goto out; | 1552 | goto out; |
1553 | 1553 | ||
1554 | dentry = fhp->fh_dentry; | 1554 | path.mnt = fhp->fh_export->ex_path.mnt; |
1555 | inode = dentry->d_inode; | 1555 | path.dentry = fhp->fh_dentry; |
1556 | inode = path.dentry->d_inode; | ||
1556 | 1557 | ||
1557 | err = nfserr_inval; | 1558 | err = nfserr_inval; |
1558 | if (!inode->i_op->readlink) | 1559 | if (!inode->i_op->readlink) |
1559 | goto out; | 1560 | goto out; |
1560 | 1561 | ||
1561 | touch_atime(fhp->fh_export->ex_path.mnt, dentry); | 1562 | touch_atime(&path); |
1562 | /* N.B. Why does this call need a get_fs()?? | 1563 | /* N.B. Why does this call need a get_fs()?? |
1563 | * Remove the set_fs and watch the fireworks:-) --okir | 1564 | * Remove the set_fs and watch the fireworks:-) --okir |
1564 | */ | 1565 | */ |
1565 | 1566 | ||
1566 | oldfs = get_fs(); set_fs(KERNEL_DS); | 1567 | oldfs = get_fs(); set_fs(KERNEL_DS); |
1567 | host_err = inode->i_op->readlink(dentry, buf, *lenp); | 1568 | host_err = inode->i_op->readlink(path.dentry, buf, *lenp); |
1568 | set_fs(oldfs); | 1569 | set_fs(oldfs); |
1569 | 1570 | ||
1570 | if (host_err < 0) | 1571 | if (host_err < 0) |
@@ -307,7 +307,7 @@ SYSCALL_DEFINE4(readlinkat, int, dfd, const char __user *, pathname, | |||
307 | if (inode->i_op->readlink) { | 307 | if (inode->i_op->readlink) { |
308 | error = security_inode_readlink(path.dentry); | 308 | error = security_inode_readlink(path.dentry); |
309 | if (!error) { | 309 | if (!error) { |
310 | touch_atime(path.mnt, path.dentry); | 310 | touch_atime(&path); |
311 | error = inode->i_op->readlink(path.dentry, | 311 | error = inode->i_op->readlink(path.dentry, |
312 | buf, bufsiz); | 312 | buf, bufsiz); |
313 | } | 313 | } |