mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
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 <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]>
This commit is contained in:
parent
d0c6f62584
commit
7f8275d0d6
18 changed files with 31 additions and 22 deletions
|
|
@ -1358,7 +1358,7 @@ void gfs2_glock_complete(struct gfs2_glock *gl, int ret)
|
|||
}
|
||||
|
||||
|
||||
static int gfs2_shrink_glock_memory(int nr, gfp_t gfp_mask)
|
||||
static int gfs2_shrink_glock_memory(struct shrinker *shrink, int nr, gfp_t gfp_mask)
|
||||
{
|
||||
struct gfs2_glock *gl;
|
||||
int may_demote;
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ static LIST_HEAD(qd_lru_list);
|
|||
static atomic_t qd_lru_count = ATOMIC_INIT(0);
|
||||
static DEFINE_SPINLOCK(qd_lru_lock);
|
||||
|
||||
int gfs2_shrink_qd_memory(int nr, gfp_t gfp_mask)
|
||||
int gfs2_shrink_qd_memory(struct shrinker *shrink, int nr, gfp_t gfp_mask)
|
||||
{
|
||||
struct gfs2_quota_data *qd;
|
||||
struct gfs2_sbd *sdp;
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ static inline int gfs2_quota_lock_check(struct gfs2_inode *ip)
|
|||
return ret;
|
||||
}
|
||||
|
||||
extern int gfs2_shrink_qd_memory(int nr, gfp_t gfp_mask);
|
||||
extern int gfs2_shrink_qd_memory(struct shrinker *shrink, int nr, gfp_t gfp_mask);
|
||||
extern const struct quotactl_ops gfs2_quotactl_ops;
|
||||
|
||||
#endif /* __QUOTA_DOT_H__ */
|
||||
|
|
|
|||
Loading…
Reference in a new issue