Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ceph: use info returned by get_authorizer

Rather than passing a bunch of arguments to be filled in with the
content of the ceph_auth_handshake buffer now returned by the
get_authorizer method, just use the returned information in the
caller, and drop the unnecessary arguments.

Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>

authored by

Alex Elder and committed by
Alex Elder
8f43fb53 a3530df3

+10 -25
+1 -8
fs/ceph/mds_client.c
··· 3401 3401 * managed separately. Caller must *not* attempt to free it. 3402 3402 */ 3403 3403 static struct ceph_auth_handshake *get_authorizer(struct ceph_connection *con, 3404 - void **buf, int *len, int *proto, 3405 - void **reply_buf, int *reply_len, 3406 - int force_new) 3404 + int *proto, int force_new) 3407 3405 { 3408 3406 struct ceph_mds_session *s = con->private; 3409 3407 struct ceph_mds_client *mdsc = s->s_mdsc; ··· 3419 3421 if (ret) 3420 3422 return ERR_PTR(ret); 3421 3423 } 3422 - 3423 3424 *proto = ac->protocol; 3424 - *buf = auth->authorizer_buf; 3425 - *len = auth->authorizer_buf_len; 3426 - *reply_buf = auth->authorizer_reply_buf; 3427 - *reply_len = auth->authorizer_reply_buf_len; 3428 3425 3429 3426 return auth; 3430 3427 }
+1 -3
include/linux/ceph/messenger.h
··· 27 27 /* authorize an outgoing connection */ 28 28 struct ceph_auth_handshake *(*get_authorizer) ( 29 29 struct ceph_connection *con, 30 - void **buf, int *len, int *proto, 31 - void **reply_buf, int *reply_len, 32 - int force_new); 30 + int *proto, int force_new); 33 31 int (*verify_authorizer_reply) (struct ceph_connection *con, int len); 34 32 int (*invalidate_authorizer)(struct ceph_connection *con); 35 33
+7 -6
net/ceph/messenger.c
··· 671 671 672 672 mutex_unlock(&con->mutex); 673 673 674 - auth_buf = NULL; 675 - auth_len = 0; 676 674 auth_protocol = CEPH_AUTH_UNKNOWN; 677 - auth = con->ops->get_authorizer(con, &auth_buf, &auth_len, 678 - &auth_protocol, &con->auth_reply_buf, 679 - &con->auth_reply_buf_len, con->auth_retry); 675 + auth = con->ops->get_authorizer(con, &auth_protocol, con->auth_retry); 676 + 680 677 mutex_lock(&con->mutex); 681 678 682 679 if (IS_ERR(auth)) 683 680 return PTR_ERR(auth); 684 - 685 681 if (test_bit(CLOSED, &con->state) || test_bit(OPENING, &con->state)) 686 682 return -EAGAIN; 683 + 684 + auth_buf = auth->authorizer_buf; 685 + auth_len = auth->authorizer_buf_len; 686 + con->auth_reply_buf = auth->authorizer_reply_buf; 687 + con->auth_reply_buf_len = auth->authorizer_reply_buf_len; 687 688 688 689 con->out_connect.authorizer_protocol = cpu_to_le32(auth_protocol); 689 690 con->out_connect.authorizer_len = cpu_to_le32(auth_len);
+1 -8
net/ceph/osd_client.c
··· 2113 2113 * managed separately. Caller must *not* attempt to free it. 2114 2114 */ 2115 2115 static struct ceph_auth_handshake *get_authorizer(struct ceph_connection *con, 2116 - void **buf, int *len, int *proto, 2117 - void **reply_buf, int *reply_len, 2118 - int force_new) 2116 + int *proto, int force_new) 2119 2117 { 2120 2118 struct ceph_osd *o = con->private; 2121 2119 struct ceph_osd_client *osdc = o->o_osdc; ··· 2131 2133 if (ret) 2132 2134 return ERR_PTR(ret); 2133 2135 } 2134 - 2135 2136 *proto = ac->protocol; 2136 - *buf = auth->authorizer_buf; 2137 - *len = auth->authorizer_buf_len; 2138 - *reply_buf = auth->authorizer_reply_buf; 2139 - *reply_len = auth->authorizer_reply_buf_len; 2140 2137 2141 2138 return auth; 2142 2139 }