All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christof Schmitt <christof.schmitt@de.ibm.com>
To: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: linux-scsi@vger.kernel.org, linux-s390@vger.kernel.org,
	schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com,
	Christof Schmitt <christof.schmitt@de.ibm.com>
Subject: [patch 9/9] zfcp: Update FC pass-through support
Date: Fri, 15 May 2009 13:18:22 +0200	[thread overview]
Message-ID: <20090515112222.484664000@de.ibm.com> (raw)
In-Reply-To: 20090515111813.314177000@de.ibm.com

[-- Attachment #1: fc-up.diff --]
[-- Type: text/plain, Size: 2463 bytes --]

From: Christof Schmitt <christof.schmitt@de.ibm.com>

Don't access the block layer request, get the payload length instead
from the FC job. Simplify access to the zfcp_port, only the d_id is
required, if the port is no longer accessed later. This is possible
when the els_handler does not access the port pointer from the ELS
request.

Reviewed-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
---
 drivers/s390/scsi/zfcp_fc.c  |    9 +++------
 drivers/s390/scsi/zfcp_fsf.c |    3 ++-
 2 files changed, 5 insertions(+), 7 deletions(-)

--- a/drivers/s390/scsi/zfcp_fc.c	2009-05-15 12:56:21.000000000 +0200
+++ b/drivers/s390/scsi/zfcp_fc.c	2009-05-15 12:56:24.000000000 +0200
@@ -704,7 +704,7 @@ static void zfcp_fc_generic_els_handler(
 	}
 
 	reply->reply_data.ctels_reply.status = FC_CTELS_STATUS_OK;
-	reply->reply_payload_rcv_len = blk_rq_bytes(job->req->next_rq);
+	reply->reply_payload_rcv_len = job->reply_payload.payload_len;
 
 out:
 	job->state_flags = FC_RQST_STATE_DONE;
@@ -736,15 +736,12 @@ int zfcp_fc_execute_els_fc_job(struct fc
 		read_lock_irq(&zfcp_data.config_lock);
 		port = rport->dd_data;
 		if (port)
-			zfcp_port_get(port);
+			els_fc_job->els.d_id = port->d_id;
 		read_unlock_irq(&zfcp_data.config_lock);
 		if (!port) {
 			kfree(els_fc_job);
 			return -EINVAL;
 		}
-		els_fc_job->els.port = port;
-		els_fc_job->els.d_id = port->d_id;
-		zfcp_port_put(port);
 	} else {
 		port_did = job->request->rqst_data.h_els.port_id;
 		els_fc_job->els.d_id = (port_did[0] << 16) +
@@ -772,8 +769,8 @@ static void zfcp_fc_generic_ct_handler(u
 
 	job->reply->reply_data.ctels_reply.status = ct_fc_job->ct.status ?
 				FC_CTELS_STATUS_REJECT : FC_CTELS_STATUS_OK;
+	job->reply->reply_payload_rcv_len = job->reply_payload.payload_len;
 	job->state_flags = FC_RQST_STATE_DONE;
-	job->reply->reply_payload_rcv_len = blk_rq_bytes(job->req->next_rq);
 	job->job_done(job);
 
 	zfcp_wka_port_put(ct_fc_job->ct.wka_port);
--- a/drivers/s390/scsi/zfcp_fsf.c	2009-05-15 12:56:22.000000000 +0200
+++ b/drivers/s390/scsi/zfcp_fsf.c	2009-05-15 12:56:24.000000000 +0200
@@ -1146,7 +1146,8 @@ static void zfcp_fsf_send_els_handler(st
 	case FSF_RESPONSE_SIZE_TOO_LARGE:
 		break;
 	case FSF_ACCESS_DENIED:
-		zfcp_fsf_access_denied_port(req, port);
+		if (port)
+			zfcp_fsf_access_denied_port(req, port);
 		break;
 	case FSF_SBAL_MISMATCH:
 		/* should never occure, avoided in zfcp_fsf_send_els */

      parent reply	other threads:[~2009-05-15 11:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-15 11:18 [patch 0/9] zfcp updates for 2.6.31 Christof Schmitt
2009-05-15 11:18 ` [patch 1/9] zfcp: Use correct req_id for traces Christof Schmitt
2009-05-15 11:18 ` [patch 2/9] zfcp: Update message and add description Christof Schmitt
2009-05-15 11:18 ` [patch 3/9] zfcp: Make queue_depth adjustable Christof Schmitt
2009-05-15 11:18 ` [patch 4/9] zfcp: Remove unnecessary default case and assignments Christof Schmitt
2009-05-15 11:18 ` [patch 5/9] zfcp: Add comments to switch/case fallthroughs Christof Schmitt
2009-05-15 11:18 ` [patch 6/9] zfcp: Increase ref counter for port open requests Christof Schmitt
2009-05-15 11:18 ` [patch 7/9] zfcp: Changed D_ID left port disabled Christof Schmitt
2009-05-15 11:18 ` [patch 8/9] zfcp: Keep ccw device and model id in zfcp_ccw.c Christof Schmitt
2009-05-15 11:18 ` Christof Schmitt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090515112222.484664000@de.ibm.com \
    --to=christof.schmitt@de.ibm.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=linux-s390@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=schwidefsky@de.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.