Fix rpm build issues.
Added Use_Getattr_Directory_Invalidation = 1; to Cacheinode_Client section.
Adding functionality to nfs4_sanity_check_FH.

nfs4_sanity_check_FH combines functions commonly called among the NFSv4
and NFSv41 operations handlers, testing the fh passed to each function
and can also check for desired file types. From the RFC 3530:

   NFS4ERR_NOTDIR        Not a directory. The caller specified a non-
                         directory in a directory operation.

   NFS4ERR_INVAL         Invalid argument or unsupported argument for an
                         operation. Two examples are attempting a
                         READLINK on an object other than a symbolic
                         link or specifying a value for an enum field
                         that is not defined in the protocol (e.g.,
                         nfs_ftype4).

Also, some debug messages to track what's happening.

Signed-off-by: Leonardo Tonetto <tonetto@linux.vnet.ibm.com>
Introduction of nfs4_sanity_check_FH and some very basic code refactoring for NFSv41.

Introducing nfs4_sanity_check_FH to the parts of the code where it was applicable.

Also some code refactoring. Removing some intermediate variables, used to store
the return value of some functions. In those cases, removing the variable
assignment from the 'if' statement. And some symmetry reorg for a better look :-)

Signed-off-by: Leonardo Tonetto <tonetto@linux.vnet.ibm.com>
Introduction of nfs4_sanity_check_FH and some very basic code refactoring for NFSv4.

Same as the previous patch, but now for nfsv4 files.

Introducing nfs4_sanity_check_FH to the parts of the code where it was applicable.

Also some code refactoring. Removing some intermediate variables, used to store
the return value of some functions. In those cases, removing the variable
assignment from the 'if' statement. Some symmetry reorg for a better look :-)
And some typos fix and french translations.

Signed-off-by: Leonardo Tonetto <tonetto@linux.vnet.ibm.com>
Fix special files cases in GPFSFSAL_mknode.
Fixing create/delete loop bug

Signed-off-by: Venkateswararao Jujjuri "<jvrao@linux.vnet.ibm.com>
Simple fix in cache_inode_get() to return with pentry for upcalls.

Signed-off-by: Venkateswararao Jujjuri "<jvrao@linux.vnet.ibm.com>
Add missing HashTable_ReleaseLatched  to avoid latch runaways.

Signed-off-by: Venkateswararao Jujjuri "<jvrao@linux.vnet.ibm.com>
Unlock missing gweakref_table_t->lock

Signed-off-by: Venkateswararao Jujjuri "<jvrao@linux.vnet.ibm.com>
Set the lock flag properly.

Signed-off-by: Venkateswararao Jujjuri "<jvrao@linux.vnet.ibm.com>
leaking file descriptors on error returns.
[pyNFS] Return code of OPEN for special files

From the NFSv4 current draft (draft-ietf-nfsv4-rfc3530bis-17):

   If the component provided to OPEN resolves to something other than a
   regular file, an error will be returned to the client.  If it is a
   directory, NFS4ERR_ISDIR is returned; otherwise, NFS4ERR_SYMLINK is
   returned.  Note that NFS4ERR_SYMLINK is returned for both symlinks
   and for special files of other types; NFS4ERR_INVAL would be
   inappropriate, since the arguments provided by the client were
   correct, and the client cannot necessarily know at the time it sent
   the OPEN that the component would resolve to a non-regular file.

Thus, this patch fixes 4 pyNFS tests that are failing.

Signed-off-by: Leonardo Tonetto <tonetto@linux.vnet.ibm.com>
[pyNFS] Fix for pyNFS LOOKP2a test

From the RFC 3530:

14.2.14. Operation 16: LOOKUPP - Lookup Parent Directory

   IMPLEMENTATION

   As for LOOKUP, LOOKUPP will also cross mountpoints.

   If the current filehandle is not a directory or named attribute
   directory, the error NFS4ERR_NOTDIR is returned.

Thus, LOOKUPP should return only NFS4ERR_NOTDIR for any wrong file type.
This patch fixes pyNFS LOOKP2a test that was failing.

Signed-off-by: Leonardo Tonetto <tonetto@linux.vnet.ibm.com>
Make cache_inode_new_entry behave properly on finding a dead entry

In this changeset, we modify cache_inode_new_entry to replace any dead
entry it finds in the hash table.  We add a new function,
HashTable_DelSafe that searches for a key and checks that values match
before deletion, and use it in cache_inode_kill_entry and
cache_inode_clean_internal.  The effect is such that these functions
will only delete a hash table entry if it has not been replaced by
cache_inode_new_entry.  (The original cache entry that was replaced
will still be deconstructed, however.)
Fix the return code logic of HashTable_SetLatched

Signed-off-by: Venkateswararao Jujjuri "<jvrao@linux.vnet.ibm.com>
Close the directory file descriptor on error.
fix bug using "woke", remove bad assert, add fix for multiple cache of '.'
nfsv3 wasn't sending nsec to clients.

A client won't update if it doesn't think it's
out of date.
Properly account for open_fd_count decrement.

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