unionfs-$(CONFIG_UNION_FS_XATTR) += xattr.o
unionfs-$(CONFIG_UNION_FS_DEBUG) += debug.o
+
+ifeq ($(CONFIG_UNION_FS_DEBUG),y)
+EXTRA_CFLAGS += -DDEBUG
+endif
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);
}
/* 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;
}
#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__)
#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)