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>
Strip out unused NFS_Core_Param

Strip out unused nb_current_gc_workers and Nb_MaxConcurrentGC config parm

Strip out FSAL_Shared_Library

Signed-off-by: Frank Filz <ffilzlnx@us.ibm.com>
Document Cache Inode and NFS Core parameters

Signed-off-by: Frank Filz <ffilzlnx@us.ibm.com>
Fix sub-dir mount issue for v3

Mount needs to do permission checking once it has an export entry
matching the mounted path. We actually skip any permission
checking at this time, simply creating root credentials. That may
not be quite right for all scenarios but will do for now.

NFS Illustrated essentially implies mount requests should not be
denied, and that many servers allow AUTH_NULL mount requests.

Note that a sub-dir mount COULD skip into a directory that is
not normally accessible from the client if it mounted the root
of the export.

Signed-off-by: Frank Filz <ffilzlnx@us.ibm.com>
Add additional export debug and prevent duplicate Export_Ids

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Strip out some unused cruft from exports

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Fix some IPv6 compile issues

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Fix up export permission checking

Order access list checking such that Root_Access does not
grant read/write access. A separate access must grant
some access. If no other access list grants any access,
read access will be granted though.

The access list checking is more unified so the same logic is
used for both IPv4 and IPv6 clients.

nfs_export_check_access now returns the export permission options
that apply to the client. This makes it easier to do proper permission
checking

This rework will make it much easier to implement the EXPORT_CLIENT
stanza that allows more per client permissions.

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Update test directory to compile considering current state of code.

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