]> git.baikalelectronics.ru Git - kernel.git/commit
vfs: fix dentry LRU list handling and nr_dentry_unused accounting
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 14 Sep 2013 02:55:10 +0000 (22:55 -0400)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 14 Sep 2013 02:55:10 +0000 (22:55 -0400)
commita7ea8db6bf263d0e2f72fa7c679343a5dd44d241
tree5648f91439538e2a4fd892a4ab525dd99bb2a44d
parent0f5153e0a65ad0b7eab7a051b9298b7366830a4f
vfs: fix dentry LRU list handling and nr_dentry_unused accounting

The LRU list changes interacted badly with our nr_dentry_unused
accounting, and even worse with the new DCACHE_LRU_LIST bit logic.

This introduces helper functions to make sure everything follows the
proper dcache d_lru list rules: the dentry cache is complicated by the
fact that some of the hotpaths don't even want to look at the LRU list
at all, and the fact that we use the same list entry in the dentry for
both the LRU list and for our temporary shrinking lists when removing
things from the LRU.

The helper functions temporarily have some extra sanity checking for the
flag bits that have to match the current LRU state of the dentry.  We'll
remove that before the final 3.12 release, but considering how easy it
is to get wrong, this first cleanup version has some very particular
sanity checking.

Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/dcache.c