mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -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
|
|
@ -277,7 +277,7 @@ static int kick_a_thread(void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int ubifs_shrinker(int nr, gfp_t gfp_mask)
|
||||
int ubifs_shrinker(struct shrinker *shrink, int nr, gfp_t gfp_mask)
|
||||
{
|
||||
int freed, contention = 0;
|
||||
long clean_zn_cnt = atomic_long_read(&ubifs_clean_zn_cnt);
|
||||
|
|
|
|||
|
|
@ -1575,7 +1575,7 @@ int ubifs_tnc_start_commit(struct ubifs_info *c, struct ubifs_zbranch *zroot);
|
|||
int ubifs_tnc_end_commit(struct ubifs_info *c);
|
||||
|
||||
/* shrinker.c */
|
||||
int ubifs_shrinker(int nr_to_scan, gfp_t gfp_mask);
|
||||
int ubifs_shrinker(struct shrinker *shrink, int nr_to_scan, gfp_t gfp_mask);
|
||||
|
||||
/* commit.c */
|
||||
int ubifs_bg_thread(void *info);
|
||||
|
|
|
|||
Loading…
Reference in a new issue