Revision 4b2a108cd0d34880fe9d932258ca5b2ccebcd05e authored by Sebastian Andrzej Siewior on 22 June 2009, 07:18:05 UTC, committed by Pierre Ossman on 31 July 2009, 10:28:46 UTC
the code allready uses flush_kernel_dcache_page(). This patch updates the driver to the recent sg API changes which require that either SG_MITER_TO_SG or SG_MITER_FROM_SG is set. SG_MITER_TO_SG calls flush_kernel_dcache_page() in sg_mitter_stop() Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc> Acked-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: Pierre Ossman <pierre@ossman.eu>
1 parent da60a91
ratelimit.c
/*
* ratelimit.c - Do something with rate limit.
*
* Isolated from kernel/printk.c by Dave Young <hidave.darkstar@gmail.com>
*
* 2008-05-01 rewrite the function and use a ratelimit_state data struct as
* parameter. Now every user can use their own standalone ratelimit_state.
*
* This file is released under the GPLv2.
*
*/
#include <linux/kernel.h>
#include <linux/jiffies.h>
#include <linux/module.h>
static DEFINE_SPINLOCK(ratelimit_lock);
/*
* __ratelimit - rate limiting
* @rs: ratelimit_state data
*
* This enforces a rate limit: not more than @rs->ratelimit_burst callbacks
* in every @rs->ratelimit_jiffies
*/
int __ratelimit(struct ratelimit_state *rs)
{
unsigned long flags;
if (!rs->interval)
return 1;
spin_lock_irqsave(&ratelimit_lock, flags);
if (!rs->begin)
rs->begin = jiffies;
if (time_is_before_jiffies(rs->begin + rs->interval)) {
if (rs->missed)
printk(KERN_WARNING "%s: %d callbacks suppressed\n",
__func__, rs->missed);
rs->begin = 0;
rs->printed = 0;
rs->missed = 0;
}
if (rs->burst && rs->burst > rs->printed)
goto print;
rs->missed++;
spin_unlock_irqrestore(&ratelimit_lock, flags);
return 0;
print:
rs->printed++;
spin_unlock_irqrestore(&ratelimit_lock, flags);
return 1;
}
EXPORT_SYMBOL(__ratelimit);
Computing file changes ...