Purge the dirent tree when a remove of the dir fails with ENOTEMPTY

The dirent cache is out of sync for some non-ganesha reason. Purge the
dirent tree to force a re-populate

Signed-off-by: Jim Lieb <jlieb@panasas.com>
Fix up-call to update inode.
Fix XFS FSAL regression with symlinks.

This only applies to XFS exports on older (pre- 2.6.39) Linux kernels.
The libhandle open_by_handle function and syscall will only open regular
files and directories.  All others return an EPERM error.  In order to
do full support, symlinks would have to be considered "unopenable" files
and extra obj handle space would have to be added for the parent directory
handle and name. Since symlinks are more plentiful in an export than
special files and UNIX sockets, this is significant memory overhead.

We work around this by noticing that open_by_handle() returns the EPERM in this
case where FreeBSD and Linux open_by_handle_at don't.  This turns a setattr
into a NOP and getattr returns whatever was cached at lookup time.

Signed-off-by: Jim Lieb <jlieb@panasas.com>
Convert nlm_block_data_to_export to use get_gsh_export

Deprecates last use of nfs_Get_export_by_id()
Also remove unnecessary pexport and ppexport args in NLM

Signed-off-by: Jim Lieb <jlieb@panasas.com>
Remove nfs_Get_export_by_id()

This had become unsafe in the new export mgr world.

Signed-off-by: Jim Lieb <jlieb@panasas.com>
Remove sbd_block_data_to_fsal_context callback in state_block_data_t

One more cleanup.  This callback doesn't seem to be used anyway.  It also
had a questionable typedef pattern of defining the function proto in two
separate places...

Signed-off-by: Jim Lieb <jlieb@panasas.com>
Add cmake module to find libexecinfo on FreeBSD platform.

On FreeBSD platform, backtrace() is provided by libexecinfo instead of libc
which is sufficient on Linux. This commit adds cmake module to search
libexecinfo and enables it on FreeBSD platform via main CMakeLists.txt

Signed-off-by: Sachin Bhamare <sbhamare@panasas.com>
Tighten up the V4 compound processing loop

Simplfy code the processing loops, eliminate unnessary code and make op
processing table driven.  Change op function protos to make this possible.

Signed-off-by: Jim Lieb <jlieb@panasas.com>
Merge branch 'dev_next_bugs' into merge_next

Mostly leanup of code post-rpc_exports

Signed-off-by: Jim Lieb <jlieb@panasas.com>
Remove libssl and libcrypto from system libraries

Signed-off-by: Adam C. Emerson <aemerson@linuxbox.com>
(cherry picked from commit 9f2fef6803bdbd7c0a89756640404a106a2a3853)

Signed-off-by: Jim Lieb <jlieb@panasas.com>
Add new file from libtirpc os_epoll.h to spec file.

Bump TI-RPC Version.

Signed-off-by: Jim Lieb <jlieb@panasas.com>

Conflicts:
	src/tirpc.sh

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
(cherry picked from commit 55172b609fdecbdb61546aa9708ad403de13bc4f)

Signed-off-by: Jim Lieb <jlieb@panasas.com>
Update 15to20-porting.txt.

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
(cherry picked from commit 717774d9a7893572050a2504ed8817a7020b43bf)

Edited merge.  This should be re-checked just to be sure.

Signed-off-by: Jim Lieb <jlieb@panasas.com>

Conflicts:
	src/Docs/15to20-porting.txt
Change cache_inode_readdir_cb_t and handle_digest obj_handle to const

Signed-off-by: Amit Dror <amitd@infinidat.com>
Signed-off-by: Jim Lieb <jlieb@panasas.com>

Conflicts:
	src/FSAL/FSAL_GPFS/handle.c
	src/FSAL/FSAL_LUSTRE/handle.c
	src/FSAL/FSAL_POSIX/handle.c
	src/FSAL/FSAL_PROXY/handle.c
	src/FSAL/FSAL_VFS/handle.c
	src/FSAL/FSAL_ZFS/handle.c
	src/include/nfs_file_handle.h

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
(cherry picked from commit d1af5f95492318d2b7b251d2292f5e23c01a95f2)

Signed-off-by: Jim Lieb <jlieb@panasas.com>
Remove redundant handle_to_key() call in cache_inode_kill_entry()

Signed-off-by: Amit Dror <amitd@infinidat.com>
Signed-off-by: Matt Benjamin <matt@linuxbox.com>
(cherry picked from commit fd0a4af717e3383ed09b6892ba4c498384993051)

Signed-off-by: Jim Lieb <jlieb@panasas.com>
Remove associated option from cache_inode_get()

It is no longer used by cache_inode_lookupp_impl()

Signed-off-by: Amit Dror <amitd@infinidat.com>
Signed-off-by: Jim Lieb <jlieb@panasas.com>

Conflicts:
	src/support/nfs_filehandle_mgmt.c

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
(cherry picked from commit 49a04396422edb4cafe2d56a5d2bcabb2545751a)

Signed-off-by: Jim Lieb <jlieb@panasas.com>
Remove FSAL_DIGEST_FILEID3 and FSAL_DIGEST_FILEID4 options

These are not needed anymore.
Changed readdir/readdirplus to get the fileid directly from the
FSAL object attributes.

Signed-off-by: Amit Dror <amitd@infinidat.com>

(cherry picked from commit Remove FSAL_DIGEST_FILEID3 and FSAL_DIGEST_FILEID4 options)

Signed-off-by: Jim Lieb <jlieb@panasas.com>

Conflicts:
	src/FSAL/FSAL_GPFS/handle.c
	src/FSAL/FSAL_LUSTRE/handle.c
	src/FSAL/FSAL_POSIX/handle.c
	src/FSAL/FSAL_PROXY/handle.c
	src/FSAL/FSAL_VFS/handle.c
	src/FSAL/FSAL_ZFS/handle.c
Use enum types in log_component_info rather than plain int

Signed-off-by: Amit Dror <amitd@infinidat.com>
(cherry picked from commit 8f0a6af8b164fec1eb1c7ef92e456bb417ce32d8)

Signed-off-by: Jim Lieb <jlieb@panasas.com>
Improved constraints on build type in CMake

Signed-off-by: Amir Frankel <amirf@infinidat.com>
(cherry picked from commit dbcf3cfb4fd74318e5ee16ee14162e677e3aa9ec)

Signed-off-by: Jim Lieb <jlieb@panasas.com>
Merge remote-tracking branch 'sachin/next' into merge_next

Signed-off-by: Jim Lieb <jlieb@panasas.com>
Merge remote-tracking branch 'marc/dev35-fix-upcall' into merge_next

Signed-off-by: Jim Lieb <jlieb@panasas.com>