diff options
Diffstat (limited to 'fs/drop_caches.c')
-rw-r--r-- | fs/drop_caches.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/fs/drop_caches.c b/fs/drop_caches.c index c00e055..cd5575b 100644 --- a/fs/drop_caches.c +++ b/fs/drop_caches.c @@ -49,6 +49,16 @@ static void drop_slab(void) } while (nr_objects > 10); } +#ifdef CONFIG_DMA_CMA +void perform_drop_caches(unsigned int mode) +{ + if (mode & 1) + iterate_supers(drop_pagecache_sb, NULL); + if (mode & 2) + drop_slab(); +} +#endif + int drop_caches_sysctl_handler(ctl_table *table, int write, void __user *buffer, size_t *length, loff_t *ppos) { @@ -57,11 +67,17 @@ int drop_caches_sysctl_handler(ctl_table *table, int write, ret = proc_dointvec_minmax(table, write, buffer, length, ppos); if (ret) return ret; + +#ifndef CONFIG_DMA_CMA if (write) { if (sysctl_drop_caches & 1) iterate_supers(drop_pagecache_sb, NULL); if (sysctl_drop_caches & 2) drop_slab(); } +#else + if (write) + perform_drop_caches(sysctl_drop_caches); +#endif return 0; } |