diff options
author | Miklos Szeredi <mszeredi@redhat.com> | 2017-07-04 23:03:16 +0300 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2017-07-04 23:03:16 +0300 |
commit | e6d2ebddbc5205635a021a910f2f0e93bc2aa534 (patch) | |
tree | 93bf64fc3ce1e310cdb43b61be9bc51fbe59bb0d /fs/overlayfs/util.c | |
parent | 13cf199d0088b77ab08a9594df2e73e775317ed2 (diff) | |
download | linux-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.c | 7 |
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) |