diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-15 21:58:04 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-15 21:58:04 -0400 |
commit | 89a93f2f4834f8c126e8d9dd6b368d0b9e21ec3d (patch) | |
tree | e731456fec0cab1225ad3e806dc8d3efefa0a78b /drivers/infiniband/ulp/iser/iser_verbs.c | |
parent | 260eddf4391f162a69d1d163729249635fa7a78f (diff) | |
parent | fe9233fb6914a0eb20166c967e3020f7f0fba2c9 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (102 commits)
[SCSI] scsi_dh: fix kconfig related build errors
[SCSI] sym53c8xx: Fix bogus sym_que_entry re-implementation of container_of
[SCSI] scsi_cmnd.h: remove double inclusion of linux/blkdev.h
[SCSI] make struct scsi_{host,target}_type static
[SCSI] fix locking in host use of blk_plug_device()
[SCSI] zfcp: Cleanup external header file
[SCSI] zfcp: Cleanup code in zfcp_erp.c
[SCSI] zfcp: zfcp_fsf cleanup.
[SCSI] zfcp: consolidate sysfs things into one file.
[SCSI] zfcp: Cleanup of code in zfcp_aux.c
[SCSI] zfcp: Cleanup of code in zfcp_scsi.c
[SCSI] zfcp: Move status accessors from zfcp to SCSI include file.
[SCSI] zfcp: Small QDIO cleanups
[SCSI] zfcp: Adapter reopen for large number of unsolicited status
[SCSI] zfcp: Fix error checking for ELS ADISC requests
[SCSI] zfcp: wait until adapter is finished with ERP during auto-port
[SCSI] ibmvfc: IBM Power Virtual Fibre Channel Adapter Client Driver
[SCSI] sg: Add target reset support
[SCSI] lib: Add support for the T10 (SCSI) Data Integrity Field CRC
[SCSI] sd: Move scsi_disk() accessor function to sd.h
...
Diffstat (limited to 'drivers/infiniband/ulp/iser/iser_verbs.c')
-rw-r--r-- | drivers/infiniband/ulp/iser/iser_verbs.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/drivers/infiniband/ulp/iser/iser_verbs.c b/drivers/infiniband/ulp/iser/iser_verbs.c index 77cabee7cc08..3a917c1f796f 100644 --- a/drivers/infiniband/ulp/iser/iser_verbs.c +++ b/drivers/infiniband/ulp/iser/iser_verbs.c | |||
@@ -323,7 +323,18 @@ static void iser_conn_release(struct iser_conn *ib_conn) | |||
323 | iser_device_try_release(device); | 323 | iser_device_try_release(device); |
324 | if (ib_conn->iser_conn) | 324 | if (ib_conn->iser_conn) |
325 | ib_conn->iser_conn->ib_conn = NULL; | 325 | ib_conn->iser_conn->ib_conn = NULL; |
326 | kfree(ib_conn); | 326 | iscsi_destroy_endpoint(ib_conn->ep); |
327 | } | ||
328 | |||
329 | void iser_conn_get(struct iser_conn *ib_conn) | ||
330 | { | ||
331 | atomic_inc(&ib_conn->refcount); | ||
332 | } | ||
333 | |||
334 | void iser_conn_put(struct iser_conn *ib_conn) | ||
335 | { | ||
336 | if (atomic_dec_and_test(&ib_conn->refcount)) | ||
337 | iser_conn_release(ib_conn); | ||
327 | } | 338 | } |
328 | 339 | ||
329 | /** | 340 | /** |
@@ -347,7 +358,7 @@ void iser_conn_terminate(struct iser_conn *ib_conn) | |||
347 | wait_event_interruptible(ib_conn->wait, | 358 | wait_event_interruptible(ib_conn->wait, |
348 | ib_conn->state == ISER_CONN_DOWN); | 359 | ib_conn->state == ISER_CONN_DOWN); |
349 | 360 | ||
350 | iser_conn_release(ib_conn); | 361 | iser_conn_put(ib_conn); |
351 | } | 362 | } |
352 | 363 | ||
353 | static void iser_connect_error(struct rdma_cm_id *cma_id) | 364 | static void iser_connect_error(struct rdma_cm_id *cma_id) |
@@ -481,24 +492,15 @@ static int iser_cma_handler(struct rdma_cm_id *cma_id, struct rdma_cm_event *eve | |||
481 | return ret; | 492 | return ret; |
482 | } | 493 | } |
483 | 494 | ||
484 | int iser_conn_init(struct iser_conn **ibconn) | 495 | void iser_conn_init(struct iser_conn *ib_conn) |
485 | { | 496 | { |
486 | struct iser_conn *ib_conn; | ||
487 | |||
488 | ib_conn = kzalloc(sizeof *ib_conn, GFP_KERNEL); | ||
489 | if (!ib_conn) { | ||
490 | iser_err("can't alloc memory for struct iser_conn\n"); | ||
491 | return -ENOMEM; | ||
492 | } | ||
493 | ib_conn->state = ISER_CONN_INIT; | 497 | ib_conn->state = ISER_CONN_INIT; |
494 | init_waitqueue_head(&ib_conn->wait); | 498 | init_waitqueue_head(&ib_conn->wait); |
495 | atomic_set(&ib_conn->post_recv_buf_count, 0); | 499 | atomic_set(&ib_conn->post_recv_buf_count, 0); |
496 | atomic_set(&ib_conn->post_send_buf_count, 0); | 500 | atomic_set(&ib_conn->post_send_buf_count, 0); |
501 | atomic_set(&ib_conn->refcount, 1); | ||
497 | INIT_LIST_HEAD(&ib_conn->conn_list); | 502 | INIT_LIST_HEAD(&ib_conn->conn_list); |
498 | spin_lock_init(&ib_conn->lock); | 503 | spin_lock_init(&ib_conn->lock); |
499 | |||
500 | *ibconn = ib_conn; | ||
501 | return 0; | ||
502 | } | 504 | } |
503 | 505 | ||
504 | /** | 506 | /** |