]> git.baikalelectronics.ru Git - kernel.git/commit
NFS: Adapt readdirplus to application usage patterns
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Tue, 1 May 2012 21:37:59 +0000 (17:37 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Tue, 1 May 2012 23:16:43 +0000 (19:16 -0400)
commit67cb00b2221e0daad6cce141ffddfcfda019fecc
tree5f890def2d1d4bca93a5acaf073fa4cbe5f16a44
parent5b05e496b9fc4a18f7c84f097ad10de40720d693
NFS: Adapt readdirplus to application usage patterns

While the use of READDIRPLUS is significantly more efficient than
READDIR followed by many LOOKUP calls, it is still less efficient
than just READDIR if the attributes are not required.

This patch tracks when lookups are attempted on the directory,
and uses that information to selectively disable READDIRPLUS
on that directory.
The first 'readdir' call is always served using READDIRPLUS.
Subsequent calls only use READDIRPLUS if there was a successful
lookup or revalidation on a child in the mean time.

Credit for the original idea should go to Neil Brown. See:
      http://www.spinics.net/lists/linux-nfs/msg19996.html
However, the implementation in this patch differs from Neil's
in that it focuses on tracking lookups rather than calls to
stat().

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: Neil Brown <neilb@suse.de>
fs/nfs/dir.c
fs/nfs/inode.c
include/linux/nfs_fs.h