aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2010-07-19 00:56:17 -0400
committerDave Chinner <david@fromorbit.com>2010-07-19 00:56:17 -0400
commit7f8275d0d660c146de6ee3017e1e2e594c49e820 (patch)
tree884db927118b44102750b5168ee36ef4b8b5cb4e /arch
parentd0c6f6258478e1dba532bf7c28e2cd6e1047d3a4 (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 'arch')
-rw-r--r--arch/x86/kvm/mmu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 3699613e883..b1ed0a1a591 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -2926,7 +2926,7 @@ static int kvm_mmu_remove_some_alloc_mmu_pages(struct kvm *kvm)
2926 return kvm_mmu_zap_page(kvm, page) + 1; 2926 return kvm_mmu_zap_page(kvm, page) + 1;
2927} 2927}
2928 2928
2929static int mmu_shrink(int nr_to_scan, gfp_t gfp_mask) 2929static int mmu_shrink(struct shrinker *shrink, int nr_to_scan, gfp_t gfp_mask)
2930{ 2930{
2931 struct kvm *kvm; 2931 struct kvm *kvm;
2932 struct kvm *kvm_freed = NULL; 2932 struct kvm *kvm_freed = NULL;