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:13 -0400 |
commit | 729796be9190f57ca40ccca315e8ad34a1eb8fef (patch) | |
tree | 7b65cc553baf72fe3efc23f8ecc2228e1c0e782d /net/ceph/messenger.c | |
parent | 8f43fb53894079bf0caab6e348ceaffe7adc651a (diff) |
ceph: return pointer from prepare_connect_authorizer()
Change prepare_connect_authorizer() so it returns a pointer (or
pointer-coded error).
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'net/ceph/messenger.c')
-rw-r--r-- | net/ceph/messenger.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index 6d82c1a1a89b..f92d564c1505 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c | |||
@@ -653,7 +653,7 @@ static void prepare_write_keepalive(struct ceph_connection *con) | |||
653 | * Connection negotiation. | 653 | * Connection negotiation. |
654 | */ | 654 | */ |
655 | 655 | ||
656 | static int prepare_connect_authorizer(struct ceph_connection *con) | 656 | static struct ceph_auth_handshake *prepare_connect_authorizer(struct ceph_connection *con) |
657 | { | 657 | { |
658 | void *auth_buf; | 658 | void *auth_buf; |
659 | int auth_len; | 659 | int auth_len; |
@@ -664,7 +664,7 @@ static int prepare_connect_authorizer(struct ceph_connection *con) | |||
664 | con->out_connect.authorizer_protocol = CEPH_AUTH_UNKNOWN; | 664 | con->out_connect.authorizer_protocol = CEPH_AUTH_UNKNOWN; |
665 | con->out_connect.authorizer_len = 0; | 665 | con->out_connect.authorizer_len = 0; |
666 | 666 | ||
667 | return 0; | 667 | return NULL; |
668 | } | 668 | } |
669 | 669 | ||
670 | /* Can't hold the mutex while getting authorizer */ | 670 | /* Can't hold the mutex while getting authorizer */ |
@@ -677,9 +677,9 @@ static int prepare_connect_authorizer(struct ceph_connection *con) | |||
677 | mutex_lock(&con->mutex); | 677 | mutex_lock(&con->mutex); |
678 | 678 | ||
679 | if (IS_ERR(auth)) | 679 | if (IS_ERR(auth)) |
680 | return PTR_ERR(auth); | 680 | return auth; |
681 | if (test_bit(CLOSED, &con->state) || test_bit(OPENING, &con->state)) | 681 | if (test_bit(CLOSED, &con->state) || test_bit(OPENING, &con->state)) |
682 | return -EAGAIN; | 682 | return ERR_PTR(-EAGAIN); |
683 | 683 | ||
684 | auth_buf = auth->authorizer_buf; | 684 | auth_buf = auth->authorizer_buf; |
685 | auth_len = auth->authorizer_buf_len; | 685 | auth_len = auth->authorizer_buf_len; |
@@ -692,7 +692,7 @@ static int prepare_connect_authorizer(struct ceph_connection *con) | |||
692 | if (auth_len) | 692 | if (auth_len) |
693 | ceph_con_out_kvec_add(con, auth_len, auth_buf); | 693 | ceph_con_out_kvec_add(con, auth_len, auth_buf); |
694 | 694 | ||
695 | return 0; | 695 | return auth; |
696 | } | 696 | } |
697 | 697 | ||
698 | /* | 698 | /* |
@@ -712,7 +712,7 @@ static int prepare_write_connect(struct ceph_connection *con) | |||
712 | { | 712 | { |
713 | unsigned global_seq = get_global_seq(con->msgr, 0); | 713 | unsigned global_seq = get_global_seq(con->msgr, 0); |
714 | int proto; | 714 | int proto; |
715 | int ret; | 715 | struct ceph_auth_handshake *auth; |
716 | 716 | ||
717 | switch (con->peer_name.type) { | 717 | switch (con->peer_name.type) { |
718 | case CEPH_ENTITY_TYPE_MON: | 718 | case CEPH_ENTITY_TYPE_MON: |
@@ -739,9 +739,9 @@ static int prepare_write_connect(struct ceph_connection *con) | |||
739 | con->out_connect.flags = 0; | 739 | con->out_connect.flags = 0; |
740 | 740 | ||
741 | ceph_con_out_kvec_add(con, sizeof (con->out_connect), &con->out_connect); | 741 | ceph_con_out_kvec_add(con, sizeof (con->out_connect), &con->out_connect); |
742 | ret = prepare_connect_authorizer(con); | 742 | auth = prepare_connect_authorizer(con); |
743 | if (ret) | 743 | if (IS_ERR(auth)) |
744 | return ret; | 744 | return PTR_ERR(auth); |
745 | 745 | ||
746 | con->out_more = 0; | 746 | con->out_more = 0; |
747 | set_bit(WRITE_PENDING, &con->state); | 747 | set_bit(WRITE_PENDING, &con->state); |