diff options
| author | Christof Schmitt <christof.schmitt@de.ibm.com> | 2009-09-24 04:23:21 -0400 |
|---|---|---|
| committer | James Bottomley <James.Bottomley@suse.de> | 2009-10-02 10:49:35 -0400 |
| commit | b1a58985853574346f1518531bdd82069501b317 (patch) | |
| tree | 96a426970c5885d5c77bf5944c80b732b11b4faf | |
| parent | dac3bbd643cd54e2383e88b4f0f86db68c921701 (diff) | |
[SCSI] zfcp: correctly initialize unchained requests
The common initialization of ct/gs and els requests missed the
initialization of unchained requests. Fix this by moving the common
parts to a place that is called for all ct/gs and els requests.
Reviewed-by: Felix Beck <felix.beck@de.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
| -rw-r--r-- | drivers/s390/scsi/zfcp_fsf.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index f09c863dc6bd..38a7e4a6b639 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c | |||
| @@ -1058,11 +1058,25 @@ static int zfcp_fsf_setup_ct_els_sbals(struct zfcp_fsf_req *req, | |||
| 1058 | bytes = zfcp_qdio_sbals_from_sg(adapter->qdio, &req->queue_req, | 1058 | bytes = zfcp_qdio_sbals_from_sg(adapter->qdio, &req->queue_req, |
| 1059 | SBAL_FLAGS0_TYPE_WRITE_READ, | 1059 | SBAL_FLAGS0_TYPE_WRITE_READ, |
| 1060 | sg_resp, max_sbals); | 1060 | sg_resp, max_sbals); |
| 1061 | req->qtcb->bottom.support.resp_buf_length = bytes; | ||
| 1061 | if (bytes <= 0) | 1062 | if (bytes <= 0) |
| 1062 | return -EIO; | 1063 | return -EIO; |
| 1063 | 1064 | ||
| 1065 | return 0; | ||
| 1066 | } | ||
| 1067 | |||
| 1068 | static int zfcp_fsf_setup_ct_els(struct zfcp_fsf_req *req, | ||
| 1069 | struct scatterlist *sg_req, | ||
| 1070 | struct scatterlist *sg_resp, | ||
| 1071 | int max_sbals) | ||
| 1072 | { | ||
| 1073 | int ret; | ||
| 1074 | |||
| 1075 | ret = zfcp_fsf_setup_ct_els_sbals(req, sg_req, sg_resp, max_sbals); | ||
| 1076 | if (ret) | ||
| 1077 | return ret; | ||
| 1078 | |||
| 1064 | /* common settings for ct/gs and els requests */ | 1079 | /* common settings for ct/gs and els requests */ |
| 1065 | req->qtcb->bottom.support.resp_buf_length = bytes; | ||
| 1066 | req->qtcb->bottom.support.service_class = FSF_CLASS_3; | 1080 | req->qtcb->bottom.support.service_class = FSF_CLASS_3; |
| 1067 | req->qtcb->bottom.support.timeout = 2 * R_A_TOV; | 1081 | req->qtcb->bottom.support.timeout = 2 * R_A_TOV; |
| 1068 | zfcp_fsf_start_timer(req, 2 * R_A_TOV + 10); | 1082 | zfcp_fsf_start_timer(req, 2 * R_A_TOV + 10); |
| @@ -1094,8 +1108,8 @@ int zfcp_fsf_send_ct(struct zfcp_send_ct *ct, mempool_t *pool) | |||
| 1094 | } | 1108 | } |
| 1095 | 1109 | ||
| 1096 | req->status |= ZFCP_STATUS_FSFREQ_CLEANUP; | 1110 | req->status |= ZFCP_STATUS_FSFREQ_CLEANUP; |
| 1097 | ret = zfcp_fsf_setup_ct_els_sbals(req, ct->req, ct->resp, | 1111 | ret = zfcp_fsf_setup_ct_els(req, ct->req, ct->resp, |
| 1098 | FSF_MAX_SBALS_PER_REQ); | 1112 | FSF_MAX_SBALS_PER_REQ); |
| 1099 | if (ret) | 1113 | if (ret) |
| 1100 | goto failed_send; | 1114 | goto failed_send; |
| 1101 | 1115 | ||
| @@ -1192,7 +1206,7 @@ int zfcp_fsf_send_els(struct zfcp_send_els *els) | |||
| 1192 | } | 1206 | } |
| 1193 | 1207 | ||
| 1194 | req->status |= ZFCP_STATUS_FSFREQ_CLEANUP; | 1208 | req->status |= ZFCP_STATUS_FSFREQ_CLEANUP; |
| 1195 | ret = zfcp_fsf_setup_ct_els_sbals(req, els->req, els->resp, 2); | 1209 | ret = zfcp_fsf_setup_ct_els(req, els->req, els->resp, 2); |
| 1196 | 1210 | ||
| 1197 | if (ret) | 1211 | if (ret) |
| 1198 | goto failed_send; | 1212 | goto failed_send; |
