]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitdfd6440e9ac4521e3810232b790dac36f18a6e0b
tree4cfe8e1c7373c8a93c1d68de0a3b815d98c86240
parent334dddcff1dcc1f3ba377c9a1d5a46a6eacf1685
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