commit 04eee19267588cd7c383ec0a1bdc64e9d2dd31a7
Author: Yiannis Pericleous <[EMAIL PROTECTED]>
Date: Tue Apr 3 16:56:40 2007 -0400
removed recursive cleanup function
diff --git a/fs/unionfs/dirhelper.c b/fs/unionfs/dirhelper.c
index 3d0bdfb..633f611 100644
--- a/fs/unionfs/dirhelper.c
+++ b/fs/unionfs/dirhelper.c
@@ -56,15 +56,6 @@ struct unionfs_rdutil_callback {
int mode;
};
-struct unionfs_rmdir_callback {
- int err;
- int filldir_called;
- struct dentry *dir;
- struct vfsmount *mnt;
- int isleaf;
- int mode;
-};
-
/* callback structure for odf_cleanup*/
struct unionfs_cleanup_callback {
int err;
@@ -858,72 +849,6 @@ out:
return err;
}
-/* This function recursively rermoves all the entries of a lower directory
- * at a specific branch and then the directory itself. It does not cross
- * branches, and does nothing visible to the union. It should only be used
- * when both a whiteout and a dir at top branch exists and we need to create
- * create a new dentry or in the odf for cleanup
- * Flags: RMV_ALL : removes all entries
- * RMV_LEAF : removes dirs only if they are leaves (dont have
subdirs)
- * RMV_NOTPARENT : can be set with both flags above, does not rmv
base dir
- */
-int unionfs_force_rmdir(struct vfsmount *mnt, struct dentry *hidden_dentry,
int flags)
-{
- int err = 0;
- struct file *hidden_file;
- struct unionfs_rmdir_callback *buf = NULL;
-
- buf = kmalloc(sizeof(struct unionfs_rmdir_callback), GFP_KERNEL);
- if (!buf) {
- err = -ENOMEM;
- goto out;
- }
- buf->err = 0;
- buf->dir = hidden_dentry;
- buf->mnt = mnt;
- buf->isleaf = 1;
- if (flags & FRMV_LEAF)
- buf->mode = RM_LEAF;
- else
- buf->mode = RM_ALL;
-
- if (!hidden_dentry->d_inode)
- goto out;
- if (!S_ISDIR(hidden_dentry->d_inode->i_mode))
- goto out;
-
- dget(hidden_dentry);
- mntget(mnt);
- hidden_file = dentry_open(hidden_dentry, mnt, O_RDONLY);
- if (IS_ERR(hidden_file)) {
- err = PTR_ERR(hidden_file);
- dput(hidden_dentry);
- goto out;
- }
-
- do {
- buf->filldir_called = 0;
- err = vfs_readdir(hidden_file, rmdir_util_callback, buf);
- if (buf->err)
- err = buf->err;
- } while ((err >= 0) && buf->filldir_called);
-
- /* fput calls dput for hidden_dentry */
- fput(hidden_file);
-
- if (err < 0)
- goto out;
-
- if ((flags & FRMV_NOTPARENT) || ((flags & FRMV_LEAF) && !buf->isleaf))
- goto out;
- err = vfs_rmdir(hidden_dentry->d_parent->d_inode, hidden_dentry);
-
-out:
- kfree(buf);
-
- return err;
-}
-
/* Remove the hidden dentry by:
* a) rmdir if its a physically empty dir
* b) silly rename if its not physically empty
diff --git a/fs/unionfs/union.h b/fs/unionfs/union.h
index 81b32b0..5e1148a 100644
--- a/fs/unionfs/union.h
+++ b/fs/unionfs/union.h
@@ -332,11 +332,6 @@ int __unionfs_d_revalidate_chain(struct dentry *dentry,
struct nameidata *nd);
int unionfs_force_rm(struct dentry *dentry, struct dentry **hidden_dentry, int
bindex);
int unionfs_silly_rename(struct dentry *dentry, struct dentry *hidden_dentry);
-/* Force rmv flags */
-#define FRMV_ALL 0
-#define FRMV_NOTPARENT 1
-#define FRMV_LEAF 2
-
/* The values for unionfs_interpose's flag. */
#define INTERPOSE_DEFAULT 0
#define INTERPOSE_LOOKUP 1
_______________________________________________
unionfs-cvs mailing list: http://unionfs.filesystems.org/
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs-cvs