Merge branch 'new_handle' into tmp
Changes to make GPFS FSAL work with Jim's new code.

Signed-off-by: Venkateswararao Jujjuri "<jvrao@linux.vnet.ibm.com>
Signed-off-by: Jim Lieb <jlieb@panasas.com>
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>
Signed-off-by: Jim Lieb <jlieb@panasas.com>
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>
Signed-off-by: Jim Lieb <jlieb@panasas.com>
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>
Signed-off-by: Jim Lieb <jlieb@panasas.com>
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>
Signed-off-by: Jim Lieb <jlieb@panasas.com>
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>
Signed-off-by: Jim Lieb <jlieb@panasas.com>
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>
Signed-off-by: Jim Lieb <jlieb@panasas.com>
Minor type mismatch when dealing with request queue in NFS workers

Punt pointer to the correct type.

Signed-off-by: Jim Lieb <jlieb@panasas.com>
IdMapper - strict compile with --disable-nfsidmap

Make sure IdMapper compiles with --disable-nfsidmap --enable-strict-compile

Signed-off-by: Jim Lieb <jlieb@panasas.com>
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>
Signed-off-by: Jim Lieb <jlieb@panasas.com>
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>
Signed-off-by: Jim Lieb <jlieb@panasas.com>
Fixes to merge IBM_and_new_handle merge

Signed-off-by: Jim Lieb <jlieb@panasas.com>
Fix allocation error in commit 47a9e489628682

memory allocation and memset 0 are using sizeof instead of count.

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