Unionfs: display informational messages only if debug is on
authorErez_Zadok <ezk@cs.sunysb.edu>
Thu, 20 Sep 2007 04:59:05 +0000 (00:59 -0400)
committerErez Zadok <ezk@cs.sunysb.edu>
Fri, 29 Apr 2011 02:24:42 +0000 (22:24 -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 87cbb09e2493f205de5ae0a752e2d76009b25792..e69ccf6587deb0b3298d344f42b7b2b19d8b0aea 100644 (file)
@@ -394,8 +394,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 9e0742d8ebbe9bb6422b5a8eaae2fe7411bb74e0..08b572267dbdf1a2c0ed854491f0bad65e288ba1 100644 (file)
@@ -46,9 +46,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 7285ea721d011a9ecec3dfe4d06e797898515189..9ec5f82f378b2f6a38f7d753b2d605aa889d0751 100644 (file)
@@ -511,6 +511,8 @@ static inline void unionfs_mntput(struct dentry *dentry, int bindex)
 
 #ifdef CONFIG_UNION_FS_DEBUG
 
+#define dprintk                printk
+
 /* useful for tracking code reachability */
 #define UDBG printk("DBG:%s:%s:%d\n",__FILE__,__FUNCTION__,__LINE__)
 
@@ -547,6 +549,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)