On Wed, Jun 25, 2025 at 1:07 AM NeilBrown <neil@xxxxxxxxxx> wrote: > > Instead of passing an inode *dir, pass a dentry *parent. This makes the > calling slightly cleaner. > > Signed-off-by: NeilBrown <neil@xxxxxxxxxx> nice Reviewed-by: Amir Goldstein <amir73il@xxxxxxxxx> > --- > fs/overlayfs/dir.c | 7 ++++--- > fs/overlayfs/overlayfs.h | 2 +- > fs/overlayfs/super.c | 3 +-- > 3 files changed, 6 insertions(+), 6 deletions(-) > > diff --git a/fs/overlayfs/dir.c b/fs/overlayfs/dir.c > index 78b0d956b0ac..9a43ab23cf01 100644 > --- a/fs/overlayfs/dir.c > +++ b/fs/overlayfs/dir.c > @@ -164,9 +164,10 @@ int ovl_cleanup_and_whiteout(struct ovl_fs *ofs, struct dentry *dir, > goto out; > } > > -struct dentry *ovl_create_real(struct ovl_fs *ofs, struct inode *dir, > +struct dentry *ovl_create_real(struct ovl_fs *ofs, struct dentry *parent, > struct dentry *newdentry, struct ovl_cattr *attr) > { > + struct inode *dir = parent->d_inode; > int err; > > if (IS_ERR(newdentry)) > @@ -227,7 +228,7 @@ struct dentry *ovl_create_temp(struct ovl_fs *ofs, struct dentry *workdir, > { > struct dentry *ret; > inode_lock(workdir->d_inode); > - ret = ovl_create_real(ofs, d_inode(workdir), > + ret = ovl_create_real(ofs, workdir, > ovl_lookup_temp(ofs, workdir), attr); > inode_unlock(workdir->d_inode); > return ret; > @@ -333,7 +334,7 @@ static int ovl_create_upper(struct dentry *dentry, struct inode *inode, > int err; > > inode_lock_nested(udir, I_MUTEX_PARENT); > - newdentry = ovl_create_real(ofs, udir, > + newdentry = ovl_create_real(ofs, upperdir, > ovl_lookup_upper(ofs, dentry->d_name.name, > upperdir, dentry->d_name.len), > attr); > diff --git a/fs/overlayfs/overlayfs.h b/fs/overlayfs/overlayfs.h > index 25378b81251e..3d89e1c8d565 100644 > --- a/fs/overlayfs/overlayfs.h > +++ b/fs/overlayfs/overlayfs.h > @@ -849,7 +849,7 @@ struct ovl_cattr { > #define OVL_CATTR(m) (&(struct ovl_cattr) { .mode = (m) }) > > struct dentry *ovl_create_real(struct ovl_fs *ofs, > - struct inode *dir, struct dentry *newdentry, > + struct dentry *parent, struct dentry *newdentry, > struct ovl_cattr *attr); > int ovl_cleanup(struct ovl_fs *ofs, struct inode *dir, struct dentry *dentry); > int ovl_cleanup_unlocked(struct ovl_fs *ofs, struct dentry *workdir, struct dentry *dentry); > diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c > index 8331667b8101..1ba1bffc4547 100644 > --- a/fs/overlayfs/super.c > +++ b/fs/overlayfs/super.c > @@ -617,8 +617,7 @@ static struct dentry *ovl_lookup_or_create(struct ovl_fs *ofs, > inode_lock_nested(parent->d_inode, I_MUTEX_PARENT); > child = ovl_lookup_upper(ofs, name, parent, len); > if (!IS_ERR(child) && !child->d_inode) > - child = ovl_create_real(ofs, parent->d_inode, child, > - OVL_CATTR(mode)); > + child = ovl_create_real(ofs, parent, child, OVL_CATTR(mode)); > inode_unlock(parent->d_inode); > dput(parent); > > -- > 2.49.0 >