summaryrefslogtreecommitdiff
path: root/fs/super.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/super.c')
-rw-r--r--fs/super.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/super.c b/fs/super.c
index f6961ea..63b6863 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -82,13 +82,13 @@ static int prune_super(struct shrinker *shrink, struct shrink_control *sc)
int inodes;
/* proportion the scan between the caches */
- dentries = (sc->nr_to_scan * sb->s_nr_dentry_unused) /
- total_objects;
- inodes = (sc->nr_to_scan * sb->s_nr_inodes_unused) /
- total_objects;
+ dentries = mult_frac(sc->nr_to_scan, sb->s_nr_dentry_unused,
+ total_objects);
+ inodes = mult_frac(sc->nr_to_scan, sb->s_nr_inodes_unused,
+ total_objects);
if (fs_objects)
- fs_objects = (sc->nr_to_scan * fs_objects) /
- total_objects;
+ fs_objects = mult_frac(sc->nr_to_scan, fs_objects,
+ total_objects);
/*
* prune the dcache first as the icache is pinned by it, then
* prune the icache, followed by the filesystem specific caches
@@ -104,7 +104,7 @@ static int prune_super(struct shrinker *shrink, struct shrink_control *sc)
sb->s_nr_inodes_unused + fs_objects;
}
- total_objects = (total_objects / 100) * sysctl_vfs_cache_pressure;
+ total_objects = vfs_pressure_ratio(total_objects);
drop_super(sb);
return total_objects;
}