| 1011 | } |
| 1012 | |
| 1013 | cs_error_t cpg_zcb_free ( |
| 1014 | cpg_handle_t handle, |
| 1015 | void *buffer) |
| 1016 | { |
| 1017 | cs_error_t error; |
| 1018 | unsigned int res; |
| 1019 | struct cpg_inst *cpg_inst; |
| 1020 | mar_req_coroipcc_zc_free_t req_coroipcc_zc_free; |
| 1021 | struct qb_ipc_response_header res_coroipcs_zc_free; |
| 1022 | struct iovec iovec; |
| 1023 | struct coroipcs_zc_header *header = (struct coroipcs_zc_header *)((char *)buffer - sizeof (struct coroipcs_zc_header) - sizeof (struct req_lib_cpg_mcast)); |
| 1024 | |
| 1025 | error = hdb_error_to_cs (hdb_handle_get (&cpg_handle_t_db, handle, (void *)&cpg_inst)); |
| 1026 | if (error != CS_OK) { |
| 1027 | return (error); |
| 1028 | } |
| 1029 | |
| 1030 | req_coroipcc_zc_free.header.size = sizeof (mar_req_coroipcc_zc_free_t); |
| 1031 | req_coroipcc_zc_free.header.id = MESSAGE_REQ_CPG_ZC_FREE; |
| 1032 | req_coroipcc_zc_free.map_size = header->map_size; |
| 1033 | req_coroipcc_zc_free.server_address = header->server_address; |
| 1034 | |
| 1035 | iovec.iov_base = (void *)&req_coroipcc_zc_free; |
| 1036 | iovec.iov_len = sizeof (mar_req_coroipcc_zc_free_t); |
| 1037 | |
| 1038 | error = coroipcc_msg_send_reply_receive ( |
| 1039 | cpg_inst->c, |
| 1040 | &iovec, |
| 1041 | 1, |
| 1042 | &res_coroipcs_zc_free, |
| 1043 | sizeof (struct qb_ipc_response_header)); |
| 1044 | |
| 1045 | if (error != CS_OK) { |
| 1046 | goto error_exit; |
| 1047 | } |
| 1048 | |
| 1049 | res = munmap ((void *)header, header->map_size); |
| 1050 | if (res == -1) { |
| 1051 | error = qb_to_cs_error(-errno); |
| 1052 | |
| 1053 | goto error_exit; |
| 1054 | } |
| 1055 | |
| 1056 | error_exit: |
| 1057 | hdb_handle_put (&cpg_handle_t_db, handle); |
| 1058 | |
| 1059 | return (error); |
| 1060 | } |
| 1061 | |
| 1062 | cs_error_t cpg_zcb_mcast_joined ( |
| 1063 | cpg_handle_t handle, |