aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2010-03-25 00:52:30 -0400
committerSage Weil <sage@newdream.net>2010-05-17 18:25:16 -0400
commit7c315c552c7442eab73461de61dbcce579a31d3a (patch)
tree0821fb028c3a13360983bd9fb65599e8b5864aeb /fs
parent6694d6b95cf3b41751e78815d05968fa2084d7bf (diff)
ceph: drop unnecessary msgpool for mon_client subscribe_ack
Preallocate a single message to reuse instead. Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs')
-rw-r--r--fs/ceph/mon_client.c20
-rw-r--r--fs/ceph/mon_client.h6
2 files changed, 13 insertions, 13 deletions
diff --git a/fs/ceph/mon_client.c b/fs/ceph/mon_client.c
index 5a67732fa6e1..5bee9250bf2a 100644
--- a/fs/ceph/mon_client.c
+++ b/fs/ceph/mon_client.c
@@ -634,17 +634,21 @@ int ceph_monc_init(struct ceph_mon_client *monc, struct ceph_client *cl)
634 CEPH_ENTITY_TYPE_OSD | CEPH_ENTITY_TYPE_MDS; 634 CEPH_ENTITY_TYPE_OSD | CEPH_ENTITY_TYPE_MDS;
635 635
636 /* msg pools */ 636 /* msg pools */
637 err = ceph_msgpool_init(&monc->msgpool_subscribe_ack, 637 monc->m_subscribe_ack = ceph_msg_new(CEPH_MSG_MON_SUBSCRIBE_ACK,
638 sizeof(struct ceph_mon_subscribe_ack), 1, false); 638 sizeof(struct ceph_mon_subscribe_ack),
639 if (err < 0) 639 0, 0, NULL);
640 if (IS_ERR(monc->m_subscribe_ack)) {
641 err = PTR_ERR(monc->m_subscribe_ack);
642 monc->m_subscribe_ack = NULL;
640 goto out_monmap; 643 goto out_monmap;
644 }
641 645
642 monc->m_auth_reply = ceph_msg_new(CEPH_MSG_AUTH_REPLY, 4096, 0, 0, 646 monc->m_auth_reply = ceph_msg_new(CEPH_MSG_AUTH_REPLY, 4096, 0, 0,
643 NULL); 647 NULL);
644 if (IS_ERR(monc->m_auth_reply)) { 648 if (IS_ERR(monc->m_auth_reply)) {
645 err = PTR_ERR(monc->m_auth_reply); 649 err = PTR_ERR(monc->m_auth_reply);
646 monc->m_auth_reply = NULL; 650 monc->m_auth_reply = NULL;
647 goto out_pool; 651 goto out_subscribe_ack;
648 } 652 }
649 653
650 monc->m_auth = ceph_msg_new(CEPH_MSG_AUTH, 4096, 0, 0, NULL); 654 monc->m_auth = ceph_msg_new(CEPH_MSG_AUTH, 4096, 0, 0, NULL);
@@ -672,8 +676,8 @@ int ceph_monc_init(struct ceph_mon_client *monc, struct ceph_client *cl)
672 676
673out_auth_reply: 677out_auth_reply:
674 ceph_msg_put(monc->m_auth_reply); 678 ceph_msg_put(monc->m_auth_reply);
675out_pool: 679out_subscribe_ack:
676 ceph_msgpool_destroy(&monc->msgpool_subscribe_ack); 680 ceph_msg_put(monc->m_subscribe_ack);
677out_monmap: 681out_monmap:
678 kfree(monc->monmap); 682 kfree(monc->monmap);
679out: 683out:
@@ -698,7 +702,7 @@ void ceph_monc_stop(struct ceph_mon_client *monc)
698 702
699 ceph_msg_put(monc->m_auth); 703 ceph_msg_put(monc->m_auth);
700 ceph_msg_put(monc->m_auth_reply); 704 ceph_msg_put(monc->m_auth_reply);
701 ceph_msgpool_destroy(&monc->msgpool_subscribe_ack); 705 ceph_msg_put(monc->m_subscribe_ack);
702 706
703 kfree(monc->monmap); 707 kfree(monc->monmap);
704} 708}
@@ -815,7 +819,7 @@ static struct ceph_msg *mon_alloc_msg(struct ceph_connection *con,
815 819
816 switch (type) { 820 switch (type) {
817 case CEPH_MSG_MON_SUBSCRIBE_ACK: 821 case CEPH_MSG_MON_SUBSCRIBE_ACK:
818 m = ceph_msgpool_get(&monc->msgpool_subscribe_ack, front_len); 822 m = ceph_msg_get(monc->m_subscribe_ack);
819 break; 823 break;
820 case CEPH_MSG_STATFS_REPLY: 824 case CEPH_MSG_STATFS_REPLY:
821 return get_statfs_reply(con, hdr, skip); 825 return get_statfs_reply(con, hdr, skip);
diff --git a/fs/ceph/mon_client.h b/fs/ceph/mon_client.h
index 2658e3e3b27c..0046deed0740 100644
--- a/fs/ceph/mon_client.h
+++ b/fs/ceph/mon_client.h
@@ -6,7 +6,6 @@
6#include <linux/rbtree.h> 6#include <linux/rbtree.h>
7 7
8#include "messenger.h" 8#include "messenger.h"
9#include "msgpool.h"
10 9
11struct ceph_client; 10struct ceph_client;
12struct ceph_mount_args; 11struct ceph_mount_args;
@@ -63,7 +62,7 @@ struct ceph_mon_client {
63 struct delayed_work delayed_work; 62 struct delayed_work delayed_work;
64 63
65 struct ceph_auth_client *auth; 64 struct ceph_auth_client *auth;
66 struct ceph_msg *m_auth, *m_auth_reply; 65 struct ceph_msg *m_auth, *m_auth_reply, *m_subscribe_ack;
67 int pending_auth; 66 int pending_auth;
68 67
69 bool hunting; 68 bool hunting;
@@ -72,9 +71,6 @@ struct ceph_mon_client {
72 struct ceph_connection *con; 71 struct ceph_connection *con;
73 bool have_fsid; 72 bool have_fsid;
74 73
75 /* msgs */
76 struct ceph_msgpool msgpool_subscribe_ack;
77
78 /* pending statfs requests */ 74 /* pending statfs requests */
79 struct rb_root statfs_request_tree; 75 struct rb_root statfs_request_tree;
80 int num_statfs_requests; 76 int num_statfs_requests;