summaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorJoe Eykholt <jeykholt@cisco.com>2011-01-28 16:04:34 -0800
committerJames Bottomley <James.Bottomley@suse.de>2011-02-12 11:03:40 -0600
commit62bdb6455e8326f864ae1b43b4c4db7f630edc1c (patch)
treea802a76583670b42d7d36f69241e6bb31ff49b16 /drivers/scsi
parent04885b16a1ec86b4670702b99a81805e66bf9f30 (diff)
downloadop-kernel-dev-62bdb6455e8326f864ae1b43b4c4db7f630edc1c.zip
op-kernel-dev-62bdb6455e8326f864ae1b43b4c4db7f630edc1c.tar.gz
[SCSI] libfc: export seq_release() for users of seq_assign()
Target modules using lport->tt.seq_assign() get a hold on the exchange but have no way of releasing it. Add that. Signed-off-by: Joe Eykholt <jeykholt@cisco.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/libfc/fc_exch.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c
index 1f124c0..a3d6402 100644
--- a/drivers/scsi/libfc/fc_exch.c
+++ b/drivers/scsi/libfc/fc_exch.c
@@ -1282,6 +1282,8 @@ free:
* @fp: The request frame
*
* On success, the sequence pointer will be returned and also in fr_seq(@fp).
+ * A reference will be held on the exchange/sequence for the caller, which
+ * must call fc_seq_release().
*/
static struct fc_seq *fc_seq_assign(struct fc_lport *lport, struct fc_frame *fp)
{
@@ -1299,6 +1301,15 @@ static struct fc_seq *fc_seq_assign(struct fc_lport *lport, struct fc_frame *fp)
}
/**
+ * fc_seq_release() - Release the hold
+ * @sp: The sequence.
+ */
+static void fc_seq_release(struct fc_seq *sp)
+{
+ fc_exch_release(fc_seq_exch(sp));
+}
+
+/**
* fc_exch_recv_req() - Handler for an incoming request
* @lport: The local port that received the request
* @mp: The EM that the exchange is on
@@ -2369,6 +2380,9 @@ int fc_exch_init(struct fc_lport *lport)
if (!lport->tt.seq_assign)
lport->tt.seq_assign = fc_seq_assign;
+ if (!lport->tt.seq_release)
+ lport->tt.seq_release = fc_seq_release;
+
return 0;
}
EXPORT_SYMBOL(fc_exch_init);
OpenPOWER on IntegriCloud