Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 111260
b: refs/heads/master
c: 7f93ea3
h: refs/heads/master
v: v3
  • Loading branch information
Johannes Berg authored and John W. Linville committed Aug 29, 2008
1 parent 29ff3f0 commit ac31dd3
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 40 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: af01d537463714e36e2c96d2da35902b76cd6827
refs/heads/master: 7f93ea3e246db512c0c17b79847f57dd3a2891e1
2 changes: 0 additions & 2 deletions trunk/include/net/inet_connection_sock.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,12 @@ struct inet_connection_sock_af_ops {
char __user *optval, int optlen);
int (*getsockopt)(struct sock *sk, int level, int optname,
char __user *optval, int __user *optlen);
#ifdef CONFIG_COMPAT
int (*compat_setsockopt)(struct sock *sk,
int level, int optname,
char __user *optval, int optlen);
int (*compat_getsockopt)(struct sock *sk,
int level, int optname,
char __user *optval, int __user *optlen);
#endif
void (*addr2sockaddr)(struct sock *sk, struct sockaddr *);
int (*bind_conflict)(const struct sock *sk,
const struct inet_bind_bucket *tb);
Expand Down
2 changes: 0 additions & 2 deletions trunk/include/net/sock.h
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,6 @@ struct proto {
int (*getsockopt)(struct sock *sk, int level,
int optname, char __user *optval,
int __user *option);
#ifdef CONFIG_COMPAT
int (*compat_setsockopt)(struct sock *sk,
int level,
int optname, char __user *optval,
Expand All @@ -541,7 +540,6 @@ struct proto {
int level,
int optname, char __user *optval,
int __user *option);
#endif
int (*sendmsg)(struct kiocb *iocb, struct sock *sk,
struct msghdr *msg, size_t len);
int (*recvmsg)(struct kiocb *iocb, struct sock *sk,
Expand Down
6 changes: 1 addition & 5 deletions trunk/net/ipv4/inet_diag.c
Original file line number Diff line number Diff line change
Expand Up @@ -782,15 +782,11 @@ static int inet_diag_dump(struct sk_buff *skb, struct netlink_callback *cb)
struct sock *sk;
struct hlist_node *node;

num = 0;

if (hlist_empty(&head->chain) && hlist_empty(&head->twchain))
continue;

if (i > s_i)
s_num = 0;

read_lock_bh(lock);
num = 0;
sk_for_each(sk, node, &head->chain) {
struct inet_sock *inet = inet_sk(sk);

Expand Down
14 changes: 4 additions & 10 deletions trunk/net/ipv4/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,6 @@ static struct rtable *rt_cache_get_first(struct seq_file *seq)
struct rtable *r = NULL;

for (st->bucket = rt_hash_mask; st->bucket >= 0; --st->bucket) {
if (!rt_hash_table[st->bucket].chain)
continue;
rcu_read_lock_bh();
r = rcu_dereference(rt_hash_table[st->bucket].chain);
while (r) {
Expand All @@ -301,14 +299,11 @@ static struct rtable *__rt_cache_get_next(struct seq_file *seq,
struct rtable *r)
{
struct rt_cache_iter_state *st = seq->private;

r = r->u.dst.rt_next;
while (!r) {
rcu_read_unlock_bh();
do {
if (--st->bucket < 0)
return NULL;
} while (!rt_hash_table[st->bucket].chain);
if (--st->bucket < 0)
break;
rcu_read_lock_bh();
r = rt_hash_table[st->bucket].chain;
}
Expand Down Expand Up @@ -2845,9 +2840,7 @@ int ip_rt_dump(struct sk_buff *skb, struct netlink_callback *cb)
if (s_h < 0)
s_h = 0;
s_idx = idx = cb->args[1];
for (h = s_h; h <= rt_hash_mask; h++, s_idx = 0) {
if (!rt_hash_table[h].chain)
continue;
for (h = s_h; h <= rt_hash_mask; h++) {
rcu_read_lock_bh();
for (rt = rcu_dereference(rt_hash_table[h].chain), idx = 0; rt;
rt = rcu_dereference(rt->u.dst.rt_next), idx++) {
Expand All @@ -2866,6 +2859,7 @@ int ip_rt_dump(struct sk_buff *skb, struct netlink_callback *cb)
dst_release(xchg(&skb->dst, NULL));
}
rcu_read_unlock_bh();
s_idx = 0;
}

done:
Expand Down
26 changes: 7 additions & 19 deletions trunk/net/ipv4/tcp_ipv4.c
Original file line number Diff line number Diff line change
Expand Up @@ -1946,12 +1946,6 @@ static void *listening_get_idx(struct seq_file *seq, loff_t *pos)
return rc;
}

static inline int empty_bucket(struct tcp_iter_state *st)
{
return hlist_empty(&tcp_hashinfo.ehash[st->bucket].chain) &&
hlist_empty(&tcp_hashinfo.ehash[st->bucket].twchain);
}

static void *established_get_first(struct seq_file *seq)
{
struct tcp_iter_state* st = seq->private;
Expand All @@ -1964,10 +1958,6 @@ static void *established_get_first(struct seq_file *seq)
struct inet_timewait_sock *tw;
rwlock_t *lock = inet_ehash_lockp(&tcp_hashinfo, st->bucket);

/* Lockless fast path for the common case of empty buckets */
if (empty_bucket(st))
continue;

read_lock_bh(lock);
sk_for_each(sk, node, &tcp_hashinfo.ehash[st->bucket].chain) {
if (sk->sk_family != st->family ||
Expand Down Expand Up @@ -2018,15 +2008,13 @@ static void *established_get_next(struct seq_file *seq, void *cur)
read_unlock_bh(inet_ehash_lockp(&tcp_hashinfo, st->bucket));
st->state = TCP_SEQ_STATE_ESTABLISHED;

/* Look for next non empty bucket */
while (++st->bucket < tcp_hashinfo.ehash_size &&
empty_bucket(st))
;
if (st->bucket >= tcp_hashinfo.ehash_size)
return NULL;

read_lock_bh(inet_ehash_lockp(&tcp_hashinfo, st->bucket));
sk = sk_head(&tcp_hashinfo.ehash[st->bucket].chain);
if (++st->bucket < tcp_hashinfo.ehash_size) {
read_lock_bh(inet_ehash_lockp(&tcp_hashinfo, st->bucket));
sk = sk_head(&tcp_hashinfo.ehash[st->bucket].chain);
} else {
cur = NULL;
goto out;
}
} else
sk = sk_next(sk);

Expand Down
5 changes: 4 additions & 1 deletion trunk/net/mac80211/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ int ieee80211_start_tx_ba_session(struct ieee80211_hw *hw, u8 *ra, u16 tid)
struct ieee80211_local *local = hw_to_local(hw);
struct sta_info *sta;
struct ieee80211_sub_if_data *sdata;
u16 start_seq_num = 0;
u16 start_seq_num;
u8 *state;
int ret;
DECLARE_MAC_BUF(mac);
Expand Down Expand Up @@ -678,6 +678,9 @@ int ieee80211_start_tx_ba_session(struct ieee80211_hw *hw, u8 *ra, u16 tid)
* call back right away, it must see that the flow has begun */
*state |= HT_ADDBA_REQUESTED_MSK;

/* This is slightly racy because the queue isn't stopped */
start_seq_num = sta->tid_seq[tid];

if (local->ops->ampdu_action)
ret = local->ops->ampdu_action(hw, IEEE80211_AMPDU_TX_START,
ra, tid, &start_seq_num);
Expand Down

0 comments on commit ac31dd3

Please sign in to comment.