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>
This commit is contained in:
@@ -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)
|
int ovl_update_time(struct inode *inode, struct timespec *ts, int flags)
|
||||||
{
|
{
|
||||||
struct dentry *alias;
|
if (flags & S_ATIME) {
|
||||||
struct path upperpath;
|
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 (!(flags & S_ATIME))
|
if (upperpath.dentry) {
|
||||||
return 0;
|
touch_atime(&upperpath);
|
||||||
|
inode->i_atime = d_inode(upperpath.dentry)->i_atime;
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dput(alias);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user