Commit 7936a892 authored by FUJITA Tomonori's avatar FUJITA Tomonori Committed by James Bottomley

[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: default avatarFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: default avatarSwen Schillig <swen@vnet.ibm.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 6a302358
...@@ -4154,8 +4154,9 @@ zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *fsf_req) ...@@ -4154,8 +4154,9 @@ zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *fsf_req)
fcp_rsp_iu->fcp_resid, fcp_rsp_iu->fcp_resid,
(int) zfcp_get_fcp_dl(fcp_cmnd_iu)); (int) zfcp_get_fcp_dl(fcp_cmnd_iu));
scpnt->resid = fcp_rsp_iu->fcp_resid; scsi_set_resid(scpnt, fcp_rsp_iu->fcp_resid);
if (scpnt->request_bufflen - scpnt->resid < scpnt->underflow) if (scsi_bufflen(scpnt) - scsi_get_resid(scpnt) <
scpnt->underflow)
set_host_byte(&scpnt->result, DID_ERROR); set_host_byte(&scpnt->result, DID_ERROR);
} }
......
...@@ -36,8 +36,6 @@ static void zfcp_qdio_sbale_fill ...@@ -36,8 +36,6 @@ static void zfcp_qdio_sbale_fill
(struct zfcp_fsf_req *, unsigned long, void *, int); (struct zfcp_fsf_req *, unsigned long, void *, int);
static int zfcp_qdio_sbals_from_segment static int zfcp_qdio_sbals_from_segment
(struct zfcp_fsf_req *, unsigned long, void *, unsigned long); (struct zfcp_fsf_req *, unsigned long, void *, unsigned long);
static int zfcp_qdio_sbals_from_buffer
(struct zfcp_fsf_req *, unsigned long, void *, unsigned long, int);
static qdio_handler_t zfcp_qdio_request_handler; static qdio_handler_t zfcp_qdio_request_handler;
static qdio_handler_t zfcp_qdio_response_handler; static qdio_handler_t zfcp_qdio_response_handler;
...@@ -631,28 +629,6 @@ out: ...@@ -631,28 +629,6 @@ out:
} }
/**
* zfcp_qdio_sbals_from_buffer - fill SBALs from buffer
* @fsf_req: request to be processed
* @sbtype: SBALE flags
* @buffer: data buffer
* @length: length of buffer
* @max_sbals: upper bound for number of SBALs to be used
*/
static int
zfcp_qdio_sbals_from_buffer(struct zfcp_fsf_req *fsf_req, unsigned long sbtype,
void *buffer, unsigned long length, int max_sbals)
{
struct scatterlist sg_segment;
zfcp_address_to_sg(buffer, &sg_segment);
sg_segment.length = length;
return zfcp_qdio_sbals_from_sg(fsf_req, sbtype, &sg_segment, 1,
max_sbals);
}
/** /**
* zfcp_qdio_sbals_from_scsicmnd - fill SBALs from scsi command * zfcp_qdio_sbals_from_scsicmnd - fill SBALs from scsi command
* @fsf_req: request to be processed * @fsf_req: request to be processed
...@@ -664,18 +640,13 @@ int ...@@ -664,18 +640,13 @@ int
zfcp_qdio_sbals_from_scsicmnd(struct zfcp_fsf_req *fsf_req, zfcp_qdio_sbals_from_scsicmnd(struct zfcp_fsf_req *fsf_req,
unsigned long sbtype, struct scsi_cmnd *scsi_cmnd) unsigned long sbtype, struct scsi_cmnd *scsi_cmnd)
{ {
if (scsi_cmnd->use_sg) { if (scsi_sg_count(scsi_cmnd))
return zfcp_qdio_sbals_from_sg(fsf_req, sbtype, return zfcp_qdio_sbals_from_sg(fsf_req, sbtype,
(struct scatterlist *) scsi_sglist(scsi_cmnd),
scsi_cmnd->request_buffer, scsi_sg_count(scsi_cmnd),
scsi_cmnd->use_sg,
ZFCP_MAX_SBALS_PER_REQ); ZFCP_MAX_SBALS_PER_REQ);
} else { else
return zfcp_qdio_sbals_from_buffer(fsf_req, sbtype, return 0;
scsi_cmnd->request_buffer,
scsi_cmnd->request_bufflen,
ZFCP_MAX_SBALS_PER_REQ);
}
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment