Skip to contentSkip to conversation

mm: shrinkers: Add missing includes for undeclared types

PATCH Applied T.J. Mercier 1 participant 1 message Nov 15, 2022 Shrinker

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm: shrinkers: Add missing includes for undeclared types

The shrinker.h header depends on a user including other headers before it for types used by shrinker.h. Fix this by including the appropriate headers in shrinker.h.

./include/linux/shrinker.h:13:9: error: unknown type name ‘gfp_t’

   13 |         gfp_t gfp_mask;
      |         ^~~~~

./include/linux/shrinker.h:71:26: error: field ‘list’ has incomplete type
71 | struct list_head list;
| ^~~~
./include/linux/shrinker.h:82:9: error: unknown type name ‘atomic_long_t’

   82 |         atomic_long_t *nr_deferred;
      |
Fixes 83aeeada7c69 ("vmscan: use atomic-long for shrinker batching")
Fixes b0d40c92adaf ("superblock: introduce per-sb cache shrinker infrastructure")
---
 include/linux/shrinker.h | 3 +++
 1 file changed, 3 insertions(+)
include/linux/shrinker.h +3 -0
index 08e6054e061f..71310efe2fab 100644
@@ -2,6 +2,9 @@
 #ifndef _LINUX_SHRINKER_H
 #define _LINUX_SHRINKER_H
 
+#include <linux/atomic.h>
+#include <linux/types.h>
+
 /*
  * This struct is used to pass information from page reclaim to the shrinkers.
  * We consolidate the values for easier extension later.
Signature · 1 line
2.38.1.493.g58b659f92b-goog