Cleanup state_lookup_layout_state

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Use proper refcounting of state_t, entry, and owner in state_export_release_nfs4_state

Also hold state_lock for call to state_share_remove.

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Use proper refcounting of state_t, entry, and owner in nfs4_Check_Stateid

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
MORE Add safety to struct state_t

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Use state_mutex in display_state_id_val

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
MORE Add refcount to state_t

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Use proper refcounting of state_t, entry, and export in nfs4_op_layoutreturn

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Cleanup handle_recalls to use passed cache entry instead of state_entry

There is no need to use state_entry, the caller already was passed the
cache entry with a refcount.

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

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Use proper refcounting of state_t and owner in nfs4_op_close

Also use data->current_entry instead of state_entry.

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Use proper refcounting of state_t and owner in nfs4_op_open_downgrade

Also incidentally don't do something different for NFS v4.1.

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Use proper refcounting of state_t, entry, owner, and export in deleg recall

Also fix some existing bugs and issues...

In delegrecall_task we did not take the state_lock, nor did we hold an
LRU reference on the cache entry.

Now we always pass a delegrecall_context to delegrecall_one. Doing so from
delegrecall_impl allows us to use the context to pass the clientid and export
pointers (and effective references). This allows for some simplification of
delegerecall_one.

In delegrecall_impl we use the new get_state_entry_export_owner_refs to get
the export and owner references. The owner reference is used to get the clientid
reference (and then is released).

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
MORE Safely use state_entry, state_export, and state_owner in layout functions

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Use proper refcounting of state_t, entry, owner, and export in rest of delegations code

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