Lines Matching refs:rq
140 * @rq
144 int cluster_send(struct clog_request *rq)
153 if (!strncmp(entry->name.value, rq->u_rq.uuid,
160 rq->u_rq.error = -ENOENT;
168 rq->u_rq.luid = 0;
170 iov.iov_base = rq;
171 iov.iov_len = sizeof(struct clog_request) + rq->u_rq.data_size;
183 SHORT_UUID(rq->u_rq.uuid), count,
187 SHORT_UUID(rq->u_rq.uuid), count,
191 SHORT_UUID(rq->u_rq.uuid), count,
196 SHORT_UUID(rq->u_rq.uuid), count,
207 rq->u_rq.error = -EBADE;
211 static struct clog_request *get_matching_rq(struct clog_request *rq,
217 if (match->u_rq.seq == rq->u_rq.seq) {
227 struct clog_request *rq, int server)
235 * rq will be altered - leading to problems
238 memcpy(tmp, rq, sizeof(struct clog_request) + rq->u_rq.data_size);
266 * Errors from previous functions are in the rq struct.
277 struct clog_request *rq)
285 if (rq->originator != my_cluster_id)
288 rq->u_rq.request_type &= ~DM_ULOG_RESPONSE;
289 orig_rq = get_matching_rq(rq, &entry->working_list);
295 SHORT_UUID(rq->u_rq.uuid),
296 _RQ_TYPE(rq->u_rq.request_type),
297 rq->u_rq.seq);
315 SHORT_UUID(rq->u_rq.uuid),
316 _RQ_TYPE(rq->u_rq.request_type),
317 rq->u_rq.seq);
322 memcpy(orig_rq, rq, sizeof(*rq) + rq->u_rq.data_size);
439 struct clog_request *rq;
576 rq = malloc(DM_ULOG_REQUEST_SIZE);
577 if (!rq) {
581 memset(rq, 0, sizeof(*rq));
583 dm_list_init(&rq->list);
584 rq->u_rq.request_type = DM_ULOG_CHECKPOINT_READY;
585 rq->originator = cp->requester; /* FIXME: hack to overload meaning of originator */
586 strncpy(rq->u_rq.uuid, cp->uuid, CPG_MAX_NAME_LENGTH);
587 rq->u_rq.seq = my_cluster_id;
589 r = cluster_send(rq);
594 free(rq);
758 * notice in rq in export_checkpoint function
759 * by setting rq->error
798 struct clog_request *rq, *n;
808 dm_list_iterate_items_safe(rq, n, &entry->working_list) {
809 dm_list_del(&rq->list);
811 if (strcmp(entry->name.value, rq->u_rq.uuid)) {
814 SHORT_UUID(rq->u_rq.uuid));
815 free(rq);
819 switch (rq->u_rq.request_type) {
830 _RQ_TYPE(rq->u_rq.request_type),
831 rq->u_rq.seq);
834 _RQ_TYPE(rq->u_rq.request_type),
835 rq->u_rq.seq);
837 rq->u_rq.data_size = 0;
838 kernel_send(&rq->u_rq);
850 _RQ_TYPE(rq->u_rq.request_type),
851 rq->u_rq.seq, entry->lowest_id);
854 _RQ_TYPE(rq->u_rq.request_type),
855 rq->u_rq.seq);
856 r = cluster_send(rq);
860 free(rq);
892 struct clog_request *rq, *n;
895 dm_list_iterate_items_safe(rq, n, &entry->startup_list) {
896 dm_list_del(&rq->list);
898 if (rq->u_rq.request_type == DM_ULOG_MEMBER_JOIN) {
899 new = prepare_checkpoint(entry, rq->originator);
908 rq->originator);
909 free(rq);
913 SHORT_UUID(entry->name.value), rq->originator);
915 SHORT_UUID(entry->name.value), rq->originator);
920 SHORT_UUID(rq->u_rq.uuid),
921 _RQ_TYPE(rq->u_rq.request_type));
922 i_was_server = (rq->pit_server == my_cluster_id) ? 1 : 0;
923 r = handle_cluster_request(entry, rq, i_was_server);
932 free(rq);
946 struct clog_request *rq = msg;
957 !(rq->u_rq.request_type & DM_ULOG_RESPONSE) &&
958 (rq->u_rq.request_type != DM_ULOG_RESUME) &&
959 (rq->u_rq.request_type != DM_ULOG_CLEAR_REGION) &&
960 (rq->u_rq.request_type != DM_ULOG_CHECKPOINT_READY)) {
969 SHORT_UUID(rq->u_rq.uuid));
972 memcpy(tmp_rq, rq, sizeof(*rq) + rq->u_rq.data_size);
977 if (rq->u_rq.request_type == DM_ULOG_POSTSUSPEND) {
986 SHORT_UUID(rq->u_rq.uuid));
992 SHORT_UUID(rq->u_rq.uuid), nodeid,
1005 SHORT_UUID(rq->u_rq.uuid), nodeid, match->delay);
1007 rq->originator = nodeid; /* don't really need this, but nice for debug */
1022 if (rq->u_rq.request_type == DM_ULOG_CHECKPOINT_READY) {
1023 if (my_cluster_id == rq->originator) {
1026 SHORT_UUID(rq->u_rq.uuid), nodeid);
1030 SHORT_UUID(rq->u_rq.uuid), nodeid);
1032 SHORT_UUID(rq->u_rq.uuid), nodeid);
1049 SHORT_UUID(rq->u_rq.uuid), nodeid);
1055 if (rq->u_rq.request_type & DM_ULOG_RESPONSE) {
1057 r = handle_cluster_response(match, rq);
1059 rq->originator = nodeid;
1063 SHORT_UUID(rq->u_rq.uuid), _RQ_TYPE(rq->u_rq.request_type),
1064 rq->originator);
1078 memcpy(tmp_rq, rq, sizeof(*rq) + rq->u_rq.data_size);
1085 r = handle_cluster_request(match, rq, i_am_server);
1094 if (log_get_state(&rq->u_rq) != LOG_RESUMED) {
1096 SHORT_UUID(rq->u_rq.uuid), _RQ_TYPE(rq->u_rq.request_type), nodeid);
1105 SHORT_UUID(rq->u_rq.uuid), match->checkpoint_requesters[i]);
1109 SHORT_UUID(rq->u_rq.uuid), match->checkpoint_requesters[i],
1110 (log_get_state(&rq->u_rq) != LOG_RESUMED)? "LOG_RESUMED": "LOG_SUSPENDED");
1112 SHORT_UUID(rq->u_rq.uuid), match->checkpoint_requesters[i]);
1123 SHORT_UUID(rq->u_rq.uuid),
1124 _RQ_TYPE(rq->u_rq.request_type & ~DM_ULOG_RESPONSE),
1126 LOG_ERROR("[%s] Response : %s", SHORT_UUID(rq->u_rq.uuid),
1129 SHORT_UUID(rq->u_rq.uuid), rq->originator);
1132 SHORT_UUID(rq->u_rq.uuid), nodeid);
1143 } else if (!(rq->u_rq.request_type & DM_ULOG_RESPONSE) ||
1144 (rq->originator == my_cluster_id)) {
1147 rq->u_rq.seq, SHORT_UUID(rq->u_rq.uuid),
1148 _RQ_TYPE(rq->u_rq.request_type),
1149 rq->originator, (response) ? "YES" : "NO");
1152 rq->u_rq.seq, SHORT_UUID(rq->u_rq.uuid),
1153 _RQ_TYPE(rq->u_rq.request_type),
1154 rq->originator, (response) ? "YES" : "NO",
1167 struct clog_request *rq;
1201 rq = malloc(DM_ULOG_REQUEST_SIZE);
1202 if (!rq) {
1209 rq->u_rq.request_type = DM_ULOG_MEMBER_JOIN;
1210 rq->originator = joined->nodeid;
1211 dm_list_init(&rq->list);
1212 dm_list_add(&match->startup_list, &rq->list);
1245 struct clog_request *rq, *n;
1261 dm_list_iterate_items_safe(rq, n, &match->working_list) {
1262 dm_list_del(&rq->list);
1264 if (rq->u_rq.request_type == DM_ULOG_POSTSUSPEND)
1265 kernel_send(&rq->u_rq);
1266 free(rq);
1291 dm_list_iterate_items_safe(rq, n, &match->startup_list) {
1292 if ((rq->u_rq.request_type == DM_ULOG_MEMBER_JOIN) &&
1293 (rq->originator == left->nodeid)) {
1297 dm_list_del(&rq->list);
1298 free(rq);
1357 dm_list_iterate_items(rq, &match->startup_list)
1358 if (rq->u_rq.request_type == DM_ULOG_MEMBER_JOIN)
1526 struct clog_request *rq, *n;
1531 dm_list_iterate_items_safe(rq, n, &del->startup_list) {
1532 dm_list_del(&rq->list);
1535 SHORT_UUID(del->name.value), rq->originator,
1536 _RQ_TYPE(rq->u_rq.request_type));
1537 free(rq);
1621 struct clog_request *rq;
1645 dm_list_iterate_items(rq, &entry->working_list)
1646 LOG_ERROR(" %s/%u", _RQ_TYPE(rq->u_rq.request_type),
1647 rq->u_rq.seq);
1650 dm_list_iterate_items(rq, &entry->startup_list)
1651 LOG_ERROR(" %s/%u", _RQ_TYPE(rq->u_rq.request_type),
1652 rq->u_rq.seq);