diff options
author | Dave Chinner <dchinner@redhat.com> | 2010-07-19 00:56:17 -0400 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2010-07-19 00:56:17 -0400 |
commit | 7f8275d0d660c146de6ee3017e1e2e594c49e820 (patch) | |
tree | 884db927118b44102750b5168ee36ef4b8b5cb4e /include | |
parent | d0c6f6258478e1dba532bf7c28e2cd6e1047d3a4 (diff) |
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 'include')
-rw-r--r-- | include/linux/mm.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h index b969efb03787..a2b48041b910 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -999,7 +999,7 @@ static inline void sync_mm_rss(struct task_struct *task, struct mm_struct *mm) | |||
999 | * querying the cache size, so a fastpath for that case is appropriate. | 999 | * querying the cache size, so a fastpath for that case is appropriate. |
1000 | */ | 1000 | */ |
1001 | struct shrinker { | 1001 | struct shrinker { |
1002 | int (*shrink)(int nr_to_scan, gfp_t gfp_mask); | 1002 | int (*shrink)(struct shrinker *, int nr_to_scan, gfp_t gfp_mask); |
1003 | int seeks; /* seeks to recreate an obj */ | 1003 | int seeks; /* seeks to recreate an obj */ |
1004 | 1004 | ||
1005 | /* These are for internal use */ | 1005 | /* These are for internal use */ |