ovl: Add an alternative type of whiteout
[linux-2.6-microblaze.git] / fs / overlayfs / overlayfs.h
index 393c6ba..ca88b26 100644 (file)
@@ -49,6 +49,8 @@ enum ovl_xattr {
        OVL_XATTR_UUID,
        OVL_XATTR_METACOPY,
        OVL_XATTR_PROTATTR,
+       OVL_XATTR_XWHITEOUT,
+       OVL_XATTR_XWHITEOUTS,
 };
 
 enum ovl_inode_flag {
@@ -473,6 +475,7 @@ void ovl_inode_update(struct inode *inode, struct dentry *upperdentry);
 void ovl_dir_modified(struct dentry *dentry, bool impurity);
 u64 ovl_inode_version_get(struct inode *inode);
 bool ovl_is_whiteout(struct dentry *dentry);
+bool ovl_path_is_whiteout(struct ovl_fs *ofs, const struct path *path);
 struct file *ovl_path_open(const struct path *path, int flags);
 int ovl_copy_up_start(struct dentry *dentry, int flags);
 void ovl_copy_up_end(struct dentry *dentry);
@@ -480,9 +483,21 @@ bool ovl_already_copied_up(struct dentry *dentry, int flags);
 bool ovl_path_check_dir_xattr(struct ovl_fs *ofs, const struct path *path,
                              enum ovl_xattr ox);
 bool ovl_path_check_origin_xattr(struct ovl_fs *ofs, const struct path *path);
+bool ovl_path_check_xwhiteout_xattr(struct ovl_fs *ofs, const struct path *path);
+bool ovl_path_check_xwhiteouts_xattr(struct ovl_fs *ofs, const struct path *path);
 bool ovl_init_uuid_xattr(struct super_block *sb, struct ovl_fs *ofs,
                         const struct path *upperpath);
 
+static inline bool ovl_upper_is_whiteout(struct ovl_fs *ofs,
+                                        struct dentry *upperdentry)
+{
+       struct path upperpath = {
+               .dentry = upperdentry,
+               .mnt = ovl_upper_mnt(ofs),
+       };
+       return ovl_path_is_whiteout(ofs, &upperpath);
+}
+
 static inline bool ovl_check_origin_xattr(struct ovl_fs *ofs,
                                          struct dentry *upperdentry)
 {