diff options
author | Swen Schillig <swen@vnet.ibm.com> | 2010-07-16 15:37:37 +0200 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-07-28 09:48:49 -0500 |
commit | 01b047599ade30051bf6c14fbe64181d1fec3dfa (patch) | |
tree | 3a44039ec1c48b41ba8e988c230291aca20b833c /drivers/s390/scsi/zfcp_qdio.c | |
parent | faf4cd854203b26527d81e7e13d66e78774dad44 (diff) | |
download | blackbird-op-linux-01b047599ade30051bf6c14fbe64181d1fec3dfa.tar.gz blackbird-op-linux-01b047599ade30051bf6c14fbe64181d1fec3dfa.zip |
[SCSI] zfcp: Cleanup function parameters for sbal value.
A lot of functions require the amount of SBALs as one of their
parameter which is most times invariable. Therefore remove this
parameter and set the SBAL value explicitly if a non standard value is
required. In addition the warning message "oversized data" is
replaced with a BUG_ON() statement assuring the limits defined and
requested by zfcp.
Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/s390/scsi/zfcp_qdio.c')
-rw-r--r-- | drivers/s390/scsi/zfcp_qdio.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/drivers/s390/scsi/zfcp_qdio.c b/drivers/s390/scsi/zfcp_qdio.c index 6fa5e0453176..7ab1ac16a11f 100644 --- a/drivers/s390/scsi/zfcp_qdio.c +++ b/drivers/s390/scsi/zfcp_qdio.c @@ -141,15 +141,6 @@ static void zfcp_qdio_int_resp(struct ccw_device *cdev, unsigned int qdio_err, zfcp_qdio_resp_put_back(qdio, count); } -static void zfcp_qdio_sbal_limit(struct zfcp_qdio *qdio, - struct zfcp_qdio_req *q_req, int max_sbals) -{ - int count = atomic_read(&qdio->req_q.count); - count = min(count, max_sbals); - q_req->sbal_limit = (q_req->sbal_first + count - 1) - % QDIO_MAX_BUFFERS_PER_Q; -} - static struct qdio_buffer_element * zfcp_qdio_sbal_chain(struct zfcp_qdio *qdio, struct zfcp_qdio_req *q_req) { @@ -173,6 +164,7 @@ zfcp_qdio_sbal_chain(struct zfcp_qdio *qdio, struct zfcp_qdio_req *q_req) /* keep this requests number of SBALs up-to-date */ q_req->sbal_number++; + BUG_ON(q_req->sbal_number > ZFCP_QDIO_MAX_SBALS_PER_REQ); /* start at first SBALE of new SBAL */ q_req->sbale_curr = 0; @@ -213,14 +205,11 @@ static void zfcp_qdio_undo_sbals(struct zfcp_qdio *qdio, * Returns: number of bytes, or error (negativ) */ int zfcp_qdio_sbals_from_sg(struct zfcp_qdio *qdio, struct zfcp_qdio_req *q_req, - struct scatterlist *sg, int max_sbals) + struct scatterlist *sg) { struct qdio_buffer_element *sbale; int bytes = 0; - /* figure out last allowed SBAL */ - zfcp_qdio_sbal_limit(qdio, q_req, max_sbals); - /* set storage-block type for this request */ sbale = zfcp_qdio_sbale_req(qdio, q_req); sbale->flags |= q_req->sbtype; |