RDMA/core: Define client_data_lock as rwlock instead of spinlock

Even though device registration/unregistration and client
registration/unregistration is not a performance path, define the
client_data_lock as rwlock for code clarity.

Signed-off-by: Parav Pandit <parav@mellanox.com>
Reviewed-by: Daniel Jurgens <danielj@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
This commit is contained in:
Parav Pandit
2018-08-28 15:08:45 +03:00
committed by Jason Gunthorpe
parent 2d65f49ff9
commit e1f540c3ed
2 changed files with 18 additions and 17 deletions

View File

@@ -2256,10 +2256,11 @@ struct ib_device {
struct list_head event_handler_list;
spinlock_t event_handler_lock;
spinlock_t client_data_lock;
rwlock_t client_data_lock;
struct list_head core_list;
/* Access to the client_data_list is protected by the client_data_lock
* spinlock and the lists_rwsem read-write semaphore */
* rwlock and the lists_rwsem read-write semaphore
*/
struct list_head client_data_list;
struct ib_cache cache;