dir.c (6988f20fe04e9ef3aea488cb8ab57fbeb78e12f0) | dir.c (1495f230fa7750479c79e3656286b9183d662077) |
---|---|
1/* 2 * linux/fs/nfs/dir.c 3 * 4 * Copyright (C) 1992 Rick Sladkey 5 * 6 * nfs directory handling functions 7 * 8 * 10 Apr 1996 Added silly rename for unlink --okir --- 2028 unchanged lines hidden (view full) --- 2037 2038 while (!list_empty(head)) { 2039 cache = list_entry(head->next, struct nfs_access_entry, lru); 2040 list_del(&cache->lru); 2041 nfs_access_free_entry(cache); 2042 } 2043} 2044 | 1/* 2 * linux/fs/nfs/dir.c 3 * 4 * Copyright (C) 1992 Rick Sladkey 5 * 6 * nfs directory handling functions 7 * 8 * 10 Apr 1996 Added silly rename for unlink --okir --- 2028 unchanged lines hidden (view full) --- 2037 2038 while (!list_empty(head)) { 2039 cache = list_entry(head->next, struct nfs_access_entry, lru); 2040 list_del(&cache->lru); 2041 nfs_access_free_entry(cache); 2042 } 2043} 2044 |
2045int nfs_access_cache_shrinker(struct shrinker *shrink, int nr_to_scan, gfp_t gfp_mask) | 2045int nfs_access_cache_shrinker(struct shrinker *shrink, 2046 struct shrink_control *sc) |
2046{ 2047 LIST_HEAD(head); 2048 struct nfs_inode *nfsi, *next; 2049 struct nfs_access_entry *cache; | 2047{ 2048 LIST_HEAD(head); 2049 struct nfs_inode *nfsi, *next; 2050 struct nfs_access_entry *cache; |
2051 int nr_to_scan = sc->nr_to_scan; 2052 gfp_t gfp_mask = sc->gfp_mask; |
|
2050 2051 if ((gfp_mask & GFP_KERNEL) != GFP_KERNEL) 2052 return (nr_to_scan == 0) ? 0 : -1; 2053 2054 spin_lock(&nfs_access_lru_lock); 2055 list_for_each_entry_safe(nfsi, next, &nfs_access_lru_list, access_cache_inode_lru) { 2056 struct inode *inode; 2057 --- 285 unchanged lines hidden --- | 2053 2054 if ((gfp_mask & GFP_KERNEL) != GFP_KERNEL) 2055 return (nr_to_scan == 0) ? 0 : -1; 2056 2057 spin_lock(&nfs_access_lru_lock); 2058 list_for_each_entry_safe(nfsi, next, &nfs_access_lru_list, access_cache_inode_lru) { 2059 struct inode *inode; 2060 --- 285 unchanged lines hidden --- |