diff options
author | Tim Chase <tim@chase2k.com> | 2014-10-02 07:40:05 -0500 |
---|---|---|
committer | Brian Behlendorf <behlendorf1@llnl.gov> | 2014-10-28 09:20:13 -0700 |
commit | 802a4a2ad53f6844ce2dbbf219a5e373ebd24688 (patch) | |
tree | 12575c949da73fa28af4a854ea387ae1f0f28a2d /include/linux | |
parent | 46c936756ea26a52945eb8e8756e7c44ea9fc125 (diff) |
Linux 3.12 compat: shrinker semantics
The new shrinker API as of Linux 3.12 modifies "struct shrinker" by
replacing the @shrink callback with the pair of @count_objects and
@scan_objects. It also requires the return value of @count_objects to
return the number of objects actually freed whereas the previous @shrink
callback returned the number of remaining freeable objects.
This patch adds support for the new @scan_objects return value semantics
and updates the splat shrinker test case appropriately.
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tim Chase <tim@chase2k.com>
Closes #403
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/mm_compat.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/mm_compat.h b/include/linux/mm_compat.h index 456fc51fc..7ae940a75 100644 --- a/include/linux/mm_compat.h +++ b/include/linux/mm_compat.h @@ -199,4 +199,11 @@ fn ## _scan_objects(struct shrinker *shrink, struct shrink_control *sc) \ #error "Unknown shrinker callback" #endif +#if defined(HAVE_SPLIT_SHRINKER_CALLBACK) +typedef unsigned long spl_shrinker_t; +#else +typedef int spl_shrinker_t; +#define SHRINK_STOP (-1) +#endif + #endif /* SPL_MM_COMPAT_H */ |