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

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>

+10 -32
+5 -16
fs/ceph/mds_client.c
··· 5141 5141 struct ceph_mds_client *mdsc = s->s_mdsc; 5142 5142 struct ceph_auth_client *ac = mdsc->fsc->client->monc.auth; 5143 5143 struct ceph_auth_handshake *auth = &s->s_auth; 5144 + int ret; 5144 5145 5145 - if (force_new && auth->authorizer) { 5146 - ceph_auth_destroy_authorizer(auth->authorizer); 5147 - auth->authorizer = NULL; 5148 - } 5149 - if (!auth->authorizer) { 5150 - int ret = ceph_auth_create_authorizer(ac, CEPH_ENTITY_TYPE_MDS, 5151 - auth); 5152 - if (ret) 5153 - return ERR_PTR(ret); 5154 - } else { 5155 - int ret = ceph_auth_update_authorizer(ac, CEPH_ENTITY_TYPE_MDS, 5156 - auth); 5157 - if (ret) 5158 - return ERR_PTR(ret); 5159 - } 5160 - *proto = ac->protocol; 5146 + ret = __ceph_auth_get_authorizer(ac, auth, CEPH_ENTITY_TYPE_MDS, 5147 + force_new, proto, NULL, NULL); 5148 + if (ret) 5149 + return ERR_PTR(ret); 5161 5150 5162 5151 return auth; 5163 5152 }
+5 -16
net/ceph/osd_client.c
··· 5589 5589 struct ceph_osd_client *osdc = o->o_osdc; 5590 5590 struct ceph_auth_client *ac = osdc->client->monc.auth; 5591 5591 struct ceph_auth_handshake *auth = &o->o_auth; 5592 + int ret; 5592 5593 5593 - if (force_new && auth->authorizer) { 5594 - ceph_auth_destroy_authorizer(auth->authorizer); 5595 - auth->authorizer = NULL; 5596 - } 5597 - if (!auth->authorizer) { 5598 - int ret = ceph_auth_create_authorizer(ac, CEPH_ENTITY_TYPE_OSD, 5599 - auth); 5600 - if (ret) 5601 - return ERR_PTR(ret); 5602 - } else { 5603 - int ret = ceph_auth_update_authorizer(ac, CEPH_ENTITY_TYPE_OSD, 5604 - auth); 5605 - if (ret) 5606 - return ERR_PTR(ret); 5607 - } 5608 - *proto = ac->protocol; 5594 + ret = __ceph_auth_get_authorizer(ac, auth, CEPH_ENTITY_TYPE_OSD, 5595 + force_new, proto, NULL, NULL); 5596 + if (ret) 5597 + return ERR_PTR(ret); 5609 5598 5610 5599 return auth; 5611 5600 }