Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 156297
b: refs/heads/master
c: 426f605
h: refs/heads/master
i:
  156295: cefea80
v: v3
  • Loading branch information
Christof Schmitt authored and James Bottomley committed Jul 30, 2009
1 parent 6128896 commit 56ab05c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 688a1820bde27749f22b18b94ef1c9bc179b1b29
refs/heads/master: 426f6059b0eb66cec139f4b9066168ab72b85774
33 changes: 25 additions & 8 deletions trunk/drivers/s390/scsi/zfcp_fsf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1010,6 +1010,23 @@ static void zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *req)
send_ct->handler(send_ct->handler_data);
}

static void zfcp_fsf_setup_ct_els_unchained(struct qdio_buffer_element *sbale,
struct scatterlist *sg_req,
struct scatterlist *sg_resp)
{
sbale[0].flags |= SBAL_FLAGS0_TYPE_WRITE_READ;
sbale[2].addr = sg_virt(sg_req);
sbale[2].length = sg_req->length;
sbale[3].addr = sg_virt(sg_resp);
sbale[3].length = sg_resp->length;
sbale[3].flags |= SBAL_FLAGS_LAST_ENTRY;
}

static int zfcp_fsf_one_sbal(struct scatterlist *sg)
{
return sg_is_last(sg) && sg->length <= PAGE_SIZE;
}

static int zfcp_fsf_setup_ct_els_sbals(struct zfcp_fsf_req *req,
struct scatterlist *sg_req,
struct scatterlist *sg_resp,
Expand All @@ -1020,16 +1037,16 @@ static int zfcp_fsf_setup_ct_els_sbals(struct zfcp_fsf_req *req,
int bytes;

if (!(feat & FSF_FEATURE_ELS_CT_CHAINED_SBALS)) {
if (sg_req->length > PAGE_SIZE || sg_resp->length > PAGE_SIZE ||
!sg_is_last(sg_req) || !sg_is_last(sg_resp))
if (!zfcp_fsf_one_sbal(sg_req) || !zfcp_fsf_one_sbal(sg_resp))
return -EOPNOTSUPP;

sbale[0].flags |= SBAL_FLAGS0_TYPE_WRITE_READ;
sbale[2].addr = sg_virt(sg_req);
sbale[2].length = sg_req->length;
sbale[3].addr = sg_virt(sg_resp);
sbale[3].length = sg_resp->length;
sbale[3].flags |= SBAL_FLAGS_LAST_ENTRY;
zfcp_fsf_setup_ct_els_unchained(sbale, sg_req, sg_resp);
return 0;
}

/* use single, unchained SBAL if it can hold the request */
if (zfcp_fsf_one_sbal(sg_req) && zfcp_fsf_one_sbal(sg_resp)) {
zfcp_fsf_setup_ct_els_unchained(sbale, sg_req, sg_resp);
return 0;
}

Expand Down

0 comments on commit 56ab05c

Please sign in to comment.