Subject: NFS cookies now available
To: None <tech-kern@NetBSD.ORG>
From: Greg Hudson <>
List: tech-kern
Date: 10/13/1995 20:56:30
I found a good way of stashing and retrieving cookies for the NFS
client, with only minimal changes.  I committed the changes to the
mainline; if someone from the core team wants to migrate my change to
sys/nfs/nfs_vnops.c to the netbsd-1-1 branch, then pk's sunos_misc.c
change can be reverted (the faked cookies generated there won't
generally work if the directory spans more than one block).

Our current caching method for NFS directory blocks uses the server
offset of the first directory entry as an identifier, so a Linux
emulation getdirentries() will wind up retrieving one block from the
NFS server for each directory entry, unnecessarily thrashing the
cache.  The situation isn't as bad for other emulations, or for Linux
emulation when the new-style readdir() system call is used.

Fixing the above problem will require substituting for getblk() a
routine which searches all the cache blocks associated with a given
vnode for cookies which match the input offset.  As before, I may or
may not be able to implement such a change.  The current code is at
least functional, though.