commit 4eed7d0ef79daf24d993f594c6baa3d2c5996fbb
Author: Yiannis Pericleous <[EMAIL PROTECTED]>
Date:   Thu Mar 15 14:52:05 2007 -0400

    odf cleanup thread, removes everything from odf/reclaim
    
    whenever it wakes up

diff --git a/fs/unionfs/dirhelper.c b/fs/unionfs/dirhelper.c
index 5ebdd8f..988f703 100644
--- a/fs/unionfs/dirhelper.c
+++ b/fs/unionfs/dirhelper.c
@@ -57,7 +57,6 @@ struct unionfs_rdutil_callback {
 };
 struct unionfs_rmdir_callback {
        int err;
-       int bindex;
        int filldir_called;
        struct dentry *dir;
        struct vfsmount *mnt;
@@ -838,12 +837,12 @@ out:
 }
 
 /* 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
+ * at a specific branch and then the directory itself if rm_parent is set. 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 a new dentry
+ * and we need to create a new dentry or in the odf
  */
-int unionfs_force_rmdir(struct vfsmount *mnt, struct dentry *hidden_dentry, 
int bindex)
+int unionfs_force_rmdir(struct vfsmount *mnt, struct dentry *hidden_dentry, 
int rm_parent)
 {
        int err = 0;
        struct file *hidden_file;
@@ -855,7 +854,6 @@ int unionfs_force_rmdir(struct vfsmount *mnt, struct dentry 
*hidden_dentry, int
                goto out;
        }
        buf->err = 0;
-       buf->bindex = bindex;
        buf->dir = hidden_dentry;
        buf->mnt = mnt;
 
@@ -885,8 +883,9 @@ int unionfs_force_rmdir(struct vfsmount *mnt, struct dentry 
*hidden_dentry, int
 
        if (err < 0)
                goto out;
-
-       err = vfs_rmdir(hidden_dentry->d_parent->d_inode, hidden_dentry);
+       
+       if (rm_parent)
+               err = vfs_rmdir(hidden_dentry->d_parent->d_inode, 
hidden_dentry);
 
 out:
        kfree(buf);
diff --git a/fs/unionfs/odf.h b/fs/unionfs/odf.h
index 20cc1a2..699f745 100644
--- a/fs/unionfs/odf.h
+++ b/fs/unionfs/odf.h
@@ -61,7 +61,7 @@
 #define ODF_DIRENT_MAGIC 0x0DFD1300
 
 /* Reclaim thread timeout */
-#define ODF_RC_TIMEOUT 1000
+#define ODF_RC_TIMEOUT 10000
 
 /* super */
 struct odf_sb_info* odf_read_super(char *options);
@@ -158,6 +158,10 @@ static inline void odf_unlock(struct odf_dentry_info *odi)
 
 extern void generate_random_uuid(unsigned char uuid_out[16]);
 
+/* cleanup thread functions */
+extern void __odf_reclaim_w(void *args);
+extern int __odf_reclaim_d(void *args);
+
 /* Macros for locking an odf dentry info. */
 static inline void odf_lock(struct odf_dentry_info *odi)
 {
diff --git a/fs/unionfs/sioq.h b/fs/unionfs/sioq.h
index e9a4829..f97b594 100644
--- a/fs/unionfs/sioq.h
+++ b/fs/unionfs/sioq.h
@@ -96,8 +96,6 @@ extern void __unionfs_mkdir(struct work_struct *work);
 extern void __unionfs_mknod(struct work_struct *work);
 extern void __unionfs_symlink(struct work_struct *work);
 extern void __unionfs_unlink(struct work_struct *work);
-extern void __unionfs_reclaim_w(void *args);
-extern int __unionfs_reclaim_d(void *args);
 
 #endif /* _SIOQ_H */
 
_______________________________________________
unionfs-cvs mailing list: http://unionfs.filesystems.org/
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs-cvs

Reply via email to