Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 286717
b: refs/heads/master
c: efc3dbc
h: refs/heads/master
i:
  286715: 584c665
v: v3
  • Loading branch information
David S. Miller committed Jan 24, 2012
1 parent 0f2f33a commit 0d2defe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 36a1211970193ce215de50ed1e4e1272bc814df1
refs/heads/master: efc3dbc37412c027e363736b4f4c74ee5e8ecffc
20 changes: 8 additions & 12 deletions trunk/net/rds/af_rds.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ static int rds_release(struct socket *sock)
{
struct sock *sk = sock->sk;
struct rds_sock *rs;
unsigned long flags;

if (!sk)
goto out;
Expand All @@ -94,10 +93,10 @@ static int rds_release(struct socket *sock)
rds_rdma_drop_keys(rs);
rds_notify_queue_get(rs, NULL);

spin_lock_irqsave(&rds_sock_lock, flags);
spin_lock_bh(&rds_sock_lock);
list_del_init(&rs->rs_item);
rds_sock_count--;
spin_unlock_irqrestore(&rds_sock_lock, flags);
spin_unlock_bh(&rds_sock_lock);

rds_trans_put(rs->rs_transport);

Expand Down Expand Up @@ -409,7 +408,6 @@ static const struct proto_ops rds_proto_ops = {

static int __rds_create(struct socket *sock, struct sock *sk, int protocol)
{
unsigned long flags;
struct rds_sock *rs;

sock_init_data(sock, sk);
Expand All @@ -426,10 +424,10 @@ static int __rds_create(struct socket *sock, struct sock *sk, int protocol)
spin_lock_init(&rs->rs_rdma_lock);
rs->rs_rdma_keys = RB_ROOT;

spin_lock_irqsave(&rds_sock_lock, flags);
spin_lock_bh(&rds_sock_lock);
list_add_tail(&rs->rs_item, &rds_sock_list);
rds_sock_count++;
spin_unlock_irqrestore(&rds_sock_lock, flags);
spin_unlock_bh(&rds_sock_lock);

return 0;
}
Expand Down Expand Up @@ -471,12 +469,11 @@ static void rds_sock_inc_info(struct socket *sock, unsigned int len,
{
struct rds_sock *rs;
struct rds_incoming *inc;
unsigned long flags;
unsigned int total = 0;

len /= sizeof(struct rds_info_message);

spin_lock_irqsave(&rds_sock_lock, flags);
spin_lock_bh(&rds_sock_lock);

list_for_each_entry(rs, &rds_sock_list, rs_item) {
read_lock(&rs->rs_recv_lock);
Expand All @@ -492,7 +489,7 @@ static void rds_sock_inc_info(struct socket *sock, unsigned int len,
read_unlock(&rs->rs_recv_lock);
}

spin_unlock_irqrestore(&rds_sock_lock, flags);
spin_unlock_bh(&rds_sock_lock);

lens->nr = total;
lens->each = sizeof(struct rds_info_message);
Expand All @@ -504,11 +501,10 @@ static void rds_sock_info(struct socket *sock, unsigned int len,
{
struct rds_info_socket sinfo;
struct rds_sock *rs;
unsigned long flags;

len /= sizeof(struct rds_info_socket);

spin_lock_irqsave(&rds_sock_lock, flags);
spin_lock_bh(&rds_sock_lock);

if (len < rds_sock_count)
goto out;
Expand All @@ -529,7 +525,7 @@ static void rds_sock_info(struct socket *sock, unsigned int len,
lens->nr = rds_sock_count;
lens->each = sizeof(struct rds_info_socket);

spin_unlock_irqrestore(&rds_sock_lock, flags);
spin_unlock_bh(&rds_sock_lock);
}

static void rds_exit(void)
Expand Down

0 comments on commit 0d2defe

Please sign in to comment.