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>
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);
}
/* 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;
}
#ifdef CONFIG_UNION_FS_DEBUG
+#define dprintk printk
+
/* useful for tracking code reachability */
#define UDBG printk("DBG:%s:%s:%d\n",__FILE__,__FUNCTION__,__LINE__)
#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)