diff options
author | Dave Chinner <dchinner@redhat.com> | 2010-07-19 14:56:17 +1000 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2010-07-19 14:56:17 +1000 |
commit | 7f8275d0d660c146de6ee3017e1e2e594c49e820 (patch) | |
tree | 884db927118b44102750b5168ee36ef4b8b5cb4e /fs/dcache.c | |
parent | d0c6f6258478e1dba532bf7c28e2cd6e1047d3a4 (diff) | |
download | linux-3.10-7f8275d0d660c146de6ee3017e1e2e594c49e820.tar.gz linux-3.10-7f8275d0d660c146de6ee3017e1e2e594c49e820.tar.bz2 linux-3.10-7f8275d0d660c146de6ee3017e1e2e594c49e820.zip |
mm: add context argument to shrinker callback
The current shrinker implementation requires the registered callback
to have global state to work from. This makes it difficult to shrink
caches that are not global (e.g. per-filesystem caches). Pass the shrinker
structure to the callback so that users can embed the shrinker structure
in the context the shrinker needs to operate on and get back to it in the
callback via container_of().
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/dcache.c')
-rw-r--r-- | fs/dcache.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/dcache.c b/fs/dcache.c index c8c78ba0782..86d4db15473 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -896,7 +896,7 @@ EXPORT_SYMBOL(shrink_dcache_parent); * * In this case we return -1 to tell the caller that we baled. */ -static int shrink_dcache_memory(int nr, gfp_t gfp_mask) +static int shrink_dcache_memory(struct shrinker *shrink, int nr, gfp_t gfp_mask) { if (nr) { if (!(gfp_mask & __GFP_FS)) |