commit 8262fac36d3f287c58a5085ca8ae5751c4473c0e
Author: Yiannis Pericleous <[EMAIL PROTECTED]>
Date: Wed Apr 11 16:38:57 2007 -0400
cleanup thread to print warning only once
diff --git a/fs/unionfs/dirhelper.c b/fs/unionfs/dirhelper.c
index
7395464145f079e27f22138e6734b4ed19f3c54a..b03a061a984d365db76d2307ed0003949cc41141
100644
--- a/fs/unionfs/dirhelper.c
+++ b/fs/unionfs/dirhelper.c
@@ -541,6 +541,8 @@ out:
* ODF_CLEAN_CACHE: cleans all the dir caches
* ODF_CLEAN_BLOCKS: clean until size blocks are freed
* ODF_CLEAN_INODES: clean until size inodes are freed
+ * Returns 1 if it manages to bring inodes/block below requested,
+ * threshold and 0 if not.
*/
int odf_cleanup(struct odf_sb_info *odf, int mode, u64 size)
{
@@ -655,12 +657,10 @@ cleanup_loop:
stack.item[stack.n++] = odf->odi_rc->dentry;
goto cleanup_loop;
}
- else if (mode == ODF_CLEAN_BLOCKS)
- printk("unionfs: Failed to bring free odf data blocks
below threshold\n");
- else if (mode == ODF_CLEAN_INODES)
- printk("unionfs: Failed to bring free odf inodes below
threshold\n");
}
-
+
+ if (mode == ODF_CLEAN_ALL)
+ success = 1;
out:
BUG_ON(stack.n < 0);
@@ -669,6 +669,8 @@ out:
kfree(buf);
kfree(stack.item);
+ if (!err)
+ err = success;
return err;
}
diff --git a/fs/unionfs/odf.c b/fs/unionfs/odf.c
index
fdd59966dc2738f488bea91b85e61312121aace4..812cd53380617efc06558c2b106bccd3c60ce760
100644
--- a/fs/unionfs/odf.c
+++ b/fs/unionfs/odf.c
@@ -1814,9 +1814,17 @@ void __odf_cleanup(void *args)
}
if (cleanup)
err = odf_cleanup(cl->odf, cleanup, size);
- if (err)
+ if (err < 0)
printk("unionfs cleanup thread: error %d\n", err);
-
+ else {
+ if (err == 0 && cl->success == 1) {
+ if (cleanup == ODF_CLEAN_BLOCKS)
+ printk("unionfs: Failed to bring free odf data
blocks below threshold\n");
+ else if (cleanup == ODF_CLEAN_INODES)
+ printk("unionfs: Failed to bring free odf
inodes below threshold\n");
+ }
+ cl->success = err;
+ }
odf_unlock(cl->odf->odi_ic);
odf_unlock(cl->odf->odi_rc);
}
diff --git a/fs/unionfs/sioq.h b/fs/unionfs/sioq.h
index
6e542ebad58a7b9532d95841fda733dba3fbd64c..a7be2f03ad8d799905565db9271aec0d0c2c8905
100644
--- a/fs/unionfs/sioq.h
+++ b/fs/unionfs/sioq.h
@@ -37,6 +37,7 @@ struct cleanup_args {
struct odf_sb_info *odf;
struct unionfs_attributes *attr;
int force;
+ int success;
};
struct sioq_args {
_______________________________________________
unionfs-cvs mailing list: http://unionfs.filesystems.org/
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs-cvs