ALSA: hda - Add SSID table for MacBookAir2,1
[safe/jmp/linux-2.6] / net / rds / af_rds.c
index f81862b..aebfecb 100644 (file)
@@ -158,9 +158,10 @@ static unsigned int rds_poll(struct file *file, struct socket *sock,
        unsigned int mask = 0;
        unsigned long flags;
 
-       poll_wait(file, sk->sk_sleep, wait);
+       poll_wait(file, sk_sleep(sk), wait);
 
-       poll_wait(file, &rds_poll_waitq, wait);
+       if (rs->rs_seen_congestion)
+               poll_wait(file, &rds_poll_waitq, wait);
 
        read_lock_irqsave(&rs->rs_recv_lock, flags);
        if (!rs->rs_cong_monitor) {
@@ -182,6 +183,10 @@ static unsigned int rds_poll(struct file *file, struct socket *sock,
                mask |= (POLLOUT | POLLWRNORM);
        read_unlock_irqrestore(&rs->rs_recv_lock, flags);
 
+       /* clear state any time we wake a seen-congested socket */
+       if (mask)
+               rs->rs_seen_congestion = 0;
+
        return mask;
 }
 
@@ -447,7 +452,6 @@ static void rds_sock_inc_info(struct socket *sock, unsigned int len,
                              struct rds_info_lengths *lens)
 {
        struct rds_sock *rs;
-       struct sock *sk;
        struct rds_incoming *inc;
        unsigned long flags;
        unsigned int total = 0;
@@ -457,7 +461,6 @@ static void rds_sock_inc_info(struct socket *sock, unsigned int len,
        spin_lock_irqsave(&rds_sock_lock, flags);
 
        list_for_each_entry(rs, &rds_sock_list, rs_item) {
-               sk = rds_rs_to_sk(rs);
                read_lock(&rs->rs_recv_lock);
 
                /* XXX too lazy to maintain counts.. */