commit 0cb22e9ccf397dad4b5925296413340472c69be7
Author: Yiannis Pericleous <[EMAIL PROTECTED]>
Date:   Thu Mar 29 14:59:40 2007 -0400

    cleanup thread to always cleanup everything on mounts/remounts

diff --git a/fs/unionfs/odf.c b/fs/unionfs/odf.c
index 
81b2479989560dbf1c30819860662591cbc49b40..6890eb3931da3c66277d84a31bf2ac158aff3f5d
 100644
--- a/fs/unionfs/odf.c
+++ b/fs/unionfs/odf.c
@@ -67,6 +67,7 @@ struct odf_sb_info* odf_read_super(char 
        }
        sioa->cleanup.odf = osi;
        sioa->cleanup.attr = get_attributes();
+       sioa->cleanup.force = 1;
        osi->cleanup = sioa;
        run_sioa(sioa, __odf_cleanup, 
                msecs_to_jiffies(sioa->cleanup.attr->timeout->val));
@@ -1343,7 +1344,12 @@ void __odf_cleanup(void *args)
        odi_ic = cl->odf->odi_ic;
        odf_lock(odi_ic);
        vfs_statfs(cl->odf->odi_sb->dentry, &stat);
-       if (stat.f_bavail * 100 < stat.f_blocks * (100 - 
cl->attr->thresh_b->val)) {
+       if (cl->force) {
+               cl->force = 0;
+               printk("unionfs cleanup thread: forced cleanup\n");
+               cleanup = 1;
+       }
+       else if (stat.f_bavail * 100 < stat.f_blocks * (100 - 
cl->attr->thresh_b->val)) {
                cleanup = 1;
                printk("unionfs cleanup thread: free blocks below critical 
size\n");
        }
diff --git a/fs/unionfs/sioq.h b/fs/unionfs/sioq.h
index 
16ff5553b91991847758aea4af83e7e3865ef332..6e542ebad58a7b9532d95841fda733dba3fbd64c
 100644
--- a/fs/unionfs/sioq.h
+++ b/fs/unionfs/sioq.h
@@ -36,6 +36,7 @@ struct unlink_args {
 struct cleanup_args {
        struct odf_sb_info *odf;
        struct unionfs_attributes *attr;
+       int force;
 };
 
 struct sioq_args {
diff --git a/fs/unionfs/super.c b/fs/unionfs/super.c
index 
1badbbaa1ba375abe0b9c07974f52318e6e748b9..282a591ff86fac9882e88d410d1307f59d4df300
 100644
--- a/fs/unionfs/super.c
+++ b/fs/unionfs/super.c
@@ -422,6 +422,7 @@ static int unionfs_remount_fs(struct sup
        struct unionfs_data *new_data = NULL, *tmp_data = NULL;
        struct path *new_lower_paths = NULL, *tmp_lower_paths = NULL;
        int new_high_branch_id; /* new high branch ID */
+       struct odf_sb_info *odf = UNIONFS_SB(sb)->odf;
 
        unionfs_write_lock(sb);
 
@@ -676,13 +677,12 @@ out_no_change:
        /* now update the odf. rewrite the superblock data file with all
         * the new branch information
         */
-       err = odf_write_sb_data(UNIONFS_SB(sb)->odf,
-                       new_data,
-                       new_lower_paths,
-                       new_branches);
+       err = odf_write_sb_data(odf, new_data, new_lower_paths, new_branches);
        if (err)
                goto out_release;
-        UNIONFS_SB(sb)->odf->opaque_branch_id = new_data[0].branch_id;
+       odf->opaque_branch_id = new_data[0].branch_id;
+       odf->cleanup->cleanup.force = 1;
+       wake_up_and_wait_sioa(odf->cleanup);
 
        /*
         * OK, just before we actually put the new set of branches in place,
_______________________________________________
unionfs-cvs mailing list: http://unionfs.filesystems.org/
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs-cvs

Reply via email to