diff options
author | Miklos Szeredi <mszeredi@redhat.com> | 2018-04-12 13:04:50 +0300 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2018-04-12 13:04:50 +0300 |
commit | 8f35cf51cd24a08e3d5b97e7253c93a5c90a4c1e (patch) | |
tree | 481dfd16bcea896eef93a21d2443d9cf8c7379c7 /fs/overlayfs | |
parent | 3a291774d17e096950854506d8869dfe950ec932 (diff) | |
download | linux-8f35cf51cd24a08e3d5b97e7253c93a5c90a4c1e.tar.xz |
ovl: cleanup ovl_update_time()
No need to mess with an alias, the upperdentry can be retrieved directly
from the overlay inode.
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/overlayfs')
-rw-r--r-- | fs/overlayfs/inode.c | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/fs/overlayfs/inode.c b/fs/overlayfs/inode.c index b3be0cfd4c92..29069f29b3a6 100644 --- a/fs/overlayfs/inode.c +++ b/fs/overlayfs/inode.c @@ -380,24 +380,18 @@ int ovl_open_maybe_copy_up(struct dentry *dentry, unsigned int file_flags) int ovl_update_time(struct inode *inode, struct timespec *ts, int flags) { - struct dentry *alias; - struct path upperpath; - - if (!(flags & S_ATIME)) - return 0; - - alias = d_find_any_alias(inode); - if (!alias) - return 0; - - ovl_path_upper(alias, &upperpath); - if (upperpath.dentry) { - touch_atime(&upperpath); - inode->i_atime = d_inode(upperpath.dentry)->i_atime; + if (flags & S_ATIME) { + struct ovl_fs *ofs = inode->i_sb->s_fs_info; + struct path upperpath = { + .mnt = ofs->upper_mnt, + .dentry = ovl_upperdentry_dereference(OVL_I(inode)), + }; + + if (upperpath.dentry) { + touch_atime(&upperpath); + inode->i_atime = d_inode(upperpath.dentry)->i_atime; + } } - - dput(alias); - return 0; } |