#include <linux/workqueue.h>
#include <linux/wait.h>
+#include <linux/rwsem.h>
#include <net/inet_sock.h>
#include <net/tcp.h> /* For urgent data flags */
#include <rdma/ib_verbs.h>
void sdp_reset(struct sock *sk);
int sdp_tx_wait_memory(struct sdp_sock *ssk, long *timeo_p, int *credits_needed);
void sdp_skb_entail(struct sock *sk, struct sk_buff *skb);
-extern rwlock_t device_removal_lock;
+extern struct rw_semaphore device_removal_lock;
/* sdp_proc.c */
int __init sdp_proc_init(void);
bh_unlock_sock(child);
__sock_put(child, SOCK_REF_CLONE);
- read_lock(&device_removal_lock);
+ down_read(&device_removal_lock);
rc = sdp_init_qp(child, id);
if (rc) {
- read_unlock(&device_removal_lock);
+ up_read(&device_removal_lock);
sdp_sk(child)->destructed_already = 1;
sk_free(child);
return rc;
}
sdp_add_sock(sdp_sk(child));
- read_unlock(&device_removal_lock);
+ up_read(&device_removal_lock);
sdp_sk(child)->max_bufs = ntohs(h->bsdh.bufs);
atomic_set(&sdp_sk(child)->tx_ring.credits, sdp_sk(child)->max_bufs);
struct list_head sock_list;
spinlock_t sock_list_lock;
-DEFINE_RWLOCK(device_removal_lock);
+DECLARE_RWSEM(device_removal_lock);
static inline unsigned int sdp_keepalive_time_when(const struct sdp_sock *ssk)
{
ssk->destructed_already = 1;
- read_lock(&device_removal_lock);
+ down_read(&device_removal_lock);
sdp_remove_sock(ssk);
sdp_destroy_resources(sk);
- read_unlock(&device_removal_lock);
+ up_read(&device_removal_lock);
flush_scheduled_work();
/* destroy_ids: */
do_next:
- write_lock(&device_removal_lock);
+ down_write(&device_removal_lock);
spin_lock_irq(&sock_list_lock);
list_for_each_entry(ssk, &sock_list, sock_list) {
ssk->id_destroyed_already = 1;
release_sock(sk);
- write_unlock(&device_removal_lock);
+ up_write(&device_removal_lock);
if (id)
rdma_destroy_id(id);
spin_unlock_irq(&sock_list_lock);
- write_unlock(&device_removal_lock);
+ up_write(&device_removal_lock);
if (!sdp_dev)
return;