aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-03 17:46:46 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-03 17:46:46 -0700
commit31218ffa5c408e13a209fb6c131e417a8805e579 (patch)
treed8d5c43a89b24924c17761defb4ae864f9d38f20
parenta0b8e21ee69ccfbed49d93707b033d59d6f2ff58 (diff)
parent983c00c800a3cf44b589750a16bbf22ff7a15a11 (diff)
downloadhistory-31218ffa5c408e13a209fb6c131e417a8805e579.tar.gz
Merge bk://kernel.bkbits.net/davem/net-2.6
into ppc970.osdl.org:/home/torvalds/v2.6/linux
-rw-r--r--MAINTAINERS2
-rw-r--r--include/net/gen_stats.h3
-rw-r--r--net/core/gen_stats.c48
-rw-r--r--net/core/sock.c2
-rw-r--r--net/sched/act_api.c2
5 files changed, 37 insertions, 20 deletions
diff --git a/MAINTAINERS b/MAINTAINERS
index 2d0fd20388cef7..df8f605703103c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -605,7 +605,7 @@ P: Herbert Xu
M: herbert@gondor.apana.org.au
P: David S. Miller
M: davem@davemloft.net
-L: linux-kernel@vger.kernel.org
+L: linux-crypto@vger.kernel.org
S: Maintained
CYBERPRO FB DRIVER
diff --git a/include/net/gen_stats.h b/include/net/gen_stats.h
index 9a9bea508d1beb..0b95cf031d6e0f 100644
--- a/include/net/gen_stats.h
+++ b/include/net/gen_stats.h
@@ -15,7 +15,8 @@ struct gnet_dump
/* Backward compatability */
int compat_tc_stats;
int compat_xstats;
- struct rtattr * xstats;
+ void * xstats;
+ int xstats_len;
struct tc_stats tc_stats;
};
diff --git a/net/core/gen_stats.c b/net/core/gen_stats.c
index ebb86fbd23ab65..8f21490355fa5b 100644
--- a/net/core/gen_stats.c
+++ b/net/core/gen_stats.c
@@ -26,9 +26,7 @@
static inline int
gnet_stats_copy(struct gnet_dump *d, int type, void *buf, int size)
{
- if (type)
- RTA_PUT(d->skb, type, size, buf);
-
+ RTA_PUT(d->skb, type, size, buf);
return 0;
rtattr_failure:
@@ -58,6 +56,8 @@ 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)
{
+ memset(d, 0, sizeof(*d));
+
spin_lock_bh(lock);
d->lock = lock;
if (type)
@@ -65,12 +65,11 @@ gnet_stats_start_copy_compat(struct sk_buff *skb, int type, int tc_stats_type,
d->skb = skb;
d->compat_tc_stats = tc_stats_type;
d->compat_xstats = xstats_type;
- d->xstats = NULL;
- if (d->compat_tc_stats)
- memset(&d->tc_stats, 0, sizeof(d->tc_stats));
+ if (d->tail)
+ return gnet_stats_copy(d, type, NULL, 0);
- return gnet_stats_copy(d, type, NULL, 0);
+ return 0;
}
/**
@@ -111,8 +110,11 @@ gnet_stats_copy_basic(struct gnet_dump *d, struct gnet_stats_basic *b)
d->tc_stats.bytes = b->bytes;
d->tc_stats.packets = b->packets;
}
-
- return gnet_stats_copy(d, TCA_STATS_BASIC, b, sizeof(*b));
+
+ if (d->tail)
+ return gnet_stats_copy(d, TCA_STATS_BASIC, b, sizeof(*b));
+
+ return 0;
}
/**
@@ -134,7 +136,10 @@ gnet_stats_copy_rate_est(struct gnet_dump *d, struct gnet_stats_rate_est *r)
d->tc_stats.pps = r->pps;
}
- return gnet_stats_copy(d, TCA_STATS_RATE_EST, r, sizeof(*r));
+ if (d->tail)
+ return gnet_stats_copy(d, TCA_STATS_RATE_EST, r, sizeof(*r));
+
+ return 0;
}
/**
@@ -157,8 +162,11 @@ gnet_stats_copy_queue(struct gnet_dump *d, struct gnet_stats_queue *q)
d->tc_stats.backlog = q->backlog;
d->tc_stats.overlimits = q->overlimits;
}
-
- return gnet_stats_copy(d, TCA_STATS_QUEUE, q, sizeof(*q));
+
+ if (d->tail)
+ return gnet_stats_copy(d, TCA_STATS_QUEUE, q, sizeof(*q));
+
+ return 0;
}
/**
@@ -177,9 +185,15 @@ gnet_stats_copy_queue(struct gnet_dump *d, struct gnet_stats_queue *q)
int
gnet_stats_copy_app(struct gnet_dump *d, void *st, int len)
{
- if (d->compat_xstats)
- d->xstats = (struct rtattr *) d->skb->tail;
- return gnet_stats_copy(d, TCA_STATS_APP, st, len);
+ if (d->compat_xstats) {
+ d->xstats = st;
+ d->xstats_len = len;
+ }
+
+ if (d->tail)
+ return gnet_stats_copy(d, TCA_STATS_APP, st, len);
+
+ return 0;
}
/**
@@ -206,8 +220,8 @@ gnet_stats_finish_copy(struct gnet_dump *d)
return -1;
if (d->compat_xstats && d->xstats) {
- if (gnet_stats_copy(d, d->compat_xstats, RTA_DATA(d->xstats),
- RTA_PAYLOAD(d->xstats)) < 0)
+ if (gnet_stats_copy(d, d->compat_xstats, d->xstats,
+ d->xstats_len) < 0)
return -1;
}
diff --git a/net/core/sock.c b/net/core/sock.c
index 29e8a34d83edb4..629ab4a5b45b5a 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -1352,7 +1352,7 @@ void sk_common_release(struct sock *sk)
EXPORT_SYMBOL(sk_common_release);
-static rwlock_t proto_list_lock;
+static DEFINE_RWLOCK(proto_list_lock);
static LIST_HEAD(proto_list);
int proto_register(struct proto *prot, int alloc_slab)
diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index 88962fa33199fb..5e6cc371b39ea6 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -397,6 +397,8 @@ int tcf_action_copy_stats(struct sk_buff *skb, struct tc_action *a,
if (a->type == TCA_OLD_COMPAT)
err = gnet_stats_start_copy_compat(skb, 0,
TCA_STATS, TCA_XSTATS, h->stats_lock, &d);
+ else
+ return 0;
} else
err = gnet_stats_start_copy(skb, TCA_ACT_STATS,
h->stats_lock, &d);