Unionfs: use pr_debug() instead of custom dprintk()
authorErez Zadok <ezk@cs.sunysb.edu>
Sat, 29 Sep 2007 05:36:57 +0000 (01:36 -0400)
committerErez Zadok <ezk@cs.sunysb.edu>
Fri, 20 Jun 2014 00:40:49 +0000 (20:40 -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/lookup.c
fs/unionfs/union.h

index 87a0e65f60dbd33d5b1c88db088a129a775c8995..c2986861ee40d023f22fd030b05ebdd60cbcd49c 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 89f6a919737d0994739cd8f171df14fa45820487..5dde6af2bcf7eeba812c8686f5d194352ab06124 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 53668d668b02326b5efabd40c2688adccc02aa16..9c6fd5692b790810914f87e89fe4e99e0d86533c 100644 (file)
@@ -629,7 +629,7 @@ int init_lower_nd(struct nameidata *nd, unsigned int flags)
                 * We should never get here, for now.
                 * We can add new cases here later on.
                 */
-               dprintk("unionfs: unknown nameidata flag 0x%x\n", flags);
+               pr_debug("unionfs: unknown nameidata flag 0x%x\n", flags);
                BUG();
                break;
        }
index 4e153d2b3e94c31daf8004e7673372140f25164b..8a8374295be7c2fcc2e82a3e11d9c4605c6e5cda 100644 (file)
@@ -512,10 +512,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__)
@@ -554,8 +552,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)