EXTENT_STATUS_WRITTEN);
}
-
-static long ext4_es_count(struct shrinker *shrink, struct shrink_control *sc)
+static unsigned long ext4_es_count(struct shrinker *shrink,
+ struct shrink_control *sc)
{
- long nr;
- struct ext4_sb_info *sbi = container_of(shrink,
- struct ext4_sb_info, s_es_shrinker);
+ unsigned long nr;
+ struct ext4_sb_info *sbi;
+
+ sbi = container_of(shrink, struct ext4_sb_info, s_es_shrinker);
nr = percpu_counter_read_positive(&sbi->s_extent_cache_cnt);
trace_ext4_es_shrink_enter(sbi->s_sb, sc->nr_to_scan, nr);
return nr;
}
-static long ext4_es_scan(struct shrinker *shrink, struct shrink_control *sc)
+static unsigned long ext4_es_scan(struct shrinker *shrink,
+ struct shrink_control *sc)
{
struct ext4_sb_info *sbi = container_of(shrink,
struct ext4_sb_info, s_es_shrinker);
struct ext4_inode_info *ei;
struct list_head *cur, *tmp, scanned;
int nr_to_scan = sc->nr_to_scan;
- int ret = 0, nr_shrunk = 0;
+ int ret = 0;
+ unsigned long nr_shrunk = 0;
INIT_LIST_HEAD(&scanned);
return freed;
}
-static long gfs2_glock_shrink_scan(struct shrinker *shrink,
- struct shrink_control *sc)
+static unsigned long gfs2_glock_shrink_scan(struct shrinker *shrink,
+ struct shrink_control *sc)
{
if (!(sc->gfp_mask & __GFP_FS))
return SHRINK_STOP;
return gfs2_scan_glock_lru(sc->nr_to_scan);
}
-static long gfs2_glock_shrink_count(struct shrinker *shrink,
- struct shrink_control *sc)
+static unsigned long gfs2_glock_shrink_count(struct shrinker *shrink,
+ struct shrink_control *sc)
{
return vfs_pressure_ratio(atomic_read(&lru_count));
}
static atomic_t qd_lru_count = ATOMIC_INIT(0);
static DEFINE_SPINLOCK(qd_lru_lock);
-long gfs2_qd_shrink_scan(struct shrinker *shrink, struct shrink_control *sc)
+unsigned long gfs2_qd_shrink_scan(struct shrinker *shrink,
+ struct shrink_control *sc)
{
struct gfs2_quota_data *qd;
struct gfs2_sbd *sdp;
return freed;
}
-long gfs2_qd_shrink_count(struct shrinker *shrink, struct shrink_control *sc)
+unsigned long gfs2_qd_shrink_count(struct shrinker *shrink,
+ struct shrink_control *sc)
{
return vfs_pressure_ratio(atomic_read(&qd_lru_count));
}
return ret;
}
-extern long gfs2_qd_shrink_count(struct shrinker *shrink,
- struct shrink_control *sc);
-extern long gfs2_qd_shrink_scan(struct shrinker *shrink,
- struct shrink_control *sc);
+extern unsigned long gfs2_qd_shrink_count(struct shrinker *shrink,
+ struct shrink_control *sc);
+extern unsigned long gfs2_qd_shrink_scan(struct shrinker *shrink,
+ struct shrink_control *sc);
extern const struct quotactl_ops gfs2_quotactl_ops;
#endif /* __QUOTA_DOT_H__ */
*
* Returns the number of objects freed.
*/
-static long
+static unsigned long
mb_cache_shrink_scan(struct shrinker *shrink, struct shrink_control *sc)
{
LIST_HEAD(free_list);
struct mb_cache_entry *entry, *tmp;
int nr_to_scan = sc->nr_to_scan;
gfp_t gfp_mask = sc->gfp_mask;
- long freed = 0;
+ unsigned long freed = 0;
mb_debug("trying to free %d entries", nr_to_scan);
spin_lock(&mb_cache_spinlock);
return freed;
}
-static long
+static unsigned long
mb_cache_shrink_count(struct shrinker *shrink, struct shrink_control *sc)
{
struct mb_cache *cache;
- long count = 0;
+ unsigned long count = 0;
spin_lock(&mb_cache_spinlock);
list_for_each_entry(cache, &mb_cache_list, c_cache_list) {
}
}
-long
+unsigned long
nfs_access_cache_scan(struct shrinker *shrink, struct shrink_control *sc)
{
LIST_HEAD(head);
return freed;
}
-long
+unsigned long
nfs_access_cache_count(struct shrinker *shrink, struct shrink_control *sc)
{
return vfs_pressure_ratio(atomic_long_read(&nfs_access_nr_entries));
const char *ip_addr, rpc_authflavor_t authflavour);
/* dir.c */
-extern long nfs_access_cache_count(struct shrinker *shrink,
- struct shrink_control *sc);
-extern long nfs_access_cache_scan(struct shrinker *shrink,
- struct shrink_control *sc);
+extern unsigned long nfs_access_cache_count(struct shrinker *shrink,
+ struct shrink_control *sc);
+extern unsigned long nfs_access_cache_scan(struct shrinker *shrink,
+ struct shrink_control *sc);
struct dentry *nfs_lookup(struct inode *, struct dentry *, unsigned int);
int nfs_create(struct inode *, struct dentry *, umode_t, bool);
int nfs_mkdir(struct inode *, struct dentry *, umode_t);
static int nfsd_cache_append(struct svc_rqst *rqstp, struct kvec *vec);
static void cache_cleaner_func(struct work_struct *unused);
-static long nfsd_reply_cache_count(struct shrinker *shrink,
- struct shrink_control *sc);
-static long nfsd_reply_cache_scan(struct shrinker *shrink,
- struct shrink_control *sc);
+static unsigned long nfsd_reply_cache_count(struct shrinker *shrink,
+ struct shrink_control *sc);
+static unsigned long nfsd_reply_cache_scan(struct shrinker *shrink,
+ struct shrink_control *sc);
static struct shrinker nfsd_reply_cache_shrinker = {
.scan_objects = nfsd_reply_cache_scan,
spin_unlock(&cache_lock);
}
-static long
+static unsigned long
nfsd_reply_cache_count(struct shrinker *shrink, struct shrink_control *sc)
{
- long num;
+ unsigned long num;
spin_lock(&cache_lock);
num = num_drc_entries;
return num;
}
-static long
+static unsigned long
nfsd_reply_cache_scan(struct shrinker *shrink, struct shrink_control *sc)
{
- long freed;
+ unsigned long freed;
+
spin_lock(&cache_lock);
freed = prune_cache_entries();
spin_unlock(&cache_lock);
}
EXPORT_SYMBOL(dquot_quota_sync);
-static long
+static unsigned long
dqcache_shrink_scan(struct shrinker *shrink, struct shrink_control *sc)
{
struct list_head *head;
struct dquot *dquot;
- long freed = 0;
+ unsigned long freed = 0;
head = free_dquots.prev;
while (head != &free_dquots && sc->nr_to_scan) {
return freed;
}
-static long
+static unsigned long
dqcache_shrink_count(struct shrinker *shrink, struct shrink_control *sc)
{
return vfs_pressure_ratio(
return 0;
}
-long ubifs_shrink_count(struct shrinker *shrink, struct shrink_control *sc)
+unsigned long ubifs_shrink_count(struct shrinker *shrink,
+ struct shrink_control *sc)
{
- long clean_zn_cnt = atomic_long_read(&ubifs_clean_zn_cnt);
+ unsigned long clean_zn_cnt = atomic_long_read(&ubifs_clean_zn_cnt);
/*
* Due to the way UBIFS updates the clean znode counter it may
return clean_zn_cnt >= 0 ? clean_zn_cnt : 1;
}
-long ubifs_shrink_scan(struct shrinker *shrink, struct shrink_control *sc)
+unsigned long ubifs_shrink_scan(struct shrinker *shrink,
+ struct shrink_control *sc)
{
- int nr = sc->nr_to_scan;
- int freed, contention = 0;
+ unsigned long nr = sc->nr_to_scan;
+ int contention = 0;
+ unsigned long freed;
long clean_zn_cnt = atomic_long_read(&ubifs_clean_zn_cnt);
if (!clean_zn_cnt) {
}
out:
- dbg_tnc("%d znodes were freed, requested %d", freed, nr);
+ dbg_tnc("%lu znodes were freed, requested %lu", freed, nr);
return freed;
}
int ubifs_tnc_end_commit(struct ubifs_info *c);
/* shrinker.c */
-long ubifs_shrink_scan(struct shrinker *shrink, struct shrink_control *sc);
-long ubifs_shrink_count(struct shrinker *shrink, struct shrink_control *sc);
+unsigned long ubifs_shrink_scan(struct shrinker *shrink,
+ struct shrink_control *sc);
+unsigned long ubifs_shrink_count(struct shrinker *shrink,
+ struct shrink_control *sc);
/* commit.c */
int ubifs_bg_thread(void *info);