Removed unused function free_deleg_locked

Signed-off-by: Malahal Naineni <malahal@us.ibm.com>
Acked-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Update deleg stats before the lock entry is freed.

Signed-off-by: Srikrishan Malik <srimalik@in.ibm.com>
Update delegation stats in deleg_revoke.

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

Delegation locks are full length locks unlike range locks, so there
is no need to do any subtraction!  Hence renamed the function to
remove_deleg_lock. This calls remove_from_locklist to properly free
the lock.

Signed-off-by: Malahal Naineni <malahal@us.ibm.com>
Added base support for CLAIM_DELEGATE_PREV

Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Added nfs4_populate_revoked_delegs() to read revoked handles from
stable storage into memory.

Signed-off-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Corrected code under deleg_reclaim_current

Signed-off-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Added support for recording revoked file handles.

Signed-off-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Added support to check if the deleg_reclaim_prev can be granted.

Signed-off-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Simple name/debug changes

Signed-off-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Filter out FSAL_O_RECLAIM from openflags.

Signed-off-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Fix deleg_revoke bug

Signed-off-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Select filename in open4_open_owner according to the claim.

Signed-off-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Fix a SEGFAULT due to a NULL point deref. Also fix nfs4_write and
nfs4_read to handle delegation state correctly

Signed-off-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Revoked file handles needs to be cleaned up with the clientid is removed
and also we need to move these handles along with clientids in the recovery
to backup/old clientids on the stable storage.

Signed-off-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Fix nfs4_read_recov_clids() looping with dot or dotdot entries

The code doesn't go to the next entry. It just processes the same entry
in an infinite loop. Changed the code to use "for" loop, and removed
readdir calls inside the loop that advance to the next entry.

Signed-off-by: Malahal Naineni <malahal@us.ibm.com>
Acked-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Return PATH_DOWN only if the client has active delegations.

Signed-off-by: Srikrishan Malik <srimalik@in.ibm.com>
Return DELEG_REVOKED if the client is valid but state is not.

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

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