mirror of
https://github.com/torvalds/linux.git
synced 2024-11-15 00:21:59 +00:00
sunrpc: simplify do_cache_clean
Is it just me, or is the logic written in a slightly convoluted way? I find it a little easier to read this way. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
This commit is contained in:
parent
9dbc1f45d5
commit
0aa99c4d1f
@ -498,16 +498,17 @@ static int cache_clean(void)
|
||||
*/
|
||||
static void do_cache_clean(struct work_struct *work)
|
||||
{
|
||||
int delay = 5;
|
||||
if (cache_clean() == -1)
|
||||
delay = round_jiffies_relative(30*HZ);
|
||||
int delay;
|
||||
|
||||
if (list_empty(&cache_list))
|
||||
delay = 0;
|
||||
return;
|
||||
|
||||
if (delay)
|
||||
queue_delayed_work(system_power_efficient_wq,
|
||||
&cache_cleaner, delay);
|
||||
if (cache_clean() == -1)
|
||||
delay = round_jiffies_relative(30*HZ);
|
||||
else
|
||||
delay = 5;
|
||||
|
||||
queue_delayed_work(system_power_efficient_wq, &cache_cleaner, delay);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user