vfs_catia: add debug class for that module
authorGuenter Kukkukk <kukks@samba.org>
Wed, 27 Feb 2013 04:34:05 +0000 (05:34 +0100)
committerKarolin Seeger <kseeger@samba.org>
Thu, 14 Mar 2013 09:51:42 +0000 (10:51 +0100)
Signed-off-by: Guenter Kukkukk <kukks@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 58ac0d30aba4a0c0aab2a358b42e17d8c0e896ca)

source3/modules/vfs_catia.c

index 31b9f188d36c44663f8f67394423228273927342..8a33e50074d5fbc664b780a365c9e3f3a73b2c23 100644 (file)
 #include "includes.h"
 #include "smbd/smbd.h"
 
+static int vfs_catia_debug_level = DBGC_VFS;
+
+#undef DBGC_CLASS
+#define DBGC_CLASS vfs_catia_debug_level
+
 #define GLOBAL_SNUM     0xFFFFFFF
 #define MAP_SIZE        0xFF
 #define MAP_NUM         0x101 /* max unicode charval / MAP_SIZE */
@@ -1020,6 +1025,23 @@ static struct vfs_fn_pointers vfs_catia_fns = {
 
 NTSTATUS vfs_catia_init(void)
 {
-        return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "catia",
+       NTSTATUS ret;
+
+        ret = smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "catia",
                                &vfs_catia_fns);
+       if (!NT_STATUS_IS_OK(ret))
+               return ret;
+
+       vfs_catia_debug_level = debug_add_class("catia");
+       if (vfs_catia_debug_level == -1) {
+               vfs_catia_debug_level = DBGC_VFS;
+               DEBUG(0, ("vfs_catia: Couldn't register custom debugging "
+                         "class!\n"));
+       } else {
+               DEBUG(10, ("vfs_catia: Debug class number of "
+                          "'catia': %d\n", vfs_catia_debug_level));
+       }
+
+       return ret;
+
 }