diff options
author | Alex Elder <elder@inktank.com> | 2012-05-16 16:16:39 -0400 |
---|---|---|
committer | Alex Elder <elder@dreamhost.com> | 2012-05-17 09:18:12 -0400 |
commit | 74f1869f76d043bad12ec03b4d5f04a8c3d1f157 (patch) | |
tree | fcce410d255e2660fc82532c70de1b2f60a956c6 /fs | |
parent | 6c4a19158b96ea1fb8acbe0c1d5493d9dcd2f147 (diff) |
ceph: messenger: reduce args to create_authorizer
Make use of the new ceph_auth_handshake structure in order to reduce
the number of arguments passed to the create_authorizor method in
ceph_auth_client_ops. Use a local variable of that type as a
shorthand in the get_authorizer method definitions.
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ceph/mds_client.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index 42013c620488..b71ffd2c8094 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c | |||
@@ -3402,31 +3402,28 @@ static int get_authorizer(struct ceph_connection *con, | |||
3402 | struct ceph_mds_session *s = con->private; | 3402 | struct ceph_mds_session *s = con->private; |
3403 | struct ceph_mds_client *mdsc = s->s_mdsc; | 3403 | struct ceph_mds_client *mdsc = s->s_mdsc; |
3404 | struct ceph_auth_client *ac = mdsc->fsc->client->monc.auth; | 3404 | struct ceph_auth_client *ac = mdsc->fsc->client->monc.auth; |
3405 | struct ceph_auth_handshake *auth = &s->s_auth; | ||
3405 | int ret = 0; | 3406 | int ret = 0; |
3406 | 3407 | ||
3407 | if (force_new && s->s_auth.authorizer) { | 3408 | if (force_new && auth->authorizer) { |
3408 | ac->ops->destroy_authorizer(ac, s->s_auth.authorizer); | 3409 | ac->ops->destroy_authorizer(ac, auth->authorizer); |
3409 | s->s_auth.authorizer = NULL; | 3410 | auth->authorizer = NULL; |
3410 | } | 3411 | } |
3411 | if (s->s_auth.authorizer == NULL) { | 3412 | if (auth->authorizer == NULL) { |
3412 | if (ac->ops->create_authorizer) { | 3413 | if (ac->ops->create_authorizer) { |
3413 | ret = ac->ops->create_authorizer( | 3414 | ret = ac->ops->create_authorizer(ac, |
3414 | ac, CEPH_ENTITY_TYPE_MDS, | 3415 | CEPH_ENTITY_TYPE_MDS, auth); |
3415 | &s->s_auth.authorizer, | ||
3416 | &s->s_auth.authorizer_buf, | ||
3417 | &s->s_auth.authorizer_buf_len, | ||
3418 | &s->s_auth.authorizer_reply_buf, | ||
3419 | &s->s_auth.authorizer_reply_buf_len); | ||
3420 | if (ret) | 3416 | if (ret) |
3421 | return ret; | 3417 | return ret; |
3422 | } | 3418 | } |
3423 | } | 3419 | } |
3424 | 3420 | ||
3425 | *proto = ac->protocol; | 3421 | *proto = ac->protocol; |
3426 | *buf = s->s_auth.authorizer_buf; | 3422 | *buf = auth->authorizer_buf; |
3427 | *len = s->s_auth.authorizer_buf_len; | 3423 | *len = auth->authorizer_buf_len; |
3428 | *reply_buf = s->s_auth.authorizer_reply_buf; | 3424 | *reply_buf = auth->authorizer_reply_buf; |
3429 | *reply_len = s->s_auth.authorizer_reply_buf_len; | 3425 | *reply_len = auth->authorizer_reply_buf_len; |
3426 | |||
3430 | return 0; | 3427 | return 0; |
3431 | } | 3428 | } |
3432 | 3429 | ||