master/domain.c
branchstable-1.4
changeset 1653 595c8f51d720
parent 1181 9e5954a2a46e
child 1685 399ef727bf62
equal deleted inserted replaced
1652:df31116073f6 1653:595c8f51d720
   159             kfree(datagram);
   159             kfree(datagram);
   160             return -1;
   160             return -1;
   161         }
   161         }
   162         // If LRW is used, output FMMUs increment the working counter by 2,
   162         // If LRW is used, output FMMUs increment the working counter by 2,
   163         // while input FMMUs increment it by 1.
   163         // while input FMMUs increment it by 1.
   164         domain->expected_working_counter =
   164         domain->expected_working_counter +=
   165             used[EC_DIR_OUTPUT] * 2 + used[EC_DIR_INPUT];
   165             used[EC_DIR_OUTPUT] * 2 + used[EC_DIR_INPUT];
   166     } else if (used[EC_DIR_OUTPUT]) { // outputs only
   166     } else if (used[EC_DIR_OUTPUT]) { // outputs only
   167         if (ec_datagram_lwr(datagram, logical_offset, data_size, data)) {
   167         if (ec_datagram_lwr(datagram, logical_offset, data_size, data)) {
   168             kfree(datagram);
   168             kfree(datagram);
   169             return -1;
   169             return -1;
   170         }
   170         }
   171         domain->expected_working_counter = used[EC_DIR_OUTPUT];
   171         domain->expected_working_counter += used[EC_DIR_OUTPUT];
   172     } else { // inputs only (or nothing)
   172     } else { // inputs only (or nothing)
   173         if (ec_datagram_lrd(datagram, logical_offset, data_size, data)) {
   173         if (ec_datagram_lrd(datagram, logical_offset, data_size, data)) {
   174             kfree(datagram);
   174             kfree(datagram);
   175             return -1;
   175             return -1;
   176         }
   176         }
   177         domain->expected_working_counter = used[EC_DIR_INPUT];
   177         domain->expected_working_counter += used[EC_DIR_INPUT];
   178     }
   178     }
   179 
   179 
   180     list_add_tail(&datagram->list, &domain->datagrams);
   180     list_add_tail(&datagram->list, &domain->datagrams);
   181     return 0;
   181     return 0;
   182 }
   182 }