提交 94de178a 编写于 作者: K Krishna Kumar 提交者: Roland Dreier

RDMA/cma: Eliminate unnecessary remove_list

Eliminate remove_list by using list_del_init() instead during device
removal handling.
Signed-off-by: NKrishna Kumar <krkumar2@in.ibm.com>
Signed-off-by: NSean Hefty <sean.hefty@intel.com>
Signed-off-by: NRoland Dreier <rolandd@cisco.com>
上级 8f0472d3
...@@ -2151,12 +2151,9 @@ static int cma_remove_id_dev(struct rdma_id_private *id_priv) ...@@ -2151,12 +2151,9 @@ static int cma_remove_id_dev(struct rdma_id_private *id_priv)
static void cma_process_remove(struct cma_device *cma_dev) static void cma_process_remove(struct cma_device *cma_dev)
{ {
struct list_head remove_list;
struct rdma_id_private *id_priv; struct rdma_id_private *id_priv;
int ret; int ret;
INIT_LIST_HEAD(&remove_list);
mutex_lock(&lock); mutex_lock(&lock);
while (!list_empty(&cma_dev->id_list)) { while (!list_empty(&cma_dev->id_list)) {
id_priv = list_entry(cma_dev->id_list.next, id_priv = list_entry(cma_dev->id_list.next,
...@@ -2167,8 +2164,7 @@ static void cma_process_remove(struct cma_device *cma_dev) ...@@ -2167,8 +2164,7 @@ static void cma_process_remove(struct cma_device *cma_dev)
continue; continue;
} }
list_del(&id_priv->list); list_del_init(&id_priv->list);
list_add_tail(&id_priv->list, &remove_list);
atomic_inc(&id_priv->refcount); atomic_inc(&id_priv->refcount);
mutex_unlock(&lock); mutex_unlock(&lock);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册