Unionfs: use pr_debug() instead of custom dprintk()
authorErez Zadok <ezk@cs.sunysb.edu>
Sun, 30 Sep 2007 01:49:18 +0000 (21:49 -0400)
committerErez Zadok <ezk@cs.sunysb.edu>
Sun, 30 Sep 2007 01:49:18 +0000 (21:49 -0400)
Also turn on DEBUG if CONFIG_UNION_FS_DEBUG is on

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

index cb4d68b290b3827b3cea276ba03b75fd3d67c6fe..06cae78ee947200a5454849c41d6870a71d49607 100644 (file)
@@ -11,3 +11,7 @@ unionfs-y := subr.o dentry.o file.o inode.o main.o super.o \
 unionfs-$(CONFIG_UNION_FS_XATTR) += xattr.o
 
 unionfs-$(CONFIG_UNION_FS_DEBUG) += debug.o
+
+ifeq ($(CONFIG_UNION_FS_DEBUG),y)
+EXTRA_CFLAGS += -DDEBUG
+endif
index 8550a347dc88db7d113deaebaa28a56988710a34..16df572ecdfbc8f0b491cd4c6a32dd97e380f680 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)) {
-               dprintk(KERN_DEBUG "unionfs: do delay copyup of \"%s\"\n",
-                       dentry->d_name.name);
+               pr_debug("unionfs: do delay copyup of \"%s\"\n",
+                        dentry->d_name.name);
                err = do_delayed_copyup(file);
        }
 
index 0abbc6dcd04f75b0957c42cda0e7adda5435c95f..c3d506cc7c2511c23e53aa6634e03bbb2ef91f8c 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)) {
-               dprintk(KERN_DEBUG "unionfs: unhashed dentry being "
-                       "revalidated: %*s\n",
-                       dentry->d_name.len, dentry->d_name.name);
+               pr_debug("unionfs: unhashed dentry being "
+                        "revalidated: %*s\n",
+                        dentry->d_name.len, dentry->d_name.name);
                goto out;
        }
 
index baedd6dac206ca188819c4525016627976036b3f..d130ee772f40a9219c2b93e7b6f904513f9d8087 100644 (file)
@@ -510,10 +510,8 @@ static inline void unionfs_mntput(struct dentry *dentry, int bindex)
 
 #ifdef CONFIG_UNION_FS_DEBUG
 
-#define dprintk(args...)               printk(args)
-
 /* useful for tracking code reachability */
-#define UDBG printk("DBG:%s:%s:%d\n",__FILE__,__FUNCTION__,__LINE__)
+#define UDBG pr_debug("DBG:%s:%s:%d\n",__FILE__,__FUNCTION__,__LINE__)
 
 #define unionfs_check_inode(i) __unionfs_check_inode((i),      \
        __FILE__,__FUNCTION__,__LINE__)
@@ -548,8 +546,6 @@ extern void __show_inode_counts(const struct inode *inode,
 
 #else /* not CONFIG_UNION_FS_DEBUG */
 
-#define dprintk(args...)               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)