diff options
author | Eric Dumazet <dada1@cosmosbay.com> | 2008-01-01 21:58:02 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 15:00:31 -0800 |
commit | 9a429c4983deae020f1e757ecc8f547b6d4e2f2b (patch) | |
tree | 172e27a5866e182b902cd77506df1755aafadb60 /net/core | |
parent | b950dfcf504842a0f2bb142a33ef938f1c00d300 (diff) | |
download | linux-9a429c4983deae020f1e757ecc8f547b6d4e2f2b.tar.bz2 |
[NET]: Add some acquires/releases sparse annotations.
Add __acquires() and __releases() annotations to suppress some sparse
warnings.
example of warnings :
net/ipv4/udp.c:1555:14: warning: context imbalance in 'udp_seq_start' - wrong
count at exit
net/ipv4/udp.c:1571:13: warning: context imbalance in 'udp_seq_stop' -
unexpected unlock
Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/dev.c | 2 | ||||
-rw-r--r-- | net/core/dev_mcast.c | 2 | ||||
-rw-r--r-- | net/core/gen_stats.c | 1 | ||||
-rw-r--r-- | net/core/neighbour.c | 2 | ||||
-rw-r--r-- | net/core/sock.c | 2 |
5 files changed, 9 insertions, 0 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 7153e94f50ad..eee774243097 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -2368,6 +2368,7 @@ static int dev_ifconf(struct net *net, char __user *arg) * in detail. */ void *dev_seq_start(struct seq_file *seq, loff_t *pos) + __acquires(dev_base_lock) { struct net *net = seq_file_net(seq); loff_t off; @@ -2394,6 +2395,7 @@ void *dev_seq_next(struct seq_file *seq, void *v, loff_t *pos) } void dev_seq_stop(struct seq_file *seq, void *v) + __releases(dev_base_lock) { read_unlock(&dev_base_lock); } diff --git a/net/core/dev_mcast.c b/net/core/dev_mcast.c index 63f0b33d7ced..cadbfbf7e7f5 100644 --- a/net/core/dev_mcast.c +++ b/net/core/dev_mcast.c @@ -186,6 +186,7 @@ EXPORT_SYMBOL(dev_mc_unsync); #ifdef CONFIG_PROC_FS static void *dev_mc_seq_start(struct seq_file *seq, loff_t *pos) + __acquires(dev_base_lock) { struct net *net = seq_file_net(seq); struct net_device *dev; @@ -206,6 +207,7 @@ static void *dev_mc_seq_next(struct seq_file *seq, void *v, loff_t *pos) } static void dev_mc_seq_stop(struct seq_file *seq, void *v) + __releases(dev_base_lock) { read_unlock(&dev_base_lock); } diff --git a/net/core/gen_stats.c b/net/core/gen_stats.c index bcc25591d8ac..8073561f7c63 100644 --- a/net/core/gen_stats.c +++ b/net/core/gen_stats.c @@ -55,6 +55,7 @@ rtattr_failure: int gnet_stats_start_copy_compat(struct sk_buff *skb, int type, int tc_stats_type, int xstats_type, spinlock_t *lock, struct gnet_dump *d) + __acquires(lock) { memset(d, 0, sizeof(*d)); diff --git a/net/core/neighbour.c b/net/core/neighbour.c index bd899d557737..802493327a87 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c @@ -2313,6 +2313,7 @@ static void *neigh_get_idx_any(struct seq_file *seq, loff_t *pos) } void *neigh_seq_start(struct seq_file *seq, loff_t *pos, struct neigh_table *tbl, unsigned int neigh_seq_flags) + __acquires(tbl->lock) { struct neigh_seq_state *state = seq->private; loff_t pos_minus_one; @@ -2356,6 +2357,7 @@ out: EXPORT_SYMBOL(neigh_seq_next); void neigh_seq_stop(struct seq_file *seq, void *v) + __releases(tbl->lock) { struct neigh_seq_state *state = seq->private; struct neigh_table *tbl = state->tbl; diff --git a/net/core/sock.c b/net/core/sock.c index 3804e7df626b..3d7757ee2fc8 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -2025,6 +2025,7 @@ EXPORT_SYMBOL(proto_unregister); #ifdef CONFIG_PROC_FS static void *proto_seq_start(struct seq_file *seq, loff_t *pos) + __acquires(proto_list_lock) { read_lock(&proto_list_lock); return seq_list_start_head(&proto_list, *pos); @@ -2036,6 +2037,7 @@ static void *proto_seq_next(struct seq_file *seq, void *v, loff_t *pos) } static void proto_seq_stop(struct seq_file *seq, void *v) + __releases(proto_list_lock) { read_unlock(&proto_list_lock); } |