提交 62bdb645 编写于 作者: J Joe Eykholt 提交者: James Bottomley

[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: NJoe Eykholt <jeykholt@cisco.com>
Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
上级 04885b16
...@@ -1282,6 +1282,8 @@ static void fc_exch_recv_abts(struct fc_exch *ep, struct fc_frame *rx_fp) ...@@ -1282,6 +1282,8 @@ static void fc_exch_recv_abts(struct fc_exch *ep, struct fc_frame *rx_fp)
* @fp: The request frame * @fp: The request frame
* *
* On success, the sequence pointer will be returned and also in fr_seq(@fp). * 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) static struct fc_seq *fc_seq_assign(struct fc_lport *lport, struct fc_frame *fp)
{ {
...@@ -1298,6 +1300,15 @@ static struct fc_seq *fc_seq_assign(struct fc_lport *lport, struct fc_frame *fp) ...@@ -1298,6 +1300,15 @@ static struct fc_seq *fc_seq_assign(struct fc_lport *lport, struct fc_frame *fp)
return fr_seq(fp); return fr_seq(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 * fc_exch_recv_req() - Handler for an incoming request
* @lport: The local port that received the request * @lport: The local port that received the request
...@@ -2369,6 +2380,9 @@ int fc_exch_init(struct fc_lport *lport) ...@@ -2369,6 +2380,9 @@ int fc_exch_init(struct fc_lport *lport)
if (!lport->tt.seq_assign) if (!lport->tt.seq_assign)
lport->tt.seq_assign = fc_seq_assign; lport->tt.seq_assign = fc_seq_assign;
if (!lport->tt.seq_release)
lport->tt.seq_release = fc_seq_release;
return 0; return 0;
} }
EXPORT_SYMBOL(fc_exch_init); EXPORT_SYMBOL(fc_exch_init);
......
...@@ -571,6 +571,13 @@ struct libfc_function_template { ...@@ -571,6 +571,13 @@ struct libfc_function_template {
*/ */
struct fc_seq *(*seq_assign)(struct fc_lport *, struct fc_frame *); struct fc_seq *(*seq_assign)(struct fc_lport *, struct fc_frame *);
/*
* Release the reference on the sequence returned by seq_assign().
*
* STATUS: OPTIONAL
*/
void (*seq_release)(struct fc_seq *);
/* /*
* Reset an exchange manager, completing all sequences and exchanges. * Reset an exchange manager, completing all sequences and exchanges.
* If s_id is non-zero, reset only exchanges originating from that FID. * If s_id is non-zero, reset only exchanges originating from that FID.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册