PROXY FSAL - make it easier for callers to expand handle

We don't need export context when expanding handle. Moreover
lots of places in cache_inode assume that they can get the
size without having an export.

Signed-off-by: Max Matveev <makc@gmx.co.uk>
Fix inclusion of CEPH subdir

Signed-off-by: Jim Lieb <jlieb@panasas.com>
PROXY FSAL - only sleep after unsuccessful attempt to reconnect

If we managed to reconnect to the backend server then
there is no need to delay the next call any longer,
the server is ready and willing, give him work to do.

Signed-off-by: Max Matveev <makc@gmx.co.uk>
NFSv3 - check for garbage in nfs3_FSALattr_To_Fattr

This is just a temporary measure - real fix would involve
actually checking valid bits in the fsal_attrib_list_t and only
updating things which are marked as valid in fsal_attrib_list_t

Signed-off-by: Max Matveev <makc@gmx.co.uk>
PROXY FSAL - don't leak memory in readdir

When setting up structure which is going to be
used to hold reply data from NFSv4 readdir make
sure that nextentry pointers are setup properly.

Also simplify the allocation games by using single
proxy_entry4 structure which has entries for
name, attributes and bitmaps, entry4 points to
its "own" fields.

Finally, do set cookie in the directory entries -
callers may need it if they're not generating
its own cookies.

Signed-off-by: Max Matveev <makc@gmx.co.uk>
remove redundant inclusion of "config.h" from headers & add it in a single C file
debug print of "whence" was not formated in one place & is copied all over - refactored into a single formatting function
dos2unix only
cleanup logging
NFSv3 - be paranoid about attributes

fsal_attrib_list_t can be handed into nfs3_FSALattr_To_Fattr
without enough valid bits to fill fattr3. Because fattr3 does
not have optional fields we cannot just use some bits and
leave others at 0 or some random garbage, instead refuse
the conversion. For callers like nfs3_SetPostOpAttr which
have an option of not returning attributes the failed conversion
would mean that no attributes is sent to the clients.
For other callers it would result in an error.

Signed-off-by: Max Matveev <makc@gmx.co.uk>
XFS FSAL - check_quota again

Once again we've changing the arguments for fsal_check_quota.
Hopefully this is the last time.

Signed-off-by: Max Matveev <makc@gmx.co.uk>
NFSv3 - fix setattr to return correct attributes

If we only change size of the file then cache_inode_truncate
returns correct attributes for post-op - use them. Otherwise
cache_inode_setattr will return correct attributes. Either
way at the end of the call setattr is correct and fully
filled.

Signed-off-by: Max Matveev <makc@gmx.co.uk>
FSAL - print only valid bytes in the handle

When printing FSAL handles for debuging get the true handle
size and only print valid bytes in the handle.

Signed-off-by: Max Matveev <makc@gmx.co.uk>
PROXY FSAL - use common code for processing fattr4

NFS4 provides function which does most of the job
for converting fattr4 to FSAL - factor out
the differences like dealing with filehandles
and use the nfs4_Fattr_To_FSAL_attr.

Also factor out common code in nfs4_Fattr_To_FSAL_attr
for dealing with time processing.

Signed-off-by: Max Matveev <makc@gmx.co.uk>
locks were being lost when the client truncated a file.  also v4 was calling
truncate twice on the same file.

Signed-off-by: Jim Wahlig <jgwahlig@us.ibm.com>
Signed-off-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Fix a file handle problem with save/restorefh - length not saved/restored.

Signed-off-by: Jim Wahlig <jgwahlig@us.ibm.com>
Signed-off-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
fix truncate failure in cthon v3

Signed-off-by: Jim Wahlig <jgwahlig@us.ibm.com>
Signed-off-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Translating some debug messages left in french.

Signed-off-by: Leonardo Tonetto <tonetto@linux.vnet.ibm.com>
Signed-off-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Fix a bunch of issues exposed by BEAM static code analysis.

The mistakes found were about pointers being referenced without testing
for NULL values, or variables receiving values from different types.

Signed-off-by: Leonardo Tonetto <tonetto@linux.vnet.ibm.com>
Signed-off-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
combine v3 and v4 grace period to use the same routine.

Signed-off-by: Jim Wahlig <jgwahlig@us.ibm.com>
Signed-off-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>