-/**@brief Debug mask: ext4_blockdev.c*/
-#define EXT4_DEBUG_BLOCKDEV (1 << 0)
-
-/**@brief Debug mask: ext4_fs.c*/
-#define EXT4_DEBUG_FS (1 << 1)
-
-/**@brief Debug mask: ext4_balloc.c*/
-#define EXT4_DEBUG_BALLOC (1 << 2)
-
-/**@brief Debug mask: ext4_bitmap.c*/
-#define EXT4_DEBUG_BITMAP (1 << 3)
-
-/**@brief Debug mask: ext4_dir_idx.c*/
-#define EXT4_DEBUG_DIR_IDX (1 << 4)
-
-/**@brief Debug mask: ext4_dir.c*/
-#define EXT4_DEBUG_DIR (1 << 5)
-
-/**@brief Debug mask: ext4_ialloc.c*/
-#define EXT4_DEBUG_IALLOC (1 << 6)
-
-/**@brief Debug mask: ext4_inode.c*/
-#define EXT4_DEBUG_INODE (1 << 7)
-
-/**@brief Debug mask: ext4_super.c*/
-#define EXT4_DEBUG_SUPER (1 << 8)
-
-/**@brief Debug mask: ext4_bcache.c*/
-#define EXT4_DEBUG_BCACHE (1 << 9)
-
-/**@brief Debug mask: ext4_extents.c*/
-#define EXT4_DEBUG_EXTENTS (1 << 10)
-
-/**@brief All debug printf enabled.*/
-#define EXT4_DEBUG_ALL (0xFFFFFFFF)
-
-/**@brief Global mask debug settings.
+#define DEBUG_BALLOC (1 << 0)
+#define DEBUG_BCACHE (1 << 1)
+#define DEBUG_BITMAP (1 << 2)
+#define DEBUG_BLOCK_GROUP (1 << 3)
+#define DEBUG_BLOCKDEV (1 << 4)
+#define DEBUG_DIR_IDX (1 << 5)
+#define DEBUG_DIR (1 << 6)
+#define DEBUG_EXTENT (1 << 7)
+#define DEBUG_FS (1 << 8)
+#define DEBUG_HASH (1 << 9)
+#define DEBUG_IALLOC (1 << 10)
+#define DEBUG_INODE (1 << 11)
+#define DEBUG_SUPER (1 << 12)
+#define DEBUG_XATTR (1 << 13)
+#define DEBUG_MKFS (1 << 14)
+#define DEBUG_EXT4 (1 << 15)
+
+#define DEBUG_ALL (0xFFFFFFFF)
+
+static inline const char *ext4_dmask_id2str(uint32_t m)
+{
+ switch(m) {
+ case DEBUG_BALLOC:
+ return "ext4_balloc: ";
+ case DEBUG_BCACHE:
+ return "ext4_bcache: ";
+ case DEBUG_BITMAP:
+ return "ext4_bitmap: ";
+ case DEBUG_BLOCK_GROUP:
+ return "ext4_block_group: ";
+ case DEBUG_BLOCKDEV:
+ return "ext4_blockdev: ";
+ case DEBUG_DIR_IDX:
+ return "ext4_dir_idx: ";
+ case DEBUG_DIR:
+ return "ext4_dir: ";
+ case DEBUG_EXTENT:
+ return "ext4_extent: ";
+ case DEBUG_FS:
+ return "ext4_fs: ";
+ case DEBUG_HASH:
+ return "ext4_hash: ";
+ case DEBUG_IALLOC:
+ return "ext4_ialloc: ";
+ case DEBUG_INODE:
+ return "ext4_inode: ";
+ case DEBUG_SUPER:
+ return "ext4_super: ";
+ case DEBUG_XATTR:
+ return "ext4_xattr: ";
+ case DEBUG_MKFS:
+ return "ext4_mkfs: ";
+ case DEBUG_EXT4:
+ return "ext4: ";
+ }
+ return "";
+}
+#define DBG_NONE " "
+#define DBG_INFO "[info] "
+#define DBG_WARN "[warn] "
+#define DBG_ERROR "[error] "
+
+/**@brief Global mask debug set.