aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph/mon_client.c
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2010-03-24 21:52:30 -0700
committerSage Weil <sage@newdream.net>2010-05-17 15:25:16 -0700
commit7c315c552c7442eab73461de61dbcce579a31d3a (patch)
tree0821fb028c3a13360983bd9fb65599e8b5864aeb /fs/ceph/mon_client.c
parent6694d6b95cf3b41751e78815d05968fa2084d7bf (diff)
downloadkernel_samsung_smdk4412-7c315c552c7442eab73461de61dbcce579a31d3a.zip
kernel_samsung_smdk4412-7c315c552c7442eab73461de61dbcce579a31d3a.tar.gz
kernel_samsung_smdk4412-7c315c552c7442eab73461de61dbcce579a31d3a.tar.bz2
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/ceph/mon_client.c')
-rw-r--r--fs/ceph/mon_client.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/fs/ceph/mon_client.c b/fs/ceph/mon_client.c
index 5a67732..5bee925 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)
CEPH_ENTITY_TYPE_OSD | CEPH_ENTITY_TYPE_MDS;
/* msg pools */
- err = ceph_msgpool_init(&monc->msgpool_subscribe_ack,
- sizeof(struct ceph_mon_subscribe_ack), 1, false);
- if (err < 0)
+ monc->m_subscribe_ack = ceph_msg_new(CEPH_MSG_MON_SUBSCRIBE_ACK,
+ sizeof(struct ceph_mon_subscribe_ack),
+ 0, 0, NULL);
+ if (IS_ERR(monc->m_subscribe_ack)) {
+ err = PTR_ERR(monc->m_subscribe_ack);
+ monc->m_subscribe_ack = NULL;
goto out_monmap;
+ }
monc->m_auth_reply = ceph_msg_new(CEPH_MSG_AUTH_REPLY, 4096, 0, 0,
NULL);
if (IS_ERR(monc->m_auth_reply)) {
err = PTR_ERR(monc->m_auth_reply);
monc->m_auth_reply = NULL;
- goto out_pool;
+ goto out_subscribe_ack;
}
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)
out_auth_reply:
ceph_msg_put(monc->m_auth_reply);
-out_pool:
- ceph_msgpool_destroy(&monc->msgpool_subscribe_ack);
+out_subscribe_ack:
+ ceph_msg_put(monc->m_subscribe_ack);
out_monmap:
kfree(monc->monmap);
out:
@@ -698,7 +702,7 @@ void ceph_monc_stop(struct ceph_mon_client *monc)
ceph_msg_put(monc->m_auth);
ceph_msg_put(monc->m_auth_reply);
- ceph_msgpool_destroy(&monc->msgpool_subscribe_ack);
+ ceph_msg_put(monc->m_subscribe_ack);
kfree(monc->monmap);
}
@@ -815,7 +819,7 @@ static struct ceph_msg *mon_alloc_msg(struct ceph_connection *con,
switch (type) {
case CEPH_MSG_MON_SUBSCRIBE_ACK:
- m = ceph_msgpool_get(&monc->msgpool_subscribe_ack, front_len);
+ m = ceph_msg_get(monc->m_subscribe_ack);
break;
case CEPH_MSG_STATFS_REPLY:
return get_statfs_reply(con, hdr, skip);