]> git.baikalelectronics.ru Git - kernel.git/commit
RDMA/cm: Pull duplicated code into cm_queue_work_unlock()
authorJason Gunthorpe <jgg@mellanox.com>
Wed, 6 May 2020 07:46:55 +0000 (10:46 +0300)
committerJason Gunthorpe <jgg@mellanox.com>
Wed, 13 May 2020 00:32:53 +0000 (21:32 -0300)
commite83f195aa45c1ffd73b3a950a887e41c260cf194
tree8ec6e568b0b83678803f0be44bb069b519519a82
parent42113eed8f10533ba419df535b6c0ff9141a948c
RDMA/cm: Pull duplicated code into cm_queue_work_unlock()

While unlocking a spinlock held by the caller is a disturbing pattern,
this extensively duplicated code is even worse. Pull all the duplicates
into a function and explain the purpose of the algorithm.

The on creation side call in cm_req_handler() which is different has been
micro-optimized on the basis that the work_count == -1 during creation,
remove that and just use the normal function.

Link: https://lore.kernel.org/r/20200506074701.9775-5-leon@kernel.org
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/core/cm.c