aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRoland Dreier <rolandd@cisco.com>2007-07-17 21:37:42 -0400
committerRoland Dreier <rolandd@cisco.com>2007-07-17 21:37:42 -0400
commit41179e2de6962b46d1d9f2b4437243ac740efdec (patch)
tree1bde885003c2cbe1defc304db86667527dd4fbdc /drivers
parente4daf738683d9e87caf12f4249268d3c9ed2e00f (diff)
IB/iser: Make a couple of functions static
Make iser_conn_release() and iser_start_rdma_unaligned_sg() static, since they are only used in the .c file where they are defined. In addition to being a cleanup, this even shrinks the generated code by allowing the single call of iser_start_rdma_unaligned_sg() to be inlined into its callsite. On x86_64: add/remove: 0/1 grow/shrink: 1/0 up/down: 466/-533 (-67) function old new delta iser_reg_rdma_mem 1518 1984 +466 iser_start_rdma_unaligned_sg 533 - -533 Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/infiniband/ulp/iser/iscsi_iser.h5
-rw-r--r--drivers/infiniband/ulp/iser/iser_memory.c4
-rw-r--r--drivers/infiniband/ulp/iser/iser_verbs.c47
3 files changed, 25 insertions, 31 deletions
diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.h b/drivers/infiniband/ulp/iser/iscsi_iser.h
index e2353701e8bb..1ee867b1b341 100644
--- a/drivers/infiniband/ulp/iser/iscsi_iser.h
+++ b/drivers/infiniband/ulp/iser/iscsi_iser.h
@@ -310,8 +310,6 @@ int iser_conn_init(struct iser_conn **ib_conn);
310 310
311void iser_conn_terminate(struct iser_conn *ib_conn); 311void iser_conn_terminate(struct iser_conn *ib_conn);
312 312
313void iser_conn_release(struct iser_conn *ib_conn);
314
315void iser_rcv_completion(struct iser_desc *desc, 313void iser_rcv_completion(struct iser_desc *desc,
316 unsigned long dto_xfer_len); 314 unsigned long dto_xfer_len);
317 315
@@ -329,9 +327,6 @@ void iser_reg_single(struct iser_device *device,
329 struct iser_regd_buf *regd_buf, 327 struct iser_regd_buf *regd_buf,
330 enum dma_data_direction direction); 328 enum dma_data_direction direction);
331 329
332int iser_start_rdma_unaligned_sg(struct iscsi_iser_cmd_task *ctask,
333 enum iser_data_dir cmd_dir);
334
335void iser_finalize_rdma_unaligned_sg(struct iscsi_iser_cmd_task *ctask, 330void iser_finalize_rdma_unaligned_sg(struct iscsi_iser_cmd_task *ctask,
336 enum iser_data_dir cmd_dir); 331 enum iser_data_dir cmd_dir);
337 332
diff --git a/drivers/infiniband/ulp/iser/iser_memory.c b/drivers/infiniband/ulp/iser/iser_memory.c
index fc9f1fd0ae54..36cdf77ae92a 100644
--- a/drivers/infiniband/ulp/iser/iser_memory.c
+++ b/drivers/infiniband/ulp/iser/iser_memory.c
@@ -103,8 +103,8 @@ void iser_reg_single(struct iser_device *device,
103/** 103/**
104 * iser_start_rdma_unaligned_sg 104 * iser_start_rdma_unaligned_sg
105 */ 105 */
106int iser_start_rdma_unaligned_sg(struct iscsi_iser_cmd_task *iser_ctask, 106static int iser_start_rdma_unaligned_sg(struct iscsi_iser_cmd_task *iser_ctask,
107 enum iser_data_dir cmd_dir) 107 enum iser_data_dir cmd_dir)
108{ 108{
109 int dma_nents; 109 int dma_nents;
110 struct ib_device *dev; 110 struct ib_device *dev;
diff --git a/drivers/infiniband/ulp/iser/iser_verbs.c b/drivers/infiniband/ulp/iser/iser_verbs.c
index 2044de1164ac..d42ec0156eec 100644
--- a/drivers/infiniband/ulp/iser/iser_verbs.c
+++ b/drivers/infiniband/ulp/iser/iser_verbs.c
@@ -311,6 +311,29 @@ static int iser_conn_state_comp_exch(struct iser_conn *ib_conn,
311} 311}
312 312
313/** 313/**
314 * Frees all conn objects and deallocs conn descriptor
315 */
316static void iser_conn_release(struct iser_conn *ib_conn)
317{
318 struct iser_device *device = ib_conn->device;
319
320 BUG_ON(ib_conn->state != ISER_CONN_DOWN);
321
322 mutex_lock(&ig.connlist_mutex);
323 list_del(&ib_conn->conn_list);
324 mutex_unlock(&ig.connlist_mutex);
325
326 iser_free_ib_conn_res(ib_conn);
327 ib_conn->device = NULL;
328 /* on EVENT_ADDR_ERROR there's no device yet for this conn */
329 if (device != NULL)
330 iser_device_try_release(device);
331 if (ib_conn->iser_conn)
332 ib_conn->iser_conn->ib_conn = NULL;
333 kfree(ib_conn);
334}
335
336/**
314 * triggers start of the disconnect procedures and wait for them to be done 337 * triggers start of the disconnect procedures and wait for them to be done
315 */ 338 */
316void iser_conn_terminate(struct iser_conn *ib_conn) 339void iser_conn_terminate(struct iser_conn *ib_conn)
@@ -550,30 +573,6 @@ connect_failure:
550} 573}
551 574
552/** 575/**
553 * Frees all conn objects and deallocs conn descriptor
554 */
555void iser_conn_release(struct iser_conn *ib_conn)
556{
557 struct iser_device *device = ib_conn->device;
558
559 BUG_ON(ib_conn->state != ISER_CONN_DOWN);
560
561 mutex_lock(&ig.connlist_mutex);
562 list_del(&ib_conn->conn_list);
563 mutex_unlock(&ig.connlist_mutex);
564
565 iser_free_ib_conn_res(ib_conn);
566 ib_conn->device = NULL;
567 /* on EVENT_ADDR_ERROR there's no device yet for this conn */
568 if (device != NULL)
569 iser_device_try_release(device);
570 if (ib_conn->iser_conn)
571 ib_conn->iser_conn->ib_conn = NULL;
572 kfree(ib_conn);
573}
574
575
576/**
577 * iser_reg_page_vec - Register physical memory 576 * iser_reg_page_vec - Register physical memory
578 * 577 *
579 * returns: 0 on success, errno code on failure 578 * returns: 0 on success, errno code on failure