pdu: fix statsn and factor out sn comparision

Signed-off-by: Peter Lieven <pl@kamp.de>
This commit is contained in:
Peter Lieven
2014-06-17 10:56:18 +02:00
parent 52c6b0d397
commit 4e129d385c
5 changed files with 44 additions and 76 deletions

View File

@@ -92,18 +92,11 @@ int
iscsi_process_task_mgmt_reply(struct iscsi_context *iscsi, struct iscsi_pdu *pdu,
struct iscsi_in_pdu *in)
{
uint32_t response, maxcmdsn, expcmdsn;
uint32_t response;
response = in->hdr[2];
maxcmdsn = scsi_get_uint32(&in->hdr[32]);
if (iscsi_serial32_compare(maxcmdsn, iscsi->maxcmdsn) > 0) {
iscsi->maxcmdsn = maxcmdsn;
}
expcmdsn = scsi_get_uint32(&in->hdr[28]);
if (iscsi_serial32_compare(expcmdsn, iscsi->expcmdsn) > 0) {
iscsi->expcmdsn = expcmdsn;
}
iscsi_adjust_maxexpcmdsn(iscsi, in);
pdu->callback(iscsi, SCSI_STATUS_GOOD, &response, pdu->private_data);