summaryrefslogtreecommitdiff
path: root/fs/overlayfs/util.c
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@redhat.com>2017-07-04 23:03:16 +0300
committerMiklos Szeredi <mszeredi@redhat.com>2017-07-04 23:03:16 +0300
commite6d2ebddbc5205635a021a910f2f0e93bc2aa534 (patch)
tree93bf64fc3ce1e310cdb43b61be9bc51fbe59bb0d /fs/overlayfs/util.c
parent13cf199d0088b77ab08a9594df2e73e775317ed2 (diff)
downloadlinux-e6d2ebddbc5205635a021a910f2f0e93bc2aa534.tar.xz
ovl: simplify getting inode
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/overlayfs/util.c')
-rw-r--r--fs/overlayfs/util.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/overlayfs/util.c b/fs/overlayfs/util.c
index 809048913889..f4847eff3284 100644
--- a/fs/overlayfs/util.c
+++ b/fs/overlayfs/util.c
@@ -230,10 +230,15 @@ void ovl_dentry_update(struct dentry *dentry, struct dentry *upperdentry)
oe->__upperdentry = upperdentry;
}
-void ovl_inode_init(struct inode *inode, struct inode *realinode, bool is_upper)
+void ovl_inode_init(struct inode *inode, struct dentry *dentry)
{
+ struct inode *realinode = d_inode(ovl_dentry_real(dentry));
+ bool is_upper = ovl_dentry_upper(dentry);
+
WRITE_ONCE(inode->i_private, (unsigned long) realinode |
(is_upper ? OVL_ISUPPER_MASK : 0));
+
+ ovl_copyattr(realinode, inode);
}
void ovl_inode_update(struct inode *inode, struct inode *upperinode)