namecache: delegation-related fixes

open_update_cache() wasn't retrying insert after the open_delegation_return() error case
nfs41_name_cache_delegreturn() needs a check for if (attributes->delegated) to avoid an extra deref when the call to nfs41_name_cache_insert() failed
added a TODO comment to nfs41_client_delegation_return_lru() for improvements to the naive algorithm

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
This commit is contained in:
Casey Bodley 2011-08-25 13:53:39 -04:00 committed by unknown
parent 48fa809fc5
commit 0d86c68138
3 changed files with 19 additions and 17 deletions

View file

@ -806,8 +806,13 @@ int nfs41_client_delegation_return_lru(
nfs41_delegation_state *state = NULL;
int status = NFS4ERR_BADHANDLE;
/* starting from the least recently opened, find a delegation
* that's not 'in use' and return it */
/* starting from the least recently opened, find and return
* the first delegation that's not 'in use' (currently open) */
/* TODO: use a more robust algorithm, taking into account:
* -number of total opens
* -time since last operation on an associated open, or
* -number of operations/second over last n seconds */
EnterCriticalSection(&client->state.lock);
list_for_each(entry, &client->state.delegations) {
state = deleg_entry(entry);