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
commit13c72075ac9f5a5cf3f61c85adaafffe48a6f797 (patch)
tree9e9232d1fe91ad0bad85982656ce070129a29110 /fs/overlayfs/util.c
parentcf31c46347e8e54cb53d66255ae3eea045b0a60c (diff)
downloadblackbird-obmc-linux-13c72075ac9f5a5cf3f61c85adaafffe48a6f797.tar.gz
blackbird-obmc-linux-13c72075ac9f5a5cf3f61c85adaafffe48a6f797.zip
ovl: move impure to ovl_inode
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/overlayfs/util.c')
-rw-r--r--fs/overlayfs/util.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/fs/overlayfs/util.c b/fs/overlayfs/util.c
index be0670f1addf..2fc4c22707aa 100644
--- a/fs/overlayfs/util.c
+++ b/fs/overlayfs/util.c
@@ -178,13 +178,6 @@ bool ovl_dentry_is_opaque(struct dentry *dentry)
return oe->opaque;
}
-bool ovl_dentry_is_impure(struct dentry *dentry)
-{
- struct ovl_entry *oe = dentry->d_fsdata;
-
- return oe->impure;
-}
-
bool ovl_dentry_is_whiteout(struct dentry *dentry)
{
return !dentry->d_inode && ovl_dentry_is_opaque(dentry);
@@ -344,9 +337,8 @@ int ovl_check_setxattr(struct dentry *dentry, struct dentry *upperdentry,
int ovl_set_impure(struct dentry *dentry, struct dentry *upperdentry)
{
int err;
- struct ovl_entry *oe = dentry->d_fsdata;
- if (oe->impure)
+ if (ovl_test_flag(OVL_IMPURE, d_inode(dentry)))
return 0;
/*
@@ -356,7 +348,17 @@ int ovl_set_impure(struct dentry *dentry, struct dentry *upperdentry)
err = ovl_check_setxattr(dentry, upperdentry, OVL_XATTR_IMPURE,
"y", 1, 0);
if (!err)
- oe->impure = true;
+ ovl_set_flag(OVL_IMPURE, d_inode(dentry));
return err;
}
+
+void ovl_set_flag(unsigned long flag, struct inode *inode)
+{
+ set_bit(flag, &OVL_I(inode)->flags);
+}
+
+bool ovl_test_flag(unsigned long flag, struct inode *inode)
+{
+ return test_bit(flag, &OVL_I(inode)->flags);
+}
OpenPOWER on IntegriCloud