HomeFreeBSD

Linux shrinker compat

Description

Linux shrinker compat

The Linux shrinker has gone through three API changes since 2.6.22.
Rather than force every caller to understand all three APIs this
change consolidates the compatibility code in to the mm-compat.h
header. The caller then can then use a single spl provided
shrinker API which does the right thing for your kernel.

SPL_SHRINKER_CALLBACK_PROTO(shrinker_callback, cb, nr_to_scan, gfp_mask);
SPL_SHRINKER_DECLARE(shrinker_struct, shrinker_callback, seeks);
spl_register_shrinker(&shrinker_struct);
spl_unregister_shrinker(&&shrinker_struct);
spl_exec_shrinker(&shrinker_struct, nr_to_scan, gfp_mask);

Details

Provenance
Brian Behlendorf <behlendorf1@llnl.gov>Authored on Mar 23 2011, 10:45 PM
Parents
rG91cb1d91a4cf: Add .va_dentry helper
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG495bd532ab4a: Linux shrinker compat (authored by Brian Behlendorf <behlendorf1@llnl.gov>).Apr 7 2011, 3:06 AM