summaryrefslogtreecommitdiffstats
path: root/lib/ratelimit.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2010-04-13 00:28:45 -0700
committerDavid S. Miller <davem@davemloft.net>2010-04-13 00:28:45 -0700
commit9343af084c7e8911897b0883042ee690cee3aaef (patch)
tree6211a4bdc84690bec6530d27a3abb19f5e8bb8f3 /lib/ratelimit.c
parente182c77cc291456eed127b1472952ddb59a81a9d (diff)
parent0d0fb0f9c5fddef4a10242fe3337f00f528a3099 (diff)
downloadop-kernel-dev-9343af084c7e8911897b0883042ee690cee3aaef.zip
op-kernel-dev-9343af084c7e8911897b0883042ee690cee3aaef.tar.gz
Merge branch 'master' of /home/davem/src/GIT/linux-2.6/
Conflicts: lib/Kconfig.debug
Diffstat (limited to 'lib/ratelimit.c')
-rw-r--r--lib/ratelimit.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/ratelimit.c b/lib/ratelimit.c
index 09f5ce1..027a03f 100644
--- a/lib/ratelimit.c
+++ b/lib/ratelimit.c
@@ -16,9 +16,14 @@
/*
* __ratelimit - rate limiting
* @rs: ratelimit_state data
+ * @func: name of calling function
*
- * This enforces a rate limit: not more than @rs->ratelimit_burst callbacks
- * in every @rs->ratelimit_jiffies
+ * This enforces a rate limit: not more than @rs->burst callbacks
+ * in every @rs->interval
+ *
+ * RETURNS:
+ * 0 means callbacks will be suppressed.
+ * 1 means go ahead and do it.
*/
int ___ratelimit(struct ratelimit_state *rs, const char *func)
{
@@ -35,7 +40,7 @@ int ___ratelimit(struct ratelimit_state *rs, const char *func)
* the entity that is holding the lock already:
*/
if (!spin_trylock_irqsave(&rs->lock, flags))
- return 1;
+ return 0;
if (!rs->begin)
rs->begin = jiffies;
OpenPOWER on IntegriCloud