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
commit04a01ac7ed3c5cd718713ef6341249a143c96b10 (patch)
tree737c6c92f91dab8c7dba5b43bab4af82cfd68462 /fs/overlayfs/util.c
parentovl: use ovl_inode mutex to synchronize concurrent copy up (diff)
downloadlinux-04a01ac7ed3c5cd718713ef6341249a143c96b10.tar.xz
linux-04a01ac7ed3c5cd718713ef6341249a143c96b10.zip
ovl: move cache and version to ovl_inode
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to '')
-rw-r--r--fs/overlayfs/util.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/fs/overlayfs/util.c b/fs/overlayfs/util.c
index a0baaa7e224c..f093fcf2b4bd 100644
--- a/fs/overlayfs/util.c
+++ b/fs/overlayfs/util.c
@@ -160,16 +160,12 @@ struct inode *ovl_inode_real(struct inode *inode)
struct ovl_dir_cache *ovl_dir_cache(struct dentry *dentry)
{
- struct ovl_entry *oe = dentry->d_fsdata;
-
- return oe->cache;
+ return OVL_I(d_inode(dentry))->cache;
}
void ovl_set_dir_cache(struct dentry *dentry, struct ovl_dir_cache *cache)
{
- struct ovl_entry *oe = dentry->d_fsdata;
-
- oe->cache = cache;
+ OVL_I(d_inode(dentry))->cache = cache;
}
bool ovl_dentry_is_opaque(struct dentry *dentry)
@@ -242,18 +238,18 @@ void ovl_inode_update(struct inode *inode, struct dentry *upperdentry)
void ovl_dentry_version_inc(struct dentry *dentry)
{
- struct ovl_entry *oe = dentry->d_fsdata;
+ struct inode *inode = d_inode(dentry);
- WARN_ON(!inode_is_locked(dentry->d_inode));
- oe->version++;
+ WARN_ON(!inode_is_locked(inode));
+ OVL_I(inode)->version++;
}
u64 ovl_dentry_version_get(struct dentry *dentry)
{
- struct ovl_entry *oe = dentry->d_fsdata;
+ struct inode *inode = d_inode(dentry);
- WARN_ON(!inode_is_locked(dentry->d_inode));
- return oe->version;
+ WARN_ON(!inode_is_locked(inode));
+ return OVL_I(inode)->version;
}
bool ovl_is_whiteout(struct dentry *dentry)