aboutsummaryrefslogtreecommitdiffstats
path: root/fs/super.c
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2013-08-27 20:18:00 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2013-09-10 18:56:30 -0400
commitf604156751db77e08afe47ce29fe8f3d51ad9b04 (patch)
treee0a109be920e4db54ac6384bebb2460aa1e309a9 /fs/super.c
parentd38fa6986e9124f827aa6ea4a9dde01e67a37be7 (diff)
dcache: convert to use new lru list infrastructure
[glommer@openvz.org: don't reintroduce double decrement of nr_unused_dentries, adapted for new LRU return codes] Signed-off-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Glauber Costa <glommer@openvz.org> Cc: "Theodore Ts'o" <tytso@mit.edu> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Cc: Arve Hjønnevåg <arve@android.com> Cc: Carlos Maiolino <cmaiolino@redhat.com> Cc: Christoph Hellwig <hch@lst.de> Cc: Chuck Lever <chuck.lever@oracle.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: David Rientjes <rientjes@google.com> Cc: Gleb Natapov <gleb@redhat.com> Cc: Greg Thelen <gthelen@google.com> Cc: J. Bruce Fields <bfields@redhat.com> Cc: Jan Kara <jack@suse.cz> Cc: Jerome Glisse <jglisse@redhat.com> Cc: John Stultz <john.stultz@linaro.org> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Kent Overstreet <koverstreet@google.com> Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Cc: Marcelo Tosatti <mtosatti@redhat.com> Cc: Mel Gorman <mgorman@suse.de> Cc: Steven Whitehouse <swhiteho@redhat.com> Cc: Thomas Hellstrom <thellstrom@vmware.com> Cc: Trond Myklebust <Trond.Myklebust@netapp.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/super.c')
-rw-r--r--fs/super.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/fs/super.c b/fs/super.c
index aa7995d73bcc..cd3c2cd9144d 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -79,11 +79,11 @@ static unsigned long super_cache_scan(struct shrinker *shrink,
79 fs_objects = sb->s_op->nr_cached_objects(sb); 79 fs_objects = sb->s_op->nr_cached_objects(sb);
80 80
81 inodes = list_lru_count(&sb->s_inode_lru); 81 inodes = list_lru_count(&sb->s_inode_lru);
82 total_objects = sb->s_nr_dentry_unused + inodes + fs_objects + 1; 82 dentries = list_lru_count(&sb->s_dentry_lru);
83 total_objects = dentries + inodes + fs_objects + 1;
83 84
84 /* proportion the scan between the caches */ 85 /* proportion the scan between the caches */
85 dentries = mult_frac(sc->nr_to_scan, sb->s_nr_dentry_unused, 86 dentries = mult_frac(sc->nr_to_scan, dentries, total_objects);
86 total_objects);
87 inodes = mult_frac(sc->nr_to_scan, inodes, total_objects); 87 inodes = mult_frac(sc->nr_to_scan, inodes, total_objects);
88 88
89 /* 89 /*
@@ -117,7 +117,7 @@ static unsigned long super_cache_count(struct shrinker *shrink,
117 if (sb->s_op && sb->s_op->nr_cached_objects) 117 if (sb->s_op && sb->s_op->nr_cached_objects)
118 total_objects = sb->s_op->nr_cached_objects(sb); 118 total_objects = sb->s_op->nr_cached_objects(sb);
119 119
120 total_objects += sb->s_nr_dentry_unused; 120 total_objects += list_lru_count(&sb->s_dentry_lru);
121 total_objects += list_lru_count(&sb->s_inode_lru); 121 total_objects += list_lru_count(&sb->s_inode_lru);
122 122
123 total_objects = vfs_pressure_ratio(total_objects); 123 total_objects = vfs_pressure_ratio(total_objects);
@@ -191,8 +191,7 @@ static struct super_block *alloc_super(struct file_system_type *type, int flags)
191 INIT_HLIST_NODE(&s->s_instances); 191 INIT_HLIST_NODE(&s->s_instances);
192 INIT_HLIST_BL_HEAD(&s->s_anon); 192 INIT_HLIST_BL_HEAD(&s->s_anon);
193 INIT_LIST_HEAD(&s->s_inodes); 193 INIT_LIST_HEAD(&s->s_inodes);
194 INIT_LIST_HEAD(&s->s_dentry_lru); 194 list_lru_init(&s->s_dentry_lru);
195 spin_lock_init(&s->s_dentry_lru_lock);
196 list_lru_init(&s->s_inode_lru); 195 list_lru_init(&s->s_inode_lru);
197 INIT_LIST_HEAD(&s->s_mounts); 196 INIT_LIST_HEAD(&s->s_mounts);
198 init_rwsem(&s->s_umount); 197 init_rwsem(&s->s_umount);