diff options
author | Yehuda Sadeh <yehuda@hq.newdream.net> | 2009-02-13 15:02:51 -0800 |
---|---|---|
committer | Yehuda Sadeh <yehuda@hq.newdream.net> | 2009-02-13 15:02:51 -0800 |
commit | c5ed89a98fe9bc6a037dc4b31e6c596f1f1741c6 (patch) | |
tree | 153ce676bc03866aa6b3684b09aa4934ce3ac03e | |
parent | c98bb11a3986f8d03e9db1b823767e769306ce04 (diff) | |
download | ceph-c5ed89a98fe9bc6a037dc4b31e6c596f1f1741c6.tar.gz |
kclient: fix proc cleanup
-rw-r--r-- | src/kernel/proc.c | 15 | ||||
-rw-r--r-- | src/kernel/super.c | 1 | ||||
-rw-r--r-- | src/kernel/super.h | 1 |
3 files changed, 13 insertions, 4 deletions
diff --git a/src/kernel/proc.c b/src/kernel/proc.c index 8e4f1bbbd33..7f462d0386d 100644 --- a/src/kernel/proc.c +++ b/src/kernel/proc.c @@ -183,17 +183,15 @@ void ceph_proc_cleanup(void) { struct list_head *p; struct ceph_client *client; - char str[16]; spin_lock(&ceph_clients_list_lock); list_for_each(p, &ceph_clients) { client = list_entry(p, struct ceph_client, clients_all); - snprintf(str, sizeof(str), "%d", client->whoami); - remove_proc_entry(str, proc_fs_ceph_clients); + ceph_proc_unregister_client(client); } spin_unlock(&ceph_clients_list_lock); - remove_proc_entry("clients", proc_fs_ceph_clients); + remove_proc_entry("clients", proc_fs_ceph); remove_proc_entry("debug", proc_fs_ceph); remove_proc_entry("debug_msgr", proc_fs_ceph); remove_proc_entry("debug_console", proc_fs_ceph); @@ -273,3 +271,12 @@ void ceph_proc_register_client(struct ceph_client *client) proc_create_data("data", 0, client->proc_entry, &ceph_client_data_fops, client); } + +void ceph_proc_unregister_client(struct ceph_client *client) +{ + char str[16]; + + remove_proc_entry("data", client->proc_entry); + snprintf(str, sizeof(str), "%d", client->whoami); + remove_proc_entry(str, proc_fs_ceph_clients); +} diff --git a/src/kernel/super.c b/src/kernel/super.c index 640235dc0d7..ed33f35fad9 100644 --- a/src/kernel/super.c +++ b/src/kernel/super.c @@ -690,6 +690,7 @@ static void ceph_destroy_client(struct ceph_client *client) destroy_workqueue(client->trunc_wq); if (client->msgr) ceph_messenger_destroy(client->msgr); + ceph_proc_unregister_client(client); kfree(client); dout(10, "destroy_client %p done\n", client); } diff --git a/src/kernel/super.h b/src/kernel/super.h index 48b4f69b23b..a7c9cf3b524 100644 --- a/src/kernel/super.h +++ b/src/kernel/super.h @@ -791,6 +791,7 @@ extern const struct export_operations ceph_export_ops; extern int ceph_proc_init(void); extern void ceph_proc_cleanup(void); extern void ceph_proc_register_client(struct ceph_client *client); +extern void ceph_proc_unregister_client(struct ceph_client *client); static inline struct inode *get_dentry_parent_inode(struct dentry *dentry) { |