summaryrefslogtreecommitdiffstats
path: root/fs/overlayfs/util.c
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@redhat.com>2017-07-04 22:03:16 +0200
committerMiklos Szeredi <mszeredi@redhat.com>2017-07-04 22:03:16 +0200
commite6d2ebddbc5205635a021a910f2f0e93bc2aa534 (patch)
tree93bf64fc3ce1e310cdb43b61be9bc51fbe59bb0d /fs/overlayfs/util.c
parentovl: allocate an ovl_inode struct (diff)
downloadlinux-e6d2ebddbc5205635a021a910f2f0e93bc2aa534.tar.xz
linux-e6d2ebddbc5205635a021a910f2f0e93bc2aa534.zip
ovl: simplify getting inode
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to '')
-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)