diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2007-07-29 03:46:28 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.localdomain> | 2007-07-31 11:29:04 -0400 |
commit | 7936a892e72498a05b9a7fb1fec6506d65c8e435 (patch) | |
tree | f7a398b4c224954e26ef59bec07b6df3c750a9c8 /drivers/s390 | |
parent | 6a302358d87fedaf7bda12b8e909265ebf1ce674 (diff) |
[SCSI] zfcp: convert to use the data buffer accessors
- remove the unnecessary map_single path.
- convert to use the new accessors for the sg lists and the
parameters.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/s390')
-rw-r--r-- | drivers/s390/scsi/zfcp_fsf.c | 5 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_qdio.c | 41 |
2 files changed, 9 insertions, 37 deletions
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index b240800b78d7..99299976e891 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c | |||
@@ -4154,8 +4154,9 @@ zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *fsf_req) | |||
4154 | fcp_rsp_iu->fcp_resid, | 4154 | fcp_rsp_iu->fcp_resid, |
4155 | (int) zfcp_get_fcp_dl(fcp_cmnd_iu)); | 4155 | (int) zfcp_get_fcp_dl(fcp_cmnd_iu)); |
4156 | 4156 | ||
4157 | scpnt->resid = fcp_rsp_iu->fcp_resid; | 4157 | scsi_set_resid(scpnt, fcp_rsp_iu->fcp_resid); |
4158 | if (scpnt->request_bufflen - scpnt->resid < scpnt->underflow) | 4158 | if (scsi_bufflen(scpnt) - scsi_get_resid(scpnt) < |
4159 | scpnt->underflow) | ||
4159 | set_host_byte(&scpnt->result, DID_ERROR); | 4160 | set_host_byte(&scpnt->result, DID_ERROR); |
4160 | } | 4161 | } |
4161 | 4162 | ||
diff --git a/drivers/s390/scsi/zfcp_qdio.c b/drivers/s390/scsi/zfcp_qdio.c index c408badd2ae9..81daa8204bfe 100644 --- a/drivers/s390/scsi/zfcp_qdio.c +++ b/drivers/s390/scsi/zfcp_qdio.c | |||
@@ -36,8 +36,6 @@ static void zfcp_qdio_sbale_fill | |||
36 | (struct zfcp_fsf_req *, unsigned long, void *, int); | 36 | (struct zfcp_fsf_req *, unsigned long, void *, int); |
37 | static int zfcp_qdio_sbals_from_segment | 37 | static int zfcp_qdio_sbals_from_segment |
38 | (struct zfcp_fsf_req *, unsigned long, void *, unsigned long); | 38 | (struct zfcp_fsf_req *, unsigned long, void *, unsigned long); |
39 | static int zfcp_qdio_sbals_from_buffer | ||
40 | (struct zfcp_fsf_req *, unsigned long, void *, unsigned long, int); | ||
41 | 39 | ||
42 | static qdio_handler_t zfcp_qdio_request_handler; | 40 | static qdio_handler_t zfcp_qdio_request_handler; |
43 | static qdio_handler_t zfcp_qdio_response_handler; | 41 | static qdio_handler_t zfcp_qdio_response_handler; |
@@ -632,28 +630,6 @@ out: | |||
632 | 630 | ||
633 | 631 | ||
634 | /** | 632 | /** |
635 | * zfcp_qdio_sbals_from_buffer - fill SBALs from buffer | ||
636 | * @fsf_req: request to be processed | ||
637 | * @sbtype: SBALE flags | ||
638 | * @buffer: data buffer | ||
639 | * @length: length of buffer | ||
640 | * @max_sbals: upper bound for number of SBALs to be used | ||
641 | */ | ||
642 | static int | ||
643 | zfcp_qdio_sbals_from_buffer(struct zfcp_fsf_req *fsf_req, unsigned long sbtype, | ||
644 | void *buffer, unsigned long length, int max_sbals) | ||
645 | { | ||
646 | struct scatterlist sg_segment; | ||
647 | |||
648 | zfcp_address_to_sg(buffer, &sg_segment); | ||
649 | sg_segment.length = length; | ||
650 | |||
651 | return zfcp_qdio_sbals_from_sg(fsf_req, sbtype, &sg_segment, 1, | ||
652 | max_sbals); | ||
653 | } | ||
654 | |||
655 | |||
656 | /** | ||
657 | * zfcp_qdio_sbals_from_scsicmnd - fill SBALs from scsi command | 633 | * zfcp_qdio_sbals_from_scsicmnd - fill SBALs from scsi command |
658 | * @fsf_req: request to be processed | 634 | * @fsf_req: request to be processed |
659 | * @sbtype: SBALE flags | 635 | * @sbtype: SBALE flags |
@@ -664,18 +640,13 @@ int | |||
664 | zfcp_qdio_sbals_from_scsicmnd(struct zfcp_fsf_req *fsf_req, | 640 | zfcp_qdio_sbals_from_scsicmnd(struct zfcp_fsf_req *fsf_req, |
665 | unsigned long sbtype, struct scsi_cmnd *scsi_cmnd) | 641 | unsigned long sbtype, struct scsi_cmnd *scsi_cmnd) |
666 | { | 642 | { |
667 | if (scsi_cmnd->use_sg) { | 643 | if (scsi_sg_count(scsi_cmnd)) |
668 | return zfcp_qdio_sbals_from_sg(fsf_req, sbtype, | 644 | return zfcp_qdio_sbals_from_sg(fsf_req, sbtype, |
669 | (struct scatterlist *) | 645 | scsi_sglist(scsi_cmnd), |
670 | scsi_cmnd->request_buffer, | 646 | scsi_sg_count(scsi_cmnd), |
671 | scsi_cmnd->use_sg, | 647 | ZFCP_MAX_SBALS_PER_REQ); |
672 | ZFCP_MAX_SBALS_PER_REQ); | 648 | else |
673 | } else { | 649 | return 0; |
674 | return zfcp_qdio_sbals_from_buffer(fsf_req, sbtype, | ||
675 | scsi_cmnd->request_buffer, | ||
676 | scsi_cmnd->request_bufflen, | ||
677 | ZFCP_MAX_SBALS_PER_REQ); | ||
678 | } | ||
679 | } | 650 | } |
680 | 651 | ||
681 | /** | 652 | /** |