Convert export->state to atomic

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Add param to getrattr callback to better handle junction processing callbacks

Instead of relying on special parameter values and flags to determine what
the getattr callback is expected to accomplish, make it explicit with a
parameter.

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
MORE Convert export->state to atomic

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
MORE Move dead entry cleanup to any unref as long as LRU_UNREF_QLOCKED is not set.

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Introduce return value to get_gsh_export_ref to prevent new refs to stale export

If an export is stale (being unexported for any reason), we should prevent
handing out additional references where possible.

We add a new parameter for those cases for which we need to take a reference
anyway. Also, this paremeter is temporarily used for cases where dealing with
the failure to get a reference is not easy. These cases WILL be fixed in later
patches (but use of this parameter allows us to introduce the feature without
making things any worse). There will be at least one place where this parameter
will still be useful.

If export_release_ok is true, the only possible return is true (success) thus
it is legitimate to ignore the return value.

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Minor code pretty up

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Move export cleanup to unexport and kill_export_root_entry

Cleanup of an export will now be handled inline with unexport or
kill_export_root_entry. This avoids deadlocks and allows the cache inodes
and state objects being cleaned up to hold export refcounts.

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Add documentation to abstract_atomic.h

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Convert sle_ref_count to atomic int32_t

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Add flag for cache_inode_lru_unref that indicates the state_lock is held

If so, we can't perform cleanup, however, the fact that the state_lock is
held insures that another LRU ref MUST be held by this thread (to protect the
existence of the cache inode in order to be able to release the state_lock).

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Take an LRU reference any time we pin a cache entry for range locks

A pin ref will no longer guarantee the existence of the cache inode
entry, thus we must ALSO hold an long term LRU reference.

Because cleanup no longer depends on the LRU refcount going to zero, this
is now safe.

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Make every state_lock_entry_t have an export reference.

The export structure MUST be valid for the entire life of the lock entry.

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