Skip to content

Commit 8f43fb5

Browse files
Alex ElderAlex Elder
authored andcommitted
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>
1 parent a3530df commit 8f43fb5

4 files changed

Lines changed: 10 additions & 25 deletions

File tree

‎fs/ceph/mds_client.c‎

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3401,9 +3401,7 @@ static void dispatch(struct ceph_connection *con, struct ceph_msg *msg)
34013401
* managed separately. Caller must *not* attempt to free it.
34023402
*/
34033403
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)
34073405
{
34083406
struct ceph_mds_session *s = con->private;
34093407
struct ceph_mds_client *mdsc = s->s_mdsc;
@@ -3421,12 +3419,7 @@ static struct ceph_auth_handshake *get_authorizer(struct ceph_connection *con,
34213419
if (ret)
34223420
return ERR_PTR(ret);
34233421
}
3424-
34253422
*proto = ac->protocol;
3426-
*buf = auth->authorizer_buf;
3427-
*len = auth->authorizer_buf_len;
3428-
*reply_buf = auth->authorizer_reply_buf;
3429-
*reply_len = auth->authorizer_reply_buf_len;
34303423

34313424
return auth;
34323425
}

‎include/linux/ceph/messenger.h‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ struct ceph_connection_operations {
2727
/* authorize an outgoing connection */
2828
struct ceph_auth_handshake *(*get_authorizer) (
2929
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);
3331
int (*verify_authorizer_reply) (struct ceph_connection *con, int len);
3432
int (*invalidate_authorizer)(struct ceph_connection *con);
3533

‎net/ceph/messenger.c‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -671,20 +671,21 @@ static int prepare_connect_authorizer(struct ceph_connection *con)
671671

672672
mutex_unlock(&con->mutex);
673673

674-
auth_buf = NULL;
675-
auth_len = 0;
676674
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+
680677
mutex_lock(&con->mutex);
681678

682679
if (IS_ERR(auth))
683680
return PTR_ERR(auth);
684-
685681
if (test_bit(CLOSED, &con->state) || test_bit(OPENING, &con->state))
686682
return -EAGAIN;
687683

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;
688+
688689
con->out_connect.authorizer_protocol = cpu_to_le32(auth_protocol);
689690
con->out_connect.authorizer_len = cpu_to_le32(auth_len);
690691

‎net/ceph/osd_client.c‎

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2113,9 +2113,7 @@ static void put_osd_con(struct ceph_connection *con)
21132113
* managed separately. Caller must *not* attempt to free it.
21142114
*/
21152115
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)
21192117
{
21202118
struct ceph_osd *o = con->private;
21212119
struct ceph_osd_client *osdc = o->o_osdc;
@@ -2133,12 +2131,7 @@ static struct ceph_auth_handshake *get_authorizer(struct ceph_connection *con,
21332131
if (ret)
21342132
return ERR_PTR(ret);
21352133
}
2136-
21372134
*proto = ac->protocol;
2138-
*buf = auth->authorizer_buf;
2139-
*len = auth->authorizer_buf_len;
2140-
*reply_buf = auth->authorizer_reply_buf;
2141-
*reply_len = auth->authorizer_reply_buf_len;
21422135

21432136
return auth;
21442137
}

0 commit comments

Comments
 (0)