libceph, ceph: make use of __ceph_auth_get_authorizer() in msgr1
This shouldn't cause any functional changes. Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
This commit is contained in:
parent
cd1a677cad
commit
ce287162d9
@ -5141,23 +5141,12 @@ static struct ceph_auth_handshake *get_authorizer(struct ceph_connection *con,
|
|||||||
struct ceph_mds_client *mdsc = s->s_mdsc;
|
struct ceph_mds_client *mdsc = s->s_mdsc;
|
||||||
struct ceph_auth_client *ac = mdsc->fsc->client->monc.auth;
|
struct ceph_auth_client *ac = mdsc->fsc->client->monc.auth;
|
||||||
struct ceph_auth_handshake *auth = &s->s_auth;
|
struct ceph_auth_handshake *auth = &s->s_auth;
|
||||||
|
int ret;
|
||||||
|
|
||||||
if (force_new && auth->authorizer) {
|
ret = __ceph_auth_get_authorizer(ac, auth, CEPH_ENTITY_TYPE_MDS,
|
||||||
ceph_auth_destroy_authorizer(auth->authorizer);
|
force_new, proto, NULL, NULL);
|
||||||
auth->authorizer = NULL;
|
if (ret)
|
||||||
}
|
return ERR_PTR(ret);
|
||||||
if (!auth->authorizer) {
|
|
||||||
int ret = ceph_auth_create_authorizer(ac, CEPH_ENTITY_TYPE_MDS,
|
|
||||||
auth);
|
|
||||||
if (ret)
|
|
||||||
return ERR_PTR(ret);
|
|
||||||
} else {
|
|
||||||
int ret = ceph_auth_update_authorizer(ac, CEPH_ENTITY_TYPE_MDS,
|
|
||||||
auth);
|
|
||||||
if (ret)
|
|
||||||
return ERR_PTR(ret);
|
|
||||||
}
|
|
||||||
*proto = ac->protocol;
|
|
||||||
|
|
||||||
return auth;
|
return auth;
|
||||||
}
|
}
|
||||||
|
@ -5589,23 +5589,12 @@ static struct ceph_auth_handshake *get_authorizer(struct ceph_connection *con,
|
|||||||
struct ceph_osd_client *osdc = o->o_osdc;
|
struct ceph_osd_client *osdc = o->o_osdc;
|
||||||
struct ceph_auth_client *ac = osdc->client->monc.auth;
|
struct ceph_auth_client *ac = osdc->client->monc.auth;
|
||||||
struct ceph_auth_handshake *auth = &o->o_auth;
|
struct ceph_auth_handshake *auth = &o->o_auth;
|
||||||
|
int ret;
|
||||||
|
|
||||||
if (force_new && auth->authorizer) {
|
ret = __ceph_auth_get_authorizer(ac, auth, CEPH_ENTITY_TYPE_OSD,
|
||||||
ceph_auth_destroy_authorizer(auth->authorizer);
|
force_new, proto, NULL, NULL);
|
||||||
auth->authorizer = NULL;
|
if (ret)
|
||||||
}
|
return ERR_PTR(ret);
|
||||||
if (!auth->authorizer) {
|
|
||||||
int ret = ceph_auth_create_authorizer(ac, CEPH_ENTITY_TYPE_OSD,
|
|
||||||
auth);
|
|
||||||
if (ret)
|
|
||||||
return ERR_PTR(ret);
|
|
||||||
} else {
|
|
||||||
int ret = ceph_auth_update_authorizer(ac, CEPH_ENTITY_TYPE_OSD,
|
|
||||||
auth);
|
|
||||||
if (ret)
|
|
||||||
return ERR_PTR(ret);
|
|
||||||
}
|
|
||||||
*proto = ac->protocol;
|
|
||||||
|
|
||||||
return auth;
|
return auth;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user