]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
kclient: leak detections tool
authorYehuda Sadeh <yehuda@hq.newdream.net>
Sat, 18 Oct 2008 00:14:25 +0000 (17:14 -0700)
committerYehuda Sadeh <yehuda@hq.newdream.net>
Mon, 20 Oct 2008 22:46:12 +0000 (15:46 -0700)
src/kernel/Makefile
src/kernel/ceph_debug.h
src/kernel/dir.c
src/kernel/messenger.c
src/kernel/osd_client.c
src/kernel/proc.c
src/kernel/super.c

index cbebd9cf752d0b3616bcca88dfd3285854ba5429..7926eec83b121fed3f622c194abc28e43fe59aa3 100644 (file)
@@ -12,7 +12,7 @@ ceph-objs := super.o inode.o dir.o file.o addr.o ioctl.o \
        mds_client.o mdsmap.o \
        mon_client.o \
        osd_client.o osdmap.o crush/crush.o crush/mapper.o \
-       proc.o
+       proc.o ceph_tools.o
 
 else
 #Otherwise we were called directly from the command
index 288b34322289c91f6a7dbc697bb8794bca1dcea1..f9daa8f8b550851fac4b7628aa243f3efe6e2b36 100644 (file)
@@ -25,6 +25,7 @@ extern int ceph_debug_snap;
 extern int ceph_debug_super;
 extern int ceph_debug_protocol;
 extern int ceph_debug_proc;
+extern int ceph_debug_tools;
 
 #define DOUT_MASK_ADDR         0x00000001
 #define DOUT_MASK_CAPS         0x00000002
@@ -43,6 +44,7 @@ extern int ceph_debug_proc;
 #define DOUT_MASK_SUPER                0x00004000
 #define DOUT_MASK_PROTOCOL     0x00008000
 #define DOUT_MASK_PROC         0x00010000
+#define DOUT_MASK_TOOLS                0x00020000
 
 #define DOUT_UNMASKABLE        0x80000000
 
@@ -69,6 +71,7 @@ static struct _debug_mask_name _debug_mask_names[] = {
                {DOUT_MASK_SUPER, "super"},
                {DOUT_MASK_PROTOCOL, "protocol"},
                {DOUT_MASK_PROC, "proc"},
+               {DOUT_MASK_TOOLS, "tools"},
                {0, NULL}
 };
 
index 424e396d51d2539f96aa63ac9bd11c488e1cf5e7..90152d91fb663e7d98dee8ce6986e796bb8b00de 100644 (file)
@@ -1,3 +1,6 @@
+#include <linux/namei.h>
+#include <linux/sched.h>
+
 #include "ceph_debug.h"
 
 int ceph_debug_dir = -1;
@@ -6,9 +9,6 @@ int ceph_debug_dir = -1;
 #define DOUT_PREFIX "dir: "
 #include "super.h"
 
-#include <linux/namei.h>
-#include <linux/sched.h>
-
 const struct inode_operations ceph_dir_iops;
 const struct file_operations ceph_dir_fops;
 struct dentry_operations ceph_dentry_ops;
index 1d669faf2d48f99dd25052f2a918538808716798..41d83cb7b1ec843487c68d09a9db712be9a90767 100644 (file)
@@ -2260,6 +2260,7 @@ struct ceph_msg *ceph_msg_new(int type, int front_len,
        struct ceph_msg *m;
 
        m = kmalloc(sizeof(*m), GFP_NOFS);
+       dout(1, "ceph_msg_new alloc %p\n", m);
        if (m == NULL)
                goto out;
        atomic_set(&m->nref, 1);
@@ -2317,7 +2318,7 @@ void ceph_msg_put(struct ceph_msg *m)
                WARN_ON(1);
        }
        if (atomic_dec_and_test(&m->nref)) {
-               dout(20, "ceph_msg_put last one on %p\n", m);
+               dout(1, "ceph_msg_put last one on %p\n", m);
                WARN_ON(!list_empty(&m->list_head));
                kfree(m->front.iov_base);
                kfree(m);
index bdb93231e59f59ea76e866ad31265b1a61550a47..fe924320688eedcf67d1cdea683e5a1636e9739a 100644 (file)
@@ -71,7 +71,7 @@ static void get_request(struct ceph_osd_request *req)
 
 void ceph_osdc_put_request(struct ceph_osd_request *req)
 {
-       dout(10, "put_request %p %d -> %d\n", req, atomic_read(&req->r_ref),
+       dout(1, "put_request %p %d -> %d\n", req, atomic_read(&req->r_ref),
             atomic_read(&req->r_ref)-1);
        BUG_ON(atomic_read(&req->r_ref) <= 0);
        if (atomic_dec_and_test(&req->r_ref)) {
index 217d44c07a7722d4a126aa13bfd6d73bc1fa2966..f51b5e09f62b6279aa1c455ea2dff31a460d9871 100644 (file)
@@ -182,5 +182,6 @@ void ceph_proc_cleanup(void)
        remove_proc_entry("debug", proc_fs_ceph);
        remove_proc_entry("debug_msgr", proc_fs_ceph);
        remove_proc_entry("debug_console", proc_fs_ceph);
+       remove_proc_entry("debug_mask", proc_fs_ceph);
        remove_proc_entry("fs/ceph", NULL);
 }
index 8c798ff4dba53854e9eef695f450e61eabb74800..f56f1f0676a4246bdd3c650a161cd514b71c7be5 100644 (file)
@@ -8,6 +8,7 @@
 #include <linux/string.h>
 #include <linux/version.h>
 #include <linux/backing-dev.h>
+#include <linux/statfs.h>
 
 /* debug levels; defined in super.h */
 
@@ -31,7 +32,6 @@ int ceph_debug_super = -1;   /* for this file */
 #define DOUT_PREFIX "super: "
 #include "super.h"
 
-#include <linux/statfs.h>
 #include "mon_client.h"
 
 void ceph_dispatch(void *p, struct ceph_msg *msg);
@@ -1066,6 +1066,10 @@ static int __init init_ceph(void)
 
        dout(1, "init_ceph\n");
 
+#ifdef CEPH_BOOKKEEPER
+       ceph_bookkeeper_init();
+#endif
+
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25)
        ret = -ENOMEM;
        ceph_kobj = kobject_create_and_add("ceph", fs_kobj);
@@ -1116,6 +1120,9 @@ static void __exit exit_ceph(void)
        kobject_put(ceph_kobj);
        ceph_kobj = 0;
 #endif
+#ifdef CEPH_BOOKKEEPER
+       ceph_bookkeeper_finalize();
+#endif
 }
 
 module_init(init_ceph);