Unionfs: display informational messages only if debug is on
authorErez_Zadok <ezk@cs.sunysb.edu>
Fri, 16 Nov 2007 18:46:19 +0000 (13:46 -0500)
committerRachita Kothiyal <rachita@dewey.fsl.cs.sunysb.edu>
Thu, 1 May 2008 23:03:07 +0000 (19:03 -0400)
This is to avoid filling the console/logs with messages that are primarily
of debugging use.

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/commonfops.c
fs/unionfs/dentry.c
fs/unionfs/union.h

index ea12d6ace1bed120f88dbf40e50c60d81f34474e..5bedbcc0d13e78b324794dccd26c0ac97300ab78 100644 (file)
@@ -461,8 +461,8 @@ int unionfs_file_revalidate(struct file *file, bool willwrite)
        if (willwrite && IS_WRITE_FLAG(file->f_flags) &&
            !IS_WRITE_FLAG(unionfs_lower_file(file)->f_flags) &&
            is_robranch(dentry)) {
-               printk(KERN_DEBUG "unionfs: do delay copyup of \"%s\"\n",
-                      dentry->d_name.name);
+               dprintk(KERN_DEBUG "unionfs: do delay copyup of \"%s\"\n",
+                       dentry->d_name.name);
                err = do_delayed_copyup(file);
        }
 
index c0a0d5503efb2e856af5209b39a5e816114fa429..8d7b5527821807136d842a66948df31698038a42 100644 (file)
@@ -62,9 +62,9 @@ static bool __unionfs_d_revalidate_one(struct dentry *dentry,
 
        /* if the dentry is unhashed, do NOT revalidate */
        if (d_deleted(dentry)) {
-               printk(KERN_DEBUG "unionfs: unhashed dentry being "
-                      "revalidated: %*s\n",
-                      dentry->d_name.len, dentry->d_name.name);
+               dprintk(KERN_DEBUG "unionfs: unhashed dentry being "
+                       "revalidated: %*s\n",
+                       dentry->d_name.len, dentry->d_name.name);
                goto out;
        }
 
index eaa0289b507b24042896d4093bf4f2b3e1b3940b..77a9bae5c3d56c871a285f3f75f66c9a0e5118ab 100644 (file)
@@ -538,6 +538,8 @@ static inline struct dentry *__odf_dstack_pop(struct dentry_stack *stack)
 
 #ifdef CONFIG_UNION_FS_DEBUG
 
+#define dprintk                printk
+
 /* useful for tracking code reachability */
 #define UDBG printk("DBG:%s:%s:%d\n",__FILE__,__FUNCTION__,__LINE__)
 
@@ -574,6 +576,8 @@ extern void __show_inode_counts(const struct inode *inode,
 
 #else /* not CONFIG_UNION_FS_DEBUG */
 
+#define dprintk(x...)          do { ; } while (0)
+
 /* we leave useful hooks for these check functions throughout the code */
 #define unionfs_check_inode(i)         do { } while(0)
 #define unionfs_check_dentry(d)        do { } while(0)