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

Function cmap_initialize

lib/cmap.c:89–122  ·  view source on GitHub ↗

* Function implementations */

Source from the content-addressed store, hash-verified

87 * Function implementations
88 */
89cs_error_t cmap_initialize (cmap_handle_t *handle)
90{
91 cs_error_t error;
92 struct cmap_inst *cmap_inst;
93
94 error = hdb_error_to_cs(hdb_handle_create(&cmap_handle_t_db, sizeof(*cmap_inst), handle));
95 if (error != CS_OK) {
96 goto error_no_destroy;
97 }
98
99 error = hdb_error_to_cs(hdb_handle_get(&cmap_handle_t_db, *handle, (void *)&cmap_inst));
100 if (error != CS_OK) {
101 goto error_destroy;
102 }
103
104 error = CS_OK;
105 cmap_inst->finalize = 0;
106 cmap_inst->c = qb_ipcc_connect("cmap", IPC_REQUEST_SIZE);
107 if (cmap_inst->c == NULL) {
108 error = qb_to_cs_error(-errno);
109 goto error_put_destroy;
110 }
111
112 (void)hdb_handle_put(&cmap_handle_t_db, *handle);
113
114 return (CS_OK);
115
116error_put_destroy:
117 (void)hdb_handle_put(&cmap_handle_t_db, *handle);
118error_destroy:
119 (void)hdb_handle_destroy(&cmap_handle_t_db, *handle);
120error_no_destroy:
121 return (error);
122}
123
124cs_error_t cmap_initialize_map (cmap_handle_t *handle,
125 cmap_map_t map)

Callers 8

init_allFunction · 0.85
nodestatusget_doFunction · 0.85
check_for_reload_errorsFunction · 0.85
cmap_initialize_mapFunction · 0.85
sam_cmap_registerFunction · 0.85
test_quorumFunction · 0.85
test_cmap_quitFunction · 0.85
test_cmap_restartFunction · 0.85

Calls 6

hdb_error_to_csFunction · 0.85
hdb_handle_createFunction · 0.85
hdb_handle_getFunction · 0.85
qb_to_cs_errorFunction · 0.85
hdb_handle_putFunction · 0.85
hdb_handle_destroyFunction · 0.85

Tested by 3

test_quorumFunction · 0.68
test_cmap_quitFunction · 0.68
test_cmap_restartFunction · 0.68