]> git.openfabrics.org - ~emulex/infiniband.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)
commitd69ee9b85541a69a1092f5da675bd23256dc62af
tree5f890def2d1d4bca93a5acaf073fa4cbe5f16a44
parent8582715e733d08bc98fe629db0601360d70de4dc
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