Strict compilation for XFS FSAL

Most things are obvious, for XFSFSAL_read and XFSFSAL_write
just entertain complier - it doesn't know what we're checking
all possible values for whence in the switch, so give it
a default to chew on.

Signed-off-by: Max Matveev <makc@gmx.co.uk>
Strict compile of File_Content

Rework checks of index files as suggested during the review by Jim Lieb:
if any of the fields in the file is corrupt then reject the whole file.

Signed-off-by: Max Matveev <makc@gmx.co.uk>
XFS FSAL - return correct file descriptor when opening directories

Fallback for handling directory opening in fsal_internal_handle2fd
was returning wrong file descriptors: the parenthesis were
placed incorrectly and was doing the equivalent of

fd = (open_by_handle() < 0);

so we were getting either 0 or 1 as file descriptor for a directory.
Combined with open/fchmod/close it was creating a land mine for the
open - a workload which feature a lot of directory making (like git clone)
was racing and opening unrelated files on FD 0 and 1 and using wrong
file descriptors for setting attributes. This explains why some permission
bits for some files were "morphing" between two tree scans by git status.

Signed-off-by: Max Matveev <makc@gmx.co.uk>
XFS FSAL - use real types in the handle

Use the opportunity to change on-the-wire handles to push real
type into the XFS' portion of the handle.

And be more paranoid about the kind of types you're prepared to
accept off the wire.

Signed-off-by: Max Matveev <makc@gmx.co.uk>
XFS FSAL - different way of dealing with bulkstat attributes

During the review Jim Lieb suggested that it would be better
to fill in struct stat based on the results in xfs_bulkstat
and use posix2fsal_attributes to convert - less code, more
likely the changes will be done in the right place.

Signed-off-by: Max Matveev <makc@gmx.co.uk>
XFS FSAL - more validation of incoming filehandles

More paranoia about the stuff inside XFS' portion of the filehandle:
this stuff does come of the wire and can be tampered with so make sure
that lenght is sane and the type is one we may know about before
doing anything with the handle.

Signed-off-by: Max Matveev <makc@gmx.co.uk>
Minor type mismatch when dealing with request queue in NFS workers

Punt pointer to the correct type.
IdMapper - strict compile with --disable-nfsidmap

Make sure IdMapper compiles with --disable-nfsidmap --enable-strict-compile
Make sure Mem_Alloc_Page_Aligned is defined when BuddyMalloc is disabled.

Mem_Alloc_Page_Aligned is using standard Posix API to get aligned memory blocks
and can be used with or without BuddyMalloc - move the code around to make
sure it's included in both versions.

Signed-off-by: Max Matveev <makc@gmx.co.uk>
NFSv4 - no create_session_sequence in NFS v4.0

Make sure NFS compiles if support for NFS v4.1 is disabled at configure time.

Signed-off-by: Max Matveev <makc@gmx.co.uk>
Noew test
FSAL_GPFS requires a header which is not available nor required by the code
FSAL_check_quota - let's try to agree about its arguments

FSAL_check_quota is taking simple char pointer as first argument yet
COMMON_check_quota is stuck in the time warp and thinks it should
be fsal_path_t.

Because XFS and HPSS are the only FSALs which implement its own
check_quota methods and because of the other code fix COMMON_check_quota
to follow the new order.

Signed-off-by: Max Matveev <makc@gmx.co.uk>
Add the NIV_MID_DEBUG entry to tabLogLevel, fixes trap on startup.
Fix root creation bug

In a non-junction case, nfs4_readdir_pseudo was failing to fill in the filehandle size.
Create a FIFO without hanging

Specify O_NONBLOCK to openat in VFSFSAL_mknod
fix for strict-compile
New test4g test
Merge branch 'next' of github.com:phdeniel/nfs-ganesha into next

Conflicts:
	non_regression_tests/thomasthon/run_tests.sh
Use "nseconds=0" in nfstime3 structures.