提交 41179e2d 编写于 作者: R Roland Dreier

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: NRoland Dreier <rolandd@cisco.com>
上级 e4daf738
...@@ -310,8 +310,6 @@ int iser_conn_init(struct iser_conn **ib_conn); ...@@ -310,8 +310,6 @@ int iser_conn_init(struct iser_conn **ib_conn);
void iser_conn_terminate(struct iser_conn *ib_conn); void iser_conn_terminate(struct iser_conn *ib_conn);
void iser_conn_release(struct iser_conn *ib_conn);
void iser_rcv_completion(struct iser_desc *desc, void iser_rcv_completion(struct iser_desc *desc,
unsigned long dto_xfer_len); unsigned long dto_xfer_len);
...@@ -329,9 +327,6 @@ void iser_reg_single(struct iser_device *device, ...@@ -329,9 +327,6 @@ void iser_reg_single(struct iser_device *device,
struct iser_regd_buf *regd_buf, struct iser_regd_buf *regd_buf,
enum dma_data_direction direction); enum dma_data_direction direction);
int iser_start_rdma_unaligned_sg(struct iscsi_iser_cmd_task *ctask,
enum iser_data_dir cmd_dir);
void iser_finalize_rdma_unaligned_sg(struct iscsi_iser_cmd_task *ctask, void iser_finalize_rdma_unaligned_sg(struct iscsi_iser_cmd_task *ctask,
enum iser_data_dir cmd_dir); enum iser_data_dir cmd_dir);
......
...@@ -103,8 +103,8 @@ void iser_reg_single(struct iser_device *device, ...@@ -103,8 +103,8 @@ void iser_reg_single(struct iser_device *device,
/** /**
* iser_start_rdma_unaligned_sg * iser_start_rdma_unaligned_sg
*/ */
int iser_start_rdma_unaligned_sg(struct iscsi_iser_cmd_task *iser_ctask, static int iser_start_rdma_unaligned_sg(struct iscsi_iser_cmd_task *iser_ctask,
enum iser_data_dir cmd_dir) enum iser_data_dir cmd_dir)
{ {
int dma_nents; int dma_nents;
struct ib_device *dev; struct ib_device *dev;
......
...@@ -310,6 +310,29 @@ static int iser_conn_state_comp_exch(struct iser_conn *ib_conn, ...@@ -310,6 +310,29 @@ static int iser_conn_state_comp_exch(struct iser_conn *ib_conn,
return ret; return ret;
} }
/**
* Frees all conn objects and deallocs conn descriptor
*/
static void iser_conn_release(struct iser_conn *ib_conn)
{
struct iser_device *device = ib_conn->device;
BUG_ON(ib_conn->state != ISER_CONN_DOWN);
mutex_lock(&ig.connlist_mutex);
list_del(&ib_conn->conn_list);
mutex_unlock(&ig.connlist_mutex);
iser_free_ib_conn_res(ib_conn);
ib_conn->device = NULL;
/* on EVENT_ADDR_ERROR there's no device yet for this conn */
if (device != NULL)
iser_device_try_release(device);
if (ib_conn->iser_conn)
ib_conn->iser_conn->ib_conn = NULL;
kfree(ib_conn);
}
/** /**
* triggers start of the disconnect procedures and wait for them to be done * triggers start of the disconnect procedures and wait for them to be done
*/ */
...@@ -549,30 +572,6 @@ int iser_connect(struct iser_conn *ib_conn, ...@@ -549,30 +572,6 @@ int iser_connect(struct iser_conn *ib_conn,
return err; return err;
} }
/**
* Frees all conn objects and deallocs conn descriptor
*/
void iser_conn_release(struct iser_conn *ib_conn)
{
struct iser_device *device = ib_conn->device;
BUG_ON(ib_conn->state != ISER_CONN_DOWN);
mutex_lock(&ig.connlist_mutex);
list_del(&ib_conn->conn_list);
mutex_unlock(&ig.connlist_mutex);
iser_free_ib_conn_res(ib_conn);
ib_conn->device = NULL;
/* on EVENT_ADDR_ERROR there's no device yet for this conn */
if (device != NULL)
iser_device_try_release(device);
if (ib_conn->iser_conn)
ib_conn->iser_conn->ib_conn = NULL;
kfree(ib_conn);
}
/** /**
* iser_reg_page_vec - Register physical memory * iser_reg_page_vec - Register physical memory
* *
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册