Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

switch touch_atime to struct path

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Al Viro 68ac1234 40ffe67d

+21 -19
+2 -1
fs/cachefiles/namei.c
··· 646 646 * (this is used to keep track of culling, and atimes are only 647 647 * updated by read, write and readdir but not lookup or 648 648 * open) */ 649 - touch_atime(cache->mnt, next); 649 + path.dentry = next; 650 + touch_atime(&path); 650 651 } 651 652 652 653 /* open a file interface onto a data file */
+4 -5
fs/ecryptfs/file.c
··· 48 48 unsigned long nr_segs, loff_t pos) 49 49 { 50 50 ssize_t rc; 51 - struct dentry *lower_dentry; 52 - struct vfsmount *lower_vfsmount; 51 + struct path lower; 53 52 struct file *file = iocb->ki_filp; 54 53 55 54 rc = generic_file_aio_read(iocb, iov, nr_segs, pos); ··· 59 60 if (-EIOCBQUEUED == rc) 60 61 rc = wait_on_sync_kiocb(iocb); 61 62 if (rc >= 0) { 62 - lower_dentry = ecryptfs_dentry_to_lower(file->f_path.dentry); 63 - lower_vfsmount = ecryptfs_dentry_to_lower_mnt(file->f_path.dentry); 64 - touch_atime(lower_vfsmount, lower_dentry); 63 + lower.dentry = ecryptfs_dentry_to_lower(file->f_path.dentry); 64 + lower.mnt = ecryptfs_dentry_to_lower_mnt(file->f_path.dentry); 65 + touch_atime(&lower); 65 66 } 66 67 return rc; 67 68 }
+3 -2
fs/inode.c
··· 1499 1499 * This function automatically handles read only file systems and media, 1500 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 1506 struct timespec now; 1506 1507 1507 1508 if (inode->i_flags & S_NOATIME)
+1 -1
fs/namei.c
··· 642 642 cond_resched(); 643 643 current->total_link_count++; 644 644 645 - touch_atime(link->mnt, dentry); 645 + touch_atime(link); 646 646 nd_set_link(nd, NULL); 647 647 648 648 error = security_inode_follow_link(link->dentry, nd);
+6 -5
fs/nfsd/vfs.c
··· 1541 1541 __be32 1542 1542 nfsd_readlink(struct svc_rqst *rqstp, struct svc_fh *fhp, char *buf, int *lenp) 1543 1543 { 1544 - struct dentry *dentry; 1545 1544 struct inode *inode; 1546 1545 mm_segment_t oldfs; 1547 1546 __be32 err; 1548 1547 int host_err; 1548 + struct path path; 1549 1549 1550 1550 err = fh_verify(rqstp, fhp, S_IFLNK, NFSD_MAY_NOP); 1551 1551 if (err) 1552 1552 goto out; 1553 1553 1554 - dentry = fhp->fh_dentry; 1555 - inode = dentry->d_inode; 1554 + path.mnt = fhp->fh_export->ex_path.mnt; 1555 + path.dentry = fhp->fh_dentry; 1556 + inode = path.dentry->d_inode; 1556 1557 1557 1558 err = nfserr_inval; 1558 1559 if (!inode->i_op->readlink) 1559 1560 goto out; 1560 1561 1561 - touch_atime(fhp->fh_export->ex_path.mnt, dentry); 1562 + touch_atime(&path); 1562 1563 /* N.B. Why does this call need a get_fs()?? 1563 1564 * Remove the set_fs and watch the fireworks:-) --okir 1564 1565 */ 1565 1566 1566 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 1569 set_fs(oldfs); 1569 1570 1570 1571 if (host_err < 0)
+1 -1
fs/stat.c
··· 307 307 if (inode->i_op->readlink) { 308 308 error = security_inode_readlink(path.dentry); 309 309 if (!error) { 310 - touch_atime(path.mnt, path.dentry); 310 + touch_atime(&path); 311 311 error = inode->i_op->readlink(path.dentry, 312 312 buf, bufsiz); 313 313 }
+2 -2
include/linux/fs.h
··· 1812 1812 spin_unlock(&inode->i_lock); 1813 1813 } 1814 1814 1815 - extern void touch_atime(struct vfsmount *mnt, struct dentry *dentry); 1815 + extern void touch_atime(struct path *); 1816 1816 static inline void file_accessed(struct file *file) 1817 1817 { 1818 1818 if (!(file->f_flags & O_NOATIME)) 1819 - touch_atime(file->f_path.mnt, file->f_path.dentry); 1819 + touch_atime(&file->f_path); 1820 1820 } 1821 1821 1822 1822 int sync_inode(struct inode *inode, struct writeback_control *wbc);
+2 -2
net/unix/af_unix.c
··· 771 771 goto put_fail; 772 772 773 773 if (u->sk_type == type) 774 - touch_atime(path.mnt, path.dentry); 774 + touch_atime(&path); 775 775 776 776 path_put(&path); 777 777 ··· 787 787 struct dentry *dentry; 788 788 dentry = unix_sk(u)->path.dentry; 789 789 if (dentry) 790 - touch_atime(unix_sk(u)->path.mnt, dentry); 790 + touch_atime(&unix_sk(u)->path); 791 791 } else 792 792 goto fail; 793 793 }