IB/srpt: Use a mutex to protect the channel list
authorBart Van Assche <bart.vanassche@sandisk.com>
Thu, 11 Feb 2016 19:08:34 +0000 (11:08 -0800)
committerDoug Ledford <dledford@redhat.com>
Mon, 29 Feb 2016 22:12:36 +0000 (17:12 -0500)
commit8628991fbe6a9086189f55f0b33dee7f25108ecc
tree4cfe8e1c7373c8a93c1d68de0a3b815d98c86240
parentc13c90ea6762d834a07c0aa18134d98794f6fc3d
IB/srpt: Use a mutex to protect the channel list

In a later patch a function that can block will be called while
iterating over the rch_list. Hence protect that list with a
mutex instead of a spinlock. And since it is not allowed to sleep
while the task state != TASK_RUNNING, convert the list test in
srpt_ch_list_empty() into a lockless test.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: Sagi Grimberg <sagig@mellanox.com>
Cc: Alex Estrin <alex.estrin@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/ulp/srpt/ib_srpt.c
drivers/infiniband/ulp/srpt/ib_srpt.h