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

Function cmap_finalize

lib/cmap.c:173–210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

171}
172
173cs_error_t cmap_finalize(cmap_handle_t handle)
174{
175 struct cmap_inst *cmap_inst;
176 cs_error_t error;
177 hdb_handle_t track_inst_handle = 0;
178 struct cmap_track_inst *cmap_track_inst;
179
180 error = hdb_error_to_cs(hdb_handle_get(&cmap_handle_t_db, handle, (void *)&cmap_inst));
181 if (error != CS_OK) {
182 return (error);
183 }
184
185 if (cmap_inst->finalize) {
186 (void)hdb_handle_put (&cmap_handle_t_db, handle);
187 return (CS_ERR_BAD_HANDLE);
188 }
189 cmap_inst->finalize = 1;
190
191 /*
192 * Destroy all track instances for given connection
193 */
194 hdb_iterator_reset(&cmap_track_handle_t_db);
195 while (hdb_iterator_next(&cmap_track_handle_t_db,
196 (void*)&cmap_track_inst, &track_inst_handle) == 0) {
197
198 if (cmap_track_inst->c == cmap_inst->c) {
199 (void)hdb_handle_destroy(&cmap_track_handle_t_db, track_inst_handle);
200 }
201
202 (void)hdb_handle_put (&cmap_track_handle_t_db, track_inst_handle);
203 }
204
205 (void)hdb_handle_destroy(&cmap_handle_t_db, handle);
206
207 (void)hdb_handle_put(&cmap_handle_t_db, handle);
208
209 return (CS_OK);
210}
211
212cs_error_t cmap_fd_get(cmap_handle_t handle, int *fd)
213{

Callers 7

close_allFunction · 0.85
nodestatusget_doFunction · 0.85
check_for_reload_errorsFunction · 0.85
_cs_cmap_finalizeFunction · 0.85
mainFunction · 0.85
sam_cmap_registerFunction · 0.85
finalizeFunction · 0.85

Calls 6

hdb_error_to_csFunction · 0.85
hdb_handle_getFunction · 0.85
hdb_handle_putFunction · 0.85
hdb_iterator_resetFunction · 0.85
hdb_iterator_nextFunction · 0.85
hdb_handle_destroyFunction · 0.85

Tested by

no test coverage detected