deleg: return delegation before conflicting operations

new function nfs41_delegation_return() for synchronous delegation return.  uses a condition variable to wait if another thread is already returning the delegation
if nfs41_delegate_open() would conflict with a delegation, return it before sending the OPEN
return the delegation before sending LINK, RENAME, REMOVE, and SETATTR

all of this functionality is dependent on the preprocessor define DELEGATION_RETURN_ON_CONFLICT (on by default).  if not defined, nfs41_delegation_return() is a noop

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
This commit is contained in:
Casey Bodley 2011-07-07 13:51:21 -04:00 committed by unknown
parent 38259e0017
commit bc6471d981
6 changed files with 179 additions and 19 deletions

View file

@ -27,6 +27,10 @@
#include "nfs41.h"
/* option to avoid conflicts by returning the delegation */
#define DELEGATION_RETURN_ON_CONFLICT
/* reference counting and cleanup */
void nfs41_delegation_ref(
IN nfs41_delegation_state *state);
@ -59,6 +63,25 @@ int nfs41_delegation_to_open(
IN bool_t try_recovery);
/* synchronous delegation return */
#ifdef DELEGATION_RETURN_ON_CONFLICT
int nfs41_delegation_return(
IN nfs41_session *session,
IN nfs41_path_fh *file,
IN enum open_delegation_type4 access,
IN bool_t truncate);
#else
static int nfs41_delegation_return(
IN nfs41_session *session,
IN nfs41_path_fh *file,
IN enum open_delegation_type4 access,
IN bool_t truncate)
{
return NFS4_OK;
}
#endif
/* asynchronous delegation recall */
int nfs41_delegation_recall(
IN nfs41_client *client,