Merge branch 'tp/jim_next_HAv4' into ibm_next_tmp
Merge branch 'tp/ibm_next_dirent_clean' into ibm_next_tmp
An error message was being freed twice, ending in a seg fault.

Signed-off-by: Jeremy Bongio <jbongio@us.ibm.com>
Merge branch 'tp/jim_next_HAv4' into ibm_next_tmp
Merge branch 'tp/ibm_next_dirent_clean' into ibm_next_tmp
Merge branch 'tp/ibm_next_w_rongs_krb5_fix' into ibm_next_tmp
Add multilock tool to Ganesha tree

Signed-off-by: Frank Filz <ffilzlnx@us.ibm.com>
Add some sample tests for multilock

Signed-off-by: Frank Filz <ffilzlnx@us.ibm.com>
Fixup some FSAL_UP log messages

Use COMPONENT_FSAL_UP in FSAL/FSAL_GPFS/fsal_up.c

Remove some \n

Signed-off-by: Frank Filz <ffilzlnx@us.ibm.com>
Check flags in cache_inode_invalidate properly

Signed-off-by: Frank Filz <ffilzlnx@us.ibm.com>
Replace cache_inode_file_holds_state with cache_inode_is_pinned

By checking if file is pinned, cache_inode_close doesn't need to
poke into SAL internals. Also avoids checking if state is present
without holding state_lock.

A flag is added so cache_inode_close calls from LRU when it is
clear the file can not be pinned will not check (which would
cause the lru.mtx to be acquired when already held and cause
deadlock).

Also, add/modify some debug log messages.

Signed-off-by: Frank Filz <ffilzlnx@us.ibm.com>
Move when we check if file sould be unpinned if all locks are removed by unlock.

Signed-off-by: Frank Filz <ffilzlnx@us.ibm.com>
Make abstrat_atomic consistent

Unadorned atomic_ operations now return the value after performing the
operation on all supported versions of GCC.

A new family of functions, atomic_post returns the value before
performing the operation (analogous to the post-increment/decrement
operators).

Signed-off-by: Adam C. Emerson <aemerson@linuxbox.com>
Make noisy LogInfo a LogDebug in MainNFSD/nfs_worker_thread.c

Signed-off-by: Frank Filz <ffilzlnx@us.ibm.com>
Add missing state_share_wipe to wipe NLM shares

Also clean up a bit of NLM conditional compiling.

Signed-off-by: Frank Filz <ffilzlnx@us.ibm.com>
Clean up grace period reporting

Signed-off-by: Frank Filz <ffilzlnx@us.ibm.com>
Convert NSM and NLM Client to new HashTable_GetLatch

Converting NSM Client and NLM Client to use new HashTable_GetLatch
allows atomic creation of those object types. Also, the refcounts
are converted to atomic int32_t so that mutex doesn't need to be
held for refcount operations.

Signed-off-by: Frank Filz <ffilzlnx@us.ibm.com>
Convert state owners to use new HashTable_GetLatch

Using HashTable_GetLatch allows state owners to be created
without worry of race. The so_refcount is also converted to
an atomic uint32_t to allow refcounting without grabbing
so_mutex.

All state owners are hashed using the state_owner_t structure
as the key as well as the data. The key fields are all available
within the state_owner_t structure so the hash may use them
for key evaluation. This reduces memory use.

There is now a generic get_state_owner which will determine
which hash table to use based on so_type in the key. Callers
may indicate if they care if the owner is found or not, if they
don't care, a new owner is not created if not found.

Signed-off-by: Frank Filz <ffilzlnx@us.ibm.com>
With --enable-debug-memleaks, keep list of all state owners and stateids

To help track down memory leaks in SAL, keep a list of all state owners
and stateids. When clientid reaper thread has removed all clientids,
print the contents of the lists (which should be empty) to expose any
leaks.

Signed-off-by: Frank Filz <ffilzlnx@us.ibm.com>

Conflicts:

	src/SAL/nfs4_recovery.c

Signed-off-by: Frank Filz <ffilzlnx@us.ibm.com>
Document FSAL options in GPFS sample config and remove obsolete GPFS options

The FSAL and FileSystem blocks in the config file are documented with
commented out examples that show the default value.

The GPFS block now has no variables.

Signed-off-by: Frank Filz <ffilzlnx@us.ibm.com>