Added support for CLAIM_PREVIOUS

Signed-off-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Return Not Supported for both nfs4_op_delegpurge and CLAIM_DELEGATE_PREV

Currnt code mostly supports CLAIM_DELEGATE_PREV but there is lot more
needed to fully support it.

Some of the missing pieces are:
1. Fully supporting nfs4_op_delegpurge.
2. making sure that the delegations are not removed/cleaned on
   setclientid sequence.

This is helpful for those clients which uses persistent storage
for data cache, and these delegations are called client-persistent delegations
When there is needed we can address above mentioned issues and enable then.

Signed-off-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
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>
Add new tunable for rpc callback timeout.

Also removed an unused delegation related tunable(Deleg_Recall_Retry_Delay).

Signed-off-by: Srikrishan Malik <srimalik@in.ibm.com>
Correct the check for delegation grant.

Do not grant delegation in recalim if the client has not asked for it.

Signed-off-by: Srikrishan Malik <srimalik@in.ibm.com>
Set the pre-recalled flag for deleg reclaims.

Signed-off-by: Srikrishan Malik <srimalik@in.ibm.com>