]> git.baikalelectronics.ru Git - kernel.git/commit
nfsd: eliminate one of the DRC cache searches
authorJeff Layton <jlayton@redhat.com>
Wed, 27 Mar 2013 14:15:37 +0000 (10:15 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Wed, 3 Apr 2013 15:47:22 +0000 (11:47 -0400)
commit74d362c706ae82ae6775995f5a727cb0b4ef5845
tree95f9d8ad7f80cfcb82d175f02e1171537a883e4b
parent81e1f9c240f4b1a8fad3c404518a9ee0e5e1b9b5
nfsd: eliminate one of the DRC cache searches

The most common case is to do a search of the cache, followed by an
insert. In the case where we have to allocate an entry off the slab,
then we end up having to redo the search, which is wasteful.

Better optimize the code for the common case by eliminating the initial
search of the cache and always preallocating an entry. In the case of a
cache hit, we'll end up just freeing that entry but that's preferable to
an extra search.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfscache.c