]> git.baikalelectronics.ru Git - kernel.git/commit
mm: add context argument to shrinker callback
authorDave Chinner <dchinner@redhat.com>
Mon, 19 Jul 2010 04:56:17 +0000 (14:56 +1000)
committerDave Chinner <david@fromorbit.com>
Mon, 19 Jul 2010 04:56:17 +0000 (14:56 +1000)
commitca84b09ea887f6b66b9c4c4f8af832a36d286ec4
tree884db927118b44102750b5168ee36ef4b8b5cb4e
parent76f4af144798c245aacb1a897f7b223a883b8f94
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>
18 files changed:
arch/x86/kvm/mmu.c
drivers/gpu/drm/i915/i915_gem.c
fs/dcache.c
fs/gfs2/glock.c
fs/gfs2/quota.c
fs/gfs2/quota.h
fs/inode.c
fs/mbcache.c
fs/nfs/dir.c
fs/nfs/internal.h
fs/quota/dquot.c
fs/ubifs/shrinker.c
fs/ubifs/ubifs.h
fs/xfs/linux-2.6/xfs_buf.c
fs/xfs/linux-2.6/xfs_sync.c
fs/xfs/quota/xfs_qm.c
include/linux/mm.h
mm/vmscan.c