summaryrefslogtreecommitdiffstats
path: root/sys/fs/nfsclient/nfs_clcomsubs.c
diff options
context:
space:
mode:
authorrmacklem <rmacklem@FreeBSD.org>2014-05-06 12:15:05 +0000
committerrmacklem <rmacklem@FreeBSD.org>2014-05-06 12:15:05 +0000
commitcab8f4561e24d722e9e9b500434936a03a8c3ca7 (patch)
tree02b6fc32ec0bd40d82b0a35c3d073679eb48ec39 /sys/fs/nfsclient/nfs_clcomsubs.c
parent941905ca5c3b6f7b8839045aac22a789ed5c8ba0 (diff)
downloadFreeBSD-src-cab8f4561e24d722e9e9b500434936a03a8c3ca7.zip
FreeBSD-src-cab8f4561e24d722e9e9b500434936a03a8c3ca7.tar.gz
MFC: r264672
Modify the Lookup RPC for NFSv4 so that it acquires directory attributes. This allows the client to cache directory names when they are looked up, reducing the Lookup RPC count by about 40% for software builds.
Diffstat (limited to 'sys/fs/nfsclient/nfs_clcomsubs.c')
-rw-r--r--sys/fs/nfsclient/nfs_clcomsubs.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/sys/fs/nfsclient/nfs_clcomsubs.c b/sys/fs/nfsclient/nfs_clcomsubs.c
index 52dcaad..bc47172 100644
--- a/sys/fs/nfsclient/nfs_clcomsubs.c
+++ b/sys/fs/nfsclient/nfs_clcomsubs.c
@@ -219,9 +219,18 @@ nfscl_reqstart(struct nfsrv_descript *nd, int procnum, struct nfsmount *nmp,
procnum != NFSPROC_COMMITDS) {
NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED);
*tl = txdr_unsigned(NFSV4OP_GETATTR);
- NFSWCCATTR_ATTRBIT(&attrbits);
+ /*
+ * For Lookup Ops, we want all the directory
+ * attributes, so we can load the name cache.
+ */
+ if (procnum == NFSPROC_LOOKUP ||
+ procnum == NFSPROC_LOOKUPP)
+ NFSGETATTR_ATTRBIT(&attrbits);
+ else {
+ NFSWCCATTR_ATTRBIT(&attrbits);
+ nd->nd_flag |= ND_V4WCCATTR;
+ }
(void) nfsrv_putattrbit(nd, &attrbits);
- nd->nd_flag |= ND_V4WCCATTR;
}
}
if (procnum != NFSPROC_RENEW ||
OpenPOWER on IntegriCloud