lkml.org 
[lkml]   [2018]   [Apr]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [RFC PATCH 04/35] ovl: copy up times
    On Thu, Apr 12, 2018 at 6:07 PM, Miklos Szeredi <mszeredi@redhat.com> wrote:
    > Copy up mtime and ctime to overlay inode after times in real object are
    > modified. Be careful not to dirty cachelines when not necessary.
    >
    > This is in preparation for moving overlay functionality out of the VFS.
    >
    > This patch shouldn't have any observable effect.
    >
    > Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
    > ---
    > fs/overlayfs/dir.c | 5 +++++
    > fs/overlayfs/inode.c | 1 +
    > fs/overlayfs/overlayfs.h | 7 +++++++
    > fs/overlayfs/util.c | 19 +++++++++++++++++++
    > 4 files changed, 32 insertions(+)
    >
    > diff --git a/fs/overlayfs/dir.c b/fs/overlayfs/dir.c
    > index 839709c7803a..cd0fa2363723 100644
    > --- a/fs/overlayfs/dir.c
    > +++ b/fs/overlayfs/dir.c
    > @@ -507,6 +507,7 @@ static int ovl_create_or_link(struct dentry *dentry, struct inode *inode,
    > else
    > err = ovl_create_over_whiteout(dentry, inode, attr,
    > hardlink);
    > + ovl_copytimes_with_parent(dentry);
    > }
    > out_revert_creds:
    > revert_creds(old_cred);
    > @@ -768,6 +769,7 @@ static int ovl_do_remove(struct dentry *dentry, bool is_dir)
    > drop_nlink(dentry->d_inode);
    > }
    > ovl_nlink_end(dentry, locked);
    > + ovl_copytimes_with_parent(dentry);
    > out_drop_write:
    > ovl_drop_write(dentry);
    > out:
    > @@ -1079,6 +1081,9 @@ static int ovl_rename(struct inode *olddir, struct dentry *old,
    > ovl_dentry_version_inc(new->d_parent, ovl_type_origin(old) ||
    > (d_inode(new) && ovl_type_origin(new)));
    >
    > + ovl_copytimes_with_parent(old);
    > + ovl_copytimes_with_parent(new);
    > +

    All the ovl_copytimes_with_parent() calls you added can be replaced with a
    single call in ovl_dentry_version_inc(). Just need to change its name and
    pass it the child instead of the parent dentry.

    Thanks,
    Amir.

    \
     
     \ /
      Last update: 2018-04-13 10:26    [W:4.211 / U:0.052 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site