aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2012-05-16 16:16:38 -0400
committerAlex Elder <elder@dreamhost.com>2012-05-17 09:18:12 -0400
commit6c4a19158b96ea1fb8acbe0c1d5493d9dcd2f147 (patch)
tree5fe6418eb57bf4e84f1eda9606a4a045ff08dcba /net
parented96af646011412c2bf1ffe860db170db355fae5 (diff)
ceph: define ceph_auth_handshake type
The definitions for the ceph_mds_session and ceph_osd both contain five fields related only to "authorizers." Encapsulate those fields into their own struct type, allowing for better isolation in some upcoming patches. Fix the #includes in "linux/ceph/osd_client.h" to lay out their more complete canonical path. Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'net')
-rw-r--r--net/ceph/osd_client.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index daa2716a0c30..66b09d6a1531 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -667,8 +667,8 @@ static void put_osd(struct ceph_osd *osd)
667 if (atomic_dec_and_test(&osd->o_ref)) { 667 if (atomic_dec_and_test(&osd->o_ref)) {
668 struct ceph_auth_client *ac = osd->o_osdc->client->monc.auth; 668 struct ceph_auth_client *ac = osd->o_osdc->client->monc.auth;
669 669
670 if (osd->o_authorizer) 670 if (osd->o_auth.authorizer)
671 ac->ops->destroy_authorizer(ac, osd->o_authorizer); 671 ac->ops->destroy_authorizer(ac, osd->o_auth.authorizer);
672 kfree(osd); 672 kfree(osd);
673 } 673 }
674} 674}
@@ -2117,27 +2117,27 @@ static int get_authorizer(struct ceph_connection *con,
2117 struct ceph_auth_client *ac = osdc->client->monc.auth; 2117 struct ceph_auth_client *ac = osdc->client->monc.auth;
2118 int ret = 0; 2118 int ret = 0;
2119 2119
2120 if (force_new && o->o_authorizer) { 2120 if (force_new && o->o_auth.authorizer) {
2121 ac->ops->destroy_authorizer(ac, o->o_authorizer); 2121 ac->ops->destroy_authorizer(ac, o->o_auth.authorizer);
2122 o->o_authorizer = NULL; 2122 o->o_auth.authorizer = NULL;
2123 } 2123 }
2124 if (o->o_authorizer == NULL) { 2124 if (o->o_auth.authorizer == NULL) {
2125 ret = ac->ops->create_authorizer( 2125 ret = ac->ops->create_authorizer(
2126 ac, CEPH_ENTITY_TYPE_OSD, 2126 ac, CEPH_ENTITY_TYPE_OSD,
2127 &o->o_authorizer, 2127 &o->o_auth.authorizer,
2128 &o->o_authorizer_buf, 2128 &o->o_auth.authorizer_buf,
2129 &o->o_authorizer_buf_len, 2129 &o->o_auth.authorizer_buf_len,
2130 &o->o_authorizer_reply_buf, 2130 &o->o_auth.authorizer_reply_buf,
2131 &o->o_authorizer_reply_buf_len); 2131 &o->o_auth.authorizer_reply_buf_len);
2132 if (ret) 2132 if (ret)
2133 return ret; 2133 return ret;
2134 } 2134 }
2135 2135
2136 *proto = ac->protocol; 2136 *proto = ac->protocol;
2137 *buf = o->o_authorizer_buf; 2137 *buf = o->o_auth.authorizer_buf;
2138 *len = o->o_authorizer_buf_len; 2138 *len = o->o_auth.authorizer_buf_len;
2139 *reply_buf = o->o_authorizer_reply_buf; 2139 *reply_buf = o->o_auth.authorizer_reply_buf;
2140 *reply_len = o->o_authorizer_reply_buf_len; 2140 *reply_len = o->o_auth.authorizer_reply_buf_len;
2141 return 0; 2141 return 0;
2142} 2142}
2143 2143
@@ -2148,7 +2148,7 @@ static int verify_authorizer_reply(struct ceph_connection *con, int len)
2148 struct ceph_osd_client *osdc = o->o_osdc; 2148 struct ceph_osd_client *osdc = o->o_osdc;
2149 struct ceph_auth_client *ac = osdc->client->monc.auth; 2149 struct ceph_auth_client *ac = osdc->client->monc.auth;
2150 2150
2151 return ac->ops->verify_authorizer_reply(ac, o->o_authorizer, len); 2151 return ac->ops->verify_authorizer_reply(ac, o->o_auth.authorizer, len);
2152} 2152}
2153 2153
2154static int invalidate_authorizer(struct ceph_connection *con) 2154static int invalidate_authorizer(struct ceph_connection *con)