Revoke delegation states when an export is released

Signed-off-by: Malahal Naineni <malahal@us.ibm.com>
Don't adjust open flags if the file is write delegated

Write delegation requires write mode open flag with GPFS FSAL.
Adjusting the open flag to read-only while the file is write
delegated causes reopen failure.

Signed-off-by: Malahal Naineni <malahal@us.ibm.com>
Don't give out delegation on a just recalled file

If a client's open causes recall of existing delegations, we respond to
the client with NFS4ERR_DELAY and recall the delegations asynchronously.
If delegations are recalled and another client were to open the file
before the original client that caused recalls, we should not give out
delegation to the latter client to avoid starving the former. We simply
avoid granting delegations for some time period from the last recall to
avoid this.

Signed-off-by: Malahal Naineni <malahal@us.ibm.com>
Fix state_unlock_locked making pinref decrement for delegation calls.

state_unlock_locked() makes a pinref decrement if the lock list becomes
empty after removing any lock. Same code is executed even for delegation
calls! Delegations use lease locks and the pinrefs are handled at the
state level, not at the lock level. Regular locks are complicated as
they may not have state, maybe blocking, ranges may be conflicting,
ranges may need to be subtracted etc. Implementation of lease locks for
delegations is very simple, so separated out lease lock handling for
easy maintenance!

Signed-off-by: Malahal Naineni <malahal@us.ibm.com>