deleg: handle locks locally on write delegation

new flags for nfs41_lock_state: exclusive, delegated, and id
on lock, open_lock_delegate() attempts to register a delegated lock instead of sending a LOCK request to the server
on unlock, open_unlock_delegate() removes/frees delegated locks instead of sending a LOCKU request
on delegreturn, delegation_flush_locks() sends LOCK requests for all delegated locks before returning a delegation
on recovery, recover_locks() avoids lock state recovery for delegated locks

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
This commit is contained in:
Casey Bodley 2011-08-10 10:51:52 -04:00 committed by unknown
parent 284c273999
commit 9e556da92c
4 changed files with 302 additions and 117 deletions

View file

@ -105,7 +105,9 @@ typedef struct __nfs41_lock_state {
struct list_entry open_entry; /* entry in nfs41_open_state.locks */
uint64_t offset;
uint64_t length;
uint32_t type;
uint32_t exclusive : 1;
uint32_t delegated : 1; /* whether or not there is state on the server */
uint32_t id : 30;
} nfs41_lock_state;
/* nfs41_open_state reference counting:
@ -140,6 +142,7 @@ typedef struct __nfs41_open_state {
struct { /* list of open lock state for recovery */
stateid4 stateid;
struct list_entry list;
uint32_t counter;
} locks;
} nfs41_open_state;