aboutsummaryrefslogtreecommitdiffstats
path: root/fs/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/buffer.c')
-rw-r--r--fs/buffer.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/fs/buffer.c b/fs/buffer.c
index 70e2017edd70..36d66653b931 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -1384,10 +1384,23 @@ static void invalidate_bh_lru(void *arg)
1384 } 1384 }
1385 put_cpu_var(bh_lrus); 1385 put_cpu_var(bh_lrus);
1386} 1386}
1387
1388static bool has_bh_in_lru(int cpu, void *dummy)
1389{
1390 struct bh_lru *b = per_cpu_ptr(&bh_lrus, cpu);
1391 int i;
1387 1392
1393 for (i = 0; i < BH_LRU_SIZE; i++) {
1394 if (b->bhs[i])
1395 return 1;
1396 }
1397
1398 return 0;
1399}
1400
1388void invalidate_bh_lrus(void) 1401void invalidate_bh_lrus(void)
1389{ 1402{
1390 on_each_cpu(invalidate_bh_lru, NULL, 1); 1403 on_each_cpu_cond(has_bh_in_lru, invalidate_bh_lru, NULL, 1, GFP_KERNEL);
1391} 1404}
1392EXPORT_SYMBOL_GPL(invalidate_bh_lrus); 1405EXPORT_SYMBOL_GPL(invalidate_bh_lrus);
1393 1406