lkml.org 
[lkml]   [2010]   [Mar]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC PATCH 3/3] ratelimit: Fix return value when fail to get lock
Date
From log of commit edaac8e3167501cda336231d00611bf59c164346,
It seems that we want to suppress the callback when trylock
fails.

Signed-off-by: Yong Zhang <yong.zhang@windriver.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
---
lib/ratelimit.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/ratelimit.c b/lib/ratelimit.c
index 29a10b3..358638f 100644
--- a/lib/ratelimit.c
+++ b/lib/ratelimit.c
@@ -40,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;
--
1.6.3.3


\
 
 \ /
  Last update: 2010-03-17 04:03    [W:0.058 / U:0.832 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site