kasan: split out shadow.c from common.c
[linux-2.6-microblaze.git] / net / ceph / osd_client.c
index 662b52e..61229c5 100644 (file)
@@ -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_auth_client *ac = osdc->client->monc.auth;
        struct ceph_auth_handshake *auth = &o->o_auth;
+       int ret;
 
-       if (force_new && auth->authorizer) {
-               ceph_auth_destroy_authorizer(auth->authorizer);
-               auth->authorizer = NULL;
-       }
-       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;
+       ret = __ceph_auth_get_authorizer(ac, auth, CEPH_ENTITY_TYPE_OSD,
+                                        force_new, proto, NULL, NULL);
+       if (ret)
+               return ERR_PTR(ret);
 
        return auth;
 }