All NFS v4.0 ops that use an open/lock owner should check owner seqid the same

These ops all require the client to change the owner seqid, but also result
in a stateid seqid change. In order for the replay logic to work, we must
identify a potential replay based on the stateid seqid changing, and then
check the owner seqid for replay.

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Use nfs4_sanity_check_FH for nfsa4_op_delegreturn

For correctness to RFC, replace NFS4ERR_ISDIR with NFS4ERR_INVAL.

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Reorganize state_t and remove some typedefs

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
DELEGRETURN does not have an open/lock owner, don't call Copy_nfs4_state_req

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Hold state_lock in write for nfs4_return_one_state and state_lookup_layout_state

nfs4_return_one_state does a glist_length which requires the state lock,
since most callers hold the lock, change so all callers hold the lock.

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Eliminate separate deleg_data structue

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Simplify delegrecall_context and delegrecall_one

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Free state_layout_recall_file list resources

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Fix a few places where an extra cache inode LRU reference was taken

cache_inode_create, cache_inode_lookup, and cache_inode_lookupp both return a
reference to the resulting entry, and that reference can be handed off to
data->current_entry.

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Attach state_t to export uniformly inside state_add_impl

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Fix missing unlock in pseudo_mount_export

If cache_inode_inc_pin_ref fails, we must unlock the attr_lock taken above.

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>