diff options
| author | Joe Eykholt <jeykholt@cisco.com> | 2011-01-28 19:04:34 -0500 |
|---|---|---|
| committer | James Bottomley <James.Bottomley@suse.de> | 2011-02-12 12:03:40 -0500 |
| commit | 62bdb6455e8326f864ae1b43b4c4db7f630edc1c (patch) | |
| tree | a802a76583670b42d7d36f69241e6bb31ff49b16 /drivers/scsi/libfc | |
| parent | 04885b16a1ec86b4670702b99a81805e66bf9f30 (diff) | |
[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/libfc')
| -rw-r--r-- | drivers/scsi/libfc/fc_exch.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c index 1f124c0351b..a3d640289dc 100644 --- a/drivers/scsi/libfc/fc_exch.c +++ b/drivers/scsi/libfc/fc_exch.c | |||
| @@ -1282,6 +1282,8 @@ free: | |||
| 1282 | * @fp: The request frame | 1282 | * @fp: The request frame |
| 1283 | * | 1283 | * |
| 1284 | * On success, the sequence pointer will be returned and also in fr_seq(@fp). | 1284 | * On success, the sequence pointer will be returned and also in fr_seq(@fp). |
| 1285 | * A reference will be held on the exchange/sequence for the caller, which | ||
| 1286 | * must call fc_seq_release(). | ||
| 1285 | */ | 1287 | */ |
| 1286 | static struct fc_seq *fc_seq_assign(struct fc_lport *lport, struct fc_frame *fp) | 1288 | static struct fc_seq *fc_seq_assign(struct fc_lport *lport, struct fc_frame *fp) |
| 1287 | { | 1289 | { |
| @@ -1299,6 +1301,15 @@ static struct fc_seq *fc_seq_assign(struct fc_lport *lport, struct fc_frame *fp) | |||
| 1299 | } | 1301 | } |
| 1300 | 1302 | ||
| 1301 | /** | 1303 | /** |
| 1304 | * fc_seq_release() - Release the hold | ||
| 1305 | * @sp: The sequence. | ||
| 1306 | */ | ||
| 1307 | static void fc_seq_release(struct fc_seq *sp) | ||
| 1308 | { | ||
| 1309 | fc_exch_release(fc_seq_exch(sp)); | ||
| 1310 | } | ||
| 1311 | |||
| 1312 | /** | ||
| 1302 | * fc_exch_recv_req() - Handler for an incoming request | 1313 | * fc_exch_recv_req() - Handler for an incoming request |
| 1303 | * @lport: The local port that received the request | 1314 | * @lport: The local port that received the request |
| 1304 | * @mp: The EM that the exchange is on | 1315 | * @mp: The EM that the exchange is on |
| @@ -2369,6 +2380,9 @@ int fc_exch_init(struct fc_lport *lport) | |||
| 2369 | if (!lport->tt.seq_assign) | 2380 | if (!lport->tt.seq_assign) |
| 2370 | lport->tt.seq_assign = fc_seq_assign; | 2381 | lport->tt.seq_assign = fc_seq_assign; |
| 2371 | 2382 | ||
| 2383 | if (!lport->tt.seq_release) | ||
| 2384 | lport->tt.seq_release = fc_seq_release; | ||
| 2385 | |||
| 2372 | return 0; | 2386 | return 0; |
| 2373 | } | 2387 | } |
| 2374 | EXPORT_SYMBOL(fc_exch_init); | 2388 | EXPORT_SYMBOL(fc_exch_init); |
