diff options
| -rw-r--r-- | fs/ceph/mds_client.c | 27 | ||||
| -rw-r--r-- | include/linux/ceph/auth.h | 4 | ||||
| -rw-r--r-- | net/ceph/auth_none.c | 15 | ||||
| -rw-r--r-- | net/ceph/auth_x.c | 15 | ||||
| -rw-r--r-- | net/ceph/osd_client.c | 28 |
5 files changed, 39 insertions, 50 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 | ||
diff --git a/include/linux/ceph/auth.h b/include/linux/ceph/auth.h index 5b774d141e09..d4080f309b56 100644 --- a/include/linux/ceph/auth.h +++ b/include/linux/ceph/auth.h | |||
| @@ -51,9 +51,7 @@ struct ceph_auth_client_ops { | |||
| 51 | * the response to authenticate the service. | 51 | * the response to authenticate the service. |
| 52 | */ | 52 | */ |
| 53 | int (*create_authorizer)(struct ceph_auth_client *ac, int peer_type, | 53 | int (*create_authorizer)(struct ceph_auth_client *ac, int peer_type, |
| 54 | struct ceph_authorizer **a, | 54 | struct ceph_auth_handshake *auth); |
| 55 | void **buf, size_t *len, | ||
| 56 | void **reply_buf, size_t *reply_len); | ||
| 57 | int (*verify_authorizer_reply)(struct ceph_auth_client *ac, | 55 | int (*verify_authorizer_reply)(struct ceph_auth_client *ac, |
| 58 | struct ceph_authorizer *a, size_t len); | 56 | struct ceph_authorizer *a, size_t len); |
| 59 | void (*destroy_authorizer)(struct ceph_auth_client *ac, | 57 | void (*destroy_authorizer)(struct ceph_auth_client *ac, |
diff --git a/net/ceph/auth_none.c b/net/ceph/auth_none.c index 214c2bb43d62..925ca583c09c 100644 --- a/net/ceph/auth_none.c +++ b/net/ceph/auth_none.c | |||
| @@ -59,9 +59,7 @@ static int handle_reply(struct ceph_auth_client *ac, int result, | |||
| 59 | */ | 59 | */ |
| 60 | static int ceph_auth_none_create_authorizer( | 60 | static int ceph_auth_none_create_authorizer( |
| 61 | struct ceph_auth_client *ac, int peer_type, | 61 | struct ceph_auth_client *ac, int peer_type, |
| 62 | struct ceph_authorizer **a, | 62 | struct ceph_auth_handshake *auth) |
| 63 | void **buf, size_t *len, | ||
| 64 | void **reply_buf, size_t *reply_len) | ||
| 65 | { | 63 | { |
| 66 | struct ceph_auth_none_info *ai = ac->private; | 64 | struct ceph_auth_none_info *ai = ac->private; |
| 67 | struct ceph_none_authorizer *au = &ai->au; | 65 | struct ceph_none_authorizer *au = &ai->au; |
| @@ -82,11 +80,12 @@ static int ceph_auth_none_create_authorizer( | |||
| 82 | dout("built authorizer len %d\n", au->buf_len); | 80 | dout("built authorizer len %d\n", au->buf_len); |
| 83 | } | 81 | } |
| 84 | 82 | ||
| 85 | *a = (struct ceph_authorizer *)au; | 83 | auth->authorizer = (struct ceph_authorizer *) au; |
| 86 | *buf = au->buf; | 84 | auth->authorizer_buf = au->buf; |
| 87 | *len = au->buf_len; | 85 | auth->authorizer_buf_len = au->buf_len; |
| 88 | *reply_buf = au->reply_buf; | 86 | auth->authorizer_reply_buf = au->reply_buf; |
| 89 | *reply_len = sizeof(au->reply_buf); | 87 | auth->authorizer_reply_buf_len = sizeof (au->reply_buf); |
| 88 | |||
| 90 | return 0; | 89 | return 0; |
| 91 | 90 | ||
| 92 | bad2: | 91 | bad2: |
diff --git a/net/ceph/auth_x.c b/net/ceph/auth_x.c index 1587dc6010c6..a16bf14eb027 100644 --- a/net/ceph/auth_x.c +++ b/net/ceph/auth_x.c | |||
| @@ -526,9 +526,7 @@ static int ceph_x_handle_reply(struct ceph_auth_client *ac, int result, | |||
| 526 | 526 | ||
| 527 | static int ceph_x_create_authorizer( | 527 | static int ceph_x_create_authorizer( |
| 528 | struct ceph_auth_client *ac, int peer_type, | 528 | struct ceph_auth_client *ac, int peer_type, |
| 529 | struct ceph_authorizer **a, | 529 | struct ceph_auth_handshake *auth) |
| 530 | void **buf, size_t *len, | ||
| 531 | void **reply_buf, size_t *reply_len) | ||
| 532 | { | 530 | { |
| 533 | struct ceph_x_authorizer *au; | 531 | struct ceph_x_authorizer *au; |
| 534 | struct ceph_x_ticket_handler *th; | 532 | struct ceph_x_ticket_handler *th; |
| @@ -548,11 +546,12 @@ static int ceph_x_create_authorizer( | |||
| 548 | return ret; | 546 | return ret; |
| 549 | } | 547 | } |
| 550 | 548 | ||
| 551 | *a = (struct ceph_authorizer *)au; | 549 | auth->authorizer = (struct ceph_authorizer *) au; |
| 552 | *buf = au->buf->vec.iov_base; | 550 | auth->authorizer_buf = au->buf->vec.iov_base; |
| 553 | *len = au->buf->vec.iov_len; | 551 | auth->authorizer_buf_len = au->buf->vec.iov_len; |
| 554 | *reply_buf = au->reply_buf; | 552 | auth->authorizer_reply_buf = au->reply_buf; |
| 555 | *reply_len = sizeof(au->reply_buf); | 553 | auth->authorizer_reply_buf_len = sizeof (au->reply_buf); |
| 554 | |||
| 556 | return 0; | 555 | return 0; |
| 557 | } | 556 | } |
| 558 | 557 | ||
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index 66b09d6a1531..2da4b9e97dc1 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c | |||
| @@ -2115,29 +2115,25 @@ static int get_authorizer(struct ceph_connection *con, | |||
| 2115 | struct ceph_osd *o = con->private; | 2115 | struct ceph_osd *o = con->private; |
| 2116 | struct ceph_osd_client *osdc = o->o_osdc; | 2116 | struct ceph_osd_client *osdc = o->o_osdc; |
| 2117 | struct ceph_auth_client *ac = osdc->client->monc.auth; | 2117 | struct ceph_auth_client *ac = osdc->client->monc.auth; |
| 2118 | struct ceph_auth_handshake *auth = &o->o_auth; | ||
| 2118 | int ret = 0; | 2119 | int ret = 0; |
| 2119 | 2120 | ||
| 2120 | if (force_new && o->o_auth.authorizer) { | 2121 | if (force_new && auth->authorizer) { |
| 2121 | ac->ops->destroy_authorizer(ac, o->o_auth.authorizer); | 2122 | ac->ops->destroy_authorizer(ac, auth->authorizer); |
| 2122 | o->o_auth.authorizer = NULL; | 2123 | auth->authorizer = NULL; |
| 2123 | } | 2124 | } |
| 2124 | if (o->o_auth.authorizer == NULL) { | 2125 | if (auth->authorizer == NULL) { |
| 2125 | ret = ac->ops->create_authorizer( | 2126 | ret = ac->ops->create_authorizer(ac, CEPH_ENTITY_TYPE_OSD, auth); |
| 2126 | ac, CEPH_ENTITY_TYPE_OSD, | ||
| 2127 | &o->o_auth.authorizer, | ||
| 2128 | &o->o_auth.authorizer_buf, | ||
| 2129 | &o->o_auth.authorizer_buf_len, | ||
| 2130 | &o->o_auth.authorizer_reply_buf, | ||
| 2131 | &o->o_auth.authorizer_reply_buf_len); | ||
| 2132 | if (ret) | 2127 | if (ret) |
| 2133 | return ret; | 2128 | return ret; |
| 2134 | } | 2129 | } |
| 2135 | 2130 | ||
| 2136 | *proto = ac->protocol; | 2131 | *proto = ac->protocol; |
| 2137 | *buf = o->o_auth.authorizer_buf; | 2132 | *buf = auth->authorizer_buf; |
| 2138 | *len = o->o_auth.authorizer_buf_len; | 2133 | *len = auth->authorizer_buf_len; |
| 2139 | *reply_buf = o->o_auth.authorizer_reply_buf; | 2134 | *reply_buf = auth->authorizer_reply_buf; |
| 2140 | *reply_len = o->o_auth.authorizer_reply_buf_len; | 2135 | *reply_len = auth->authorizer_reply_buf_len; |
| 2136 | |||
| 2141 | return 0; | 2137 | return 0; |
| 2142 | } | 2138 | } |
| 2143 | 2139 | ||
