Lines Matching +full:dout +full:- +full:default +full:- +full:2
1 // SPDX-License-Identifier: GPL-2.0
31 default: in ceph_auth_init_protocol()
32 return -ENOENT; in ceph_auth_init_protocol()
44 dout("auth_init name '%s'\n", name); in ceph_auth_init()
46 ret = -ENOMEM; in ceph_auth_init()
51 mutex_init(&ac->mutex); in ceph_auth_init()
52 ac->negotiating = true; in ceph_auth_init()
54 ac->name = name; in ceph_auth_init()
56 ac->name = CEPH_AUTH_NAME_DEFAULT; in ceph_auth_init()
57 dout("auth_init name %s\n", ac->name); in ceph_auth_init()
58 ac->key = key; in ceph_auth_init()
67 dout("auth_destroy %p\n", ac); in ceph_auth_destroy()
68 if (ac->ops) in ceph_auth_destroy()
69 ac->ops->destroy(ac); in ceph_auth_destroy()
78 mutex_lock(&ac->mutex); in ceph_auth_reset()
79 dout("auth_reset %p\n", ac); in ceph_auth_reset()
80 if (ac->ops && !ac->negotiating) in ceph_auth_reset()
81 ac->ops->reset(ac); in ceph_auth_reset()
82 ac->negotiating = true; in ceph_auth_reset()
83 mutex_unlock(&ac->mutex); in ceph_auth_reset()
93 if (*p + 2*sizeof(u32) + len > end) in ceph_auth_entity_name_encode()
94 return -ERANGE; in ceph_auth_entity_name_encode()
112 mutex_lock(&ac->mutex); in ceph_auth_build_hello()
113 dout("auth_build_hello\n"); in ceph_auth_build_hello()
114 monhdr->have_version = 0; in ceph_auth_build_hello()
115 monhdr->session_mon = cpu_to_le16(-1); in ceph_auth_build_hello()
116 monhdr->session_mon_tid = 0; in ceph_auth_build_hello()
131 ret = ceph_auth_entity_name_encode(ac->name, &p, end); in ceph_auth_build_hello()
135 ceph_encode_64(&p, ac->global_id); in ceph_auth_build_hello()
137 ceph_encode_32(&lenp, p - lenp - sizeof(u32)); in ceph_auth_build_hello()
138 ret = p - buf; in ceph_auth_build_hello()
140 mutex_unlock(&ac->mutex); in ceph_auth_build_hello()
144 ret = -ERANGE; in ceph_auth_build_hello()
156 monhdr->have_version = 0; in ceph_build_auth_request()
157 monhdr->session_mon = cpu_to_le16(-1); in ceph_build_auth_request()
158 monhdr->session_mon_tid = 0; in ceph_build_auth_request()
160 ceph_encode_32(&p, ac->protocol); in ceph_build_auth_request()
162 ret = ac->ops->build_request(ac, p + sizeof(u32), end); in ceph_build_auth_request()
165 ac->ops->name); in ceph_build_auth_request()
168 dout(" built request %d bytes\n", ret); in ceph_build_auth_request()
170 ret = p + ret - msg_buf; in ceph_build_auth_request()
191 int ret = -EINVAL; in ceph_handle_auth_reply()
193 mutex_lock(&ac->mutex); in ceph_handle_auth_reply()
194 dout("handle_auth_reply %p %p\n", p, end); in ceph_handle_auth_reply()
209 dout(" result %d '%.*s' gid %llu len %d\n", result, result_msg_len, in ceph_handle_auth_reply()
214 if (global_id && ac->global_id != global_id) { in ceph_handle_auth_reply()
215 dout(" set global_id %lld -> %lld\n", ac->global_id, global_id); in ceph_handle_auth_reply()
216 ac->global_id = global_id; in ceph_handle_auth_reply()
219 if (ac->negotiating) { in ceph_handle_auth_reply()
226 if (ac->protocol && ac->protocol != protocol) { in ceph_handle_auth_reply()
227 ac->ops->destroy(ac); in ceph_handle_auth_reply()
228 ac->protocol = 0; in ceph_handle_auth_reply()
229 ac->ops = NULL; in ceph_handle_auth_reply()
231 if (ac->protocol != protocol) { in ceph_handle_auth_reply()
240 ac->negotiating = false; in ceph_handle_auth_reply()
243 ret = ac->ops->handle_reply(ac, result, payload, payload_end); in ceph_handle_auth_reply()
244 if (ret == -EAGAIN) { in ceph_handle_auth_reply()
247 pr_err("auth method '%s' error %d\n", ac->ops->name, ret); in ceph_handle_auth_reply()
251 mutex_unlock(&ac->mutex); in ceph_handle_auth_reply()
256 ret = -EINVAL; in ceph_handle_auth_reply()
265 mutex_lock(&ac->mutex); in ceph_build_auth()
266 if (ac->ops->should_authenticate(ac)) in ceph_build_auth()
268 mutex_unlock(&ac->mutex); in ceph_build_auth()
276 mutex_lock(&ac->mutex); in ceph_auth_is_authenticated()
277 if (ac->ops) in ceph_auth_is_authenticated()
278 ret = ac->ops->is_authenticated(ac); in ceph_auth_is_authenticated()
279 mutex_unlock(&ac->mutex); in ceph_auth_is_authenticated()
290 mutex_lock(&ac->mutex); in ceph_auth_create_authorizer()
291 if (ac->ops && ac->ops->create_authorizer) in ceph_auth_create_authorizer()
292 ret = ac->ops->create_authorizer(ac, peer_type, auth); in ceph_auth_create_authorizer()
293 mutex_unlock(&ac->mutex); in ceph_auth_create_authorizer()
300 a->destroy(a); in ceph_auth_destroy_authorizer()
310 mutex_lock(&ac->mutex); in ceph_auth_update_authorizer()
311 if (ac->ops && ac->ops->update_authorizer) in ceph_auth_update_authorizer()
312 ret = ac->ops->update_authorizer(ac, peer_type, a); in ceph_auth_update_authorizer()
313 mutex_unlock(&ac->mutex); in ceph_auth_update_authorizer()
325 mutex_lock(&ac->mutex); in ceph_auth_add_authorizer_challenge()
326 if (ac->ops && ac->ops->add_authorizer_challenge) in ceph_auth_add_authorizer_challenge()
327 ret = ac->ops->add_authorizer_challenge(ac, a, challenge_buf, in ceph_auth_add_authorizer_challenge()
329 mutex_unlock(&ac->mutex); in ceph_auth_add_authorizer_challenge()
339 mutex_lock(&ac->mutex); in ceph_auth_verify_authorizer_reply()
340 if (ac->ops && ac->ops->verify_authorizer_reply) in ceph_auth_verify_authorizer_reply()
341 ret = ac->ops->verify_authorizer_reply(ac, a); in ceph_auth_verify_authorizer_reply()
342 mutex_unlock(&ac->mutex); in ceph_auth_verify_authorizer_reply()
349 mutex_lock(&ac->mutex); in ceph_auth_invalidate_authorizer()
350 if (ac->ops && ac->ops->invalidate_authorizer) in ceph_auth_invalidate_authorizer()
351 ac->ops->invalidate_authorizer(ac, peer_type); in ceph_auth_invalidate_authorizer()
352 mutex_unlock(&ac->mutex); in ceph_auth_invalidate_authorizer()