]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - fs/overlayfs/util.c
ovl: redirect on rename-dir
[karo-tx-linux.git] / fs / overlayfs / util.c
index 0d45a84468d2fba136783aac97324bd9d07c6c9d..260b215852a37907fc0928da65b6d016411c1102 100644 (file)
@@ -176,6 +176,35 @@ void ovl_dentry_set_opaque(struct dentry *dentry, bool opaque)
        oe->opaque = opaque;
 }
 
+bool ovl_redirect_dir(struct super_block *sb)
+{
+       struct ovl_fs *ofs = sb->s_fs_info;
+
+       return ofs->config.redirect_dir;
+}
+
+void ovl_clear_redirect_dir(struct super_block *sb)
+{
+       struct ovl_fs *ofs = sb->s_fs_info;
+
+       ofs->config.redirect_dir = false;
+}
+
+const char *ovl_dentry_get_redirect(struct dentry *dentry)
+{
+       struct ovl_entry *oe = dentry->d_fsdata;
+
+       return oe->redirect;
+}
+
+void ovl_dentry_set_redirect(struct dentry *dentry, const char *redirect)
+{
+       struct ovl_entry *oe = dentry->d_fsdata;
+
+       kfree(oe->redirect);
+       oe->redirect = redirect;
+}
+
 void ovl_dentry_update(struct dentry *dentry, struct dentry *upperdentry)
 {
        struct ovl_entry *oe = dentry->d_fsdata;