From 10d484835012b6d172704693a8cdc43d3d1eef81 Mon Sep 17 00:00:00 2001 From: "Ricardo M. Correia" Date: Tue, 20 Jul 2010 15:59:27 -0700 Subject: [PATCH] Display DEBUG keyword during module load when --enable-debug is used. Just to be clear this only indicates that the ZFS code was built with or without debugging enabled. It says nothing about about how the SPL was built, they can be build differently by design. Signed-off-by: Ricardo M. Correia Signed-off-by: Brian Behlendorf --- module/zfs/zfs_ioctl.c | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/module/zfs/zfs_ioctl.c b/module/zfs/zfs_ioctl.c index ffb4c6515a..bf16e44b58 100644 --- a/module/zfs/zfs_ioctl.c +++ b/module/zfs/zfs_ioctl.c @@ -4631,6 +4631,12 @@ uint_t zfs_fsyncer_key; extern uint_t rrw_tsd_key; #endif +#ifdef DEBUG +#define ZFS_DEBUG_STR " (DEBUG mode)" +#else +#define ZFS_DEBUG_STR "" +#endif + int _init(void) { @@ -4639,18 +4645,11 @@ _init(void) spa_init(FREAD | FWRITE); zfs_init(); - if ((error = zvol_init()) != 0) { - zfs_fini(); - spa_fini(); - return (error); - } + if ((error = zvol_init()) != 0) + goto out1; - if ((error = zfs_attach()) != 0) { - (void)zvol_fini(); - zfs_fini(); - spa_fini(); - return (error); - } + if ((error = zfs_attach()) != 0) + goto out2; #ifdef HAVE_ZPL tsd_create(&zfs_fsyncer_key, NULL); @@ -4659,9 +4658,20 @@ _init(void) mutex_init(&zfs_share_lock, NULL, MUTEX_DEFAULT, NULL); #endif /* HAVE_ZPL */ - printk(KERN_INFO "ZFS: Loaded ZFS Filesystem v%s\n", ZFS_META_VERSION); + printk(KERN_NOTICE "ZFS: Loaded ZFS Filesystem v%s%s\n", + ZFS_META_VERSION, ZFS_DEBUG_STR); return (0); + +out2: + (void) zvol_fini(); +out1: + zfs_fini(); + spa_fini(); + printk(KERN_NOTICE "ZFS: Failed to Load ZFS Filesystem v%s%s" + ", rc = %d\n", ZFS_META_VERSION, ZFS_DEBUG_STR, error); + + return (error); } int @@ -4683,6 +4693,9 @@ _fini(void) tsd_destroy(&zfs_fsyncer_key); #endif /* HAVE_ZPL */ + printk(KERN_NOTICE "ZFS: Unloaded ZFS Filesystem v%s%s\n", + ZFS_META_VERSION, ZFS_DEBUG_STR); + return (0); }