mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-23 02:44:41 +03:00
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
This commit is contained in:
committed by
Brian Behlendorf
parent
46c936756e
commit
802a4a2ad5
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user