Pass client IP to fsal

A customer has asked for a way to pass the clients IP address to
the fsal.  This patch modifies nfs_build_fsal_context to store the
clients ip address in the user_credentials of the fsal_op_context_t

v1 -> v2
Instead of makeing the IP an API change, we just store the IP
during the nfs_build_fsal_context routine

v2 -> v3
Do copy_xprt_addr in nfs_build_fsal_context to avoid adding extra
parameter

v3 -> v4
Moved sockaddr_t to the last member of the user_credentials
struct

Signed-off-by: Allison Henderson <achender@linux.vnet.ibm.com>
Signed-off-by: Jim Lieb <jlieb@panasas.com>
FSAL_LUSTRE : now has correct implementation of fsal_quota.c (to be use for RQUOTA) based on llapi_quotactl
Backport new_handle to 9P.
9P: new_handle logic was badly implemented. This is now fixed
9P: backport cir logic to 9P implementation
9P: fix TSTATFS bug
[pyNFS] Fix pyNFS OPDG9d test - NFS4ERR_INVAL for any wrong file type

The RFC 3530 doesn't mention any other return code for wrong file type,
such as NFS4ERR_ISDIR. Thus, this patch fixes pyNFS OPDG9d test that
was failing.

Note that this "bug" was introduced by me on a previous commit. :-)

Signed-off-by: Leonardo Tonetto <tonetto@linux.vnet.ibm.com>
Fixed few bugs related to lru.refcount

Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Add ServerEpoch and -E command line option

By default ServerEpoch = ServerBootTime, -E allows
override with an externally calculated epoch value.

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

Conflicts:

	src/MainNFSD/nfs_main.c

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

Conflicts:

	src/MainNFSD/nfs_main.c

Signed-off-by: Frank Filz <ffilzlnx@us.ibm.com>
Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Change nfs4_BuildStateId_Other to use epoch and 64 bit global counter

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

Conflicts:

	src/SAL/nfs4_state.c
	src/SAL/nfs4_state_id.c

Signed-off-by: Frank Filz <ffilzlnx@us.ibm.com>
Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Cast oid to (unsigned long) for printf, can be either u_long or u_char

Signed-off-by: Frank Filz <ffilzlnx@us.ibm.com>
Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Clean up white space in SAL/nfs4_state_id.c

Signed-off-by: Frank Filz <ffilzlnx@us.ibm.com>
Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Revamp stateid checking and hashing

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

Conflicts:

	src/SAL/nfs4_state_id.c
	src/include/nfs_core.h

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

Conflicts:

	src/SAL/nfs4_state_id.c

Signed-off-by: Frank Filz <ffilzlnx@us.ibm.com>
Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Use prentry->attributes.fileid instead of FSAL_DIGEST_FILEID3

Signed-off-by: Frank Filz <ffilzlnx@us.ibm.com>
Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Make cache_inode_rdwr to call cache_inode_close instead of directly
calling FSAL_close()

Signed-off-by: Venkateswararao Jujjuri "<jvrao@linux.vnet.ibm.com>
Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Fix from Adam to address CONDEMNED entry getting stuck in a valid lane.

Signed-off-by: Venkateswararao Jujjuri "<jvrao@linux.vnet.ibm.com>
Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
add error checking to fsal_up.

Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Changed fsal_up thread generation to compare major fs id between entries.

Previously we compared major and minor numbers from the fs id
in each export entry to see which export entries need to
start their own fsal_up threads and which entries already have
an fsal_up thread started by another export entry in the same
underlying filesystem.

Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Fixing some potential memory leaks in fsal_create operations

Signed-off-by: Leonardo Tonetto <tonetto@linux.vnet.ibm.com>
Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
[BUG] Checking the return value of cache_inode_lock_trust_attrs()

The return value of cache_inode_lock_trust_attrs should always be tested, if
the execution fails, the attributes won't be locked as expected.

This test is almost irrelevant inside cache_inode_get.c since
cache_inode_check_trust() will garantee that the attributes are trustable,
_but_ there might exist an environment where something happens between those
two functions.

On cache_inode_readdir.c this should really be fixed. Also on this file,
fixed a potential problem if it were executed for something other than a
directory, that the function would unlock the attributes without having them
locked.

Signed-off-by: Leonardo Tonetto <tonetto@linux.vnet.ibm.com>
Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>