MCPcopy Create free account
hub / github.com/corosync/corosync / cpg_finalize

Function cpg_finalize

lib/cpg.c:249–292  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

247}
248
249cs_error_t cpg_finalize (
250 cpg_handle_t handle)
251{
252 struct cpg_inst *cpg_inst;
253 struct iovec iov;
254 struct req_lib_cpg_finalize req_lib_cpg_finalize;
255 struct res_lib_cpg_finalize res_lib_cpg_finalize;
256 cs_error_t error;
257
258 error = hdb_error_to_cs (hdb_handle_get (&cpg_handle_t_db, handle, (void *)&cpg_inst));
259 if (error != CS_OK) {
260 return (error);
261 }
262
263 /*
264 * Another thread has already started finalizing
265 */
266 if (cpg_inst->finalize) {
267 hdb_handle_put (&cpg_handle_t_db, handle);
268 return (CS_ERR_BAD_HANDLE);
269 }
270
271 cpg_inst->finalize = 1;
272
273 /*
274 * Send service request
275 */
276 req_lib_cpg_finalize.header.size = sizeof (struct req_lib_cpg_finalize);
277 req_lib_cpg_finalize.header.id = MESSAGE_REQ_CPG_FINALIZE;
278
279 iov.iov_base = (void *)&req_lib_cpg_finalize;
280 iov.iov_len = sizeof (struct req_lib_cpg_finalize);
281
282 error = coroipcc_msg_send_reply_receive (cpg_inst->c,
283 &iov,
284 1,
285 &res_lib_cpg_finalize,
286 sizeof (struct res_lib_cpg_finalize));
287
288 cpg_inst_finalize (cpg_inst, handle);
289 hdb_handle_put (&cpg_handle_t_db, handle);
290
291 return (error);
292}
293
294cs_error_t cpg_fd_get (
295 cpg_handle_t handle,

Callers 13

mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
connect_and_joinFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85

Calls 5

hdb_error_to_csFunction · 0.85
hdb_handle_getFunction · 0.85
hdb_handle_putFunction · 0.85
cpg_inst_finalizeFunction · 0.85

Tested by 2

mainFunction · 0.68
mainFunction · 0.68