namecache: limit the number of delegations

to prevent delegations from claiming all available slots in the attribute cache, nfs41_name_cache_insert() now returns ERROR_TOO_MANY_OPEN_FILES when the number of delegated entries reaches 50% of the cache capacity.  see comment 'delegations and cache feedback' in name_cache.c for details

when nfs41_open() sees this error from nfs41_name_cache_insert(), it calls new function nfs41_client_delegation_return_lru() to return the least-recently-used delegation and, if successful, loops back to nfs41_name_cache_insert().  nfs41_client_delegation_return_lru() returns NFS4ERR_BADHANDLE if all delegations are currently in use (associated with an existing open), in which case nfs41_open() returns the newly-granted delegation

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
This commit is contained in:
Casey Bodley 2011-08-19 12:04:30 -04:00 committed by unknown
parent a0d4403a99
commit 7b07dcebb8
4 changed files with 145 additions and 27 deletions

View file

@ -101,4 +101,9 @@ int nfs41_delegation_recall(
int nfs41_client_delegation_recovery(
IN nfs41_client *client);
/* attempt to return the least recently used delegation;
* fails with NFS4ERR_BADHANDLE if all delegations are in use */
int nfs41_client_delegation_return_lru(
IN nfs41_client *client);
#endif /* DELEGATION_H */