CID#23120 Logically dead code
Maximum concurrent RPC requests is now hard coded.
To improve readability and avoid this issue, it's
better to directly assign the value to 16.
Move container_of up (with related code, lru_run).

In previous reorganization of lru_run, the early return was moved
up, but assignment of entry was not moved, leading to an illegal
access.

Found (sort of) by Coverity, reported by Thomas Favre-Bulle
<thomas.favre-bulle@bull.net>.

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
Add checkpatch configuration file

This ignores things related to the kernel and CamelCase, it can be
modified later.

Signed-off-by: Adam C. Emerson <aemerson@linuxbox.com>
CID#18514 Dead code

The last instruction cannot be reached under any
circumstances. The same return status is reached
from the first else if instruction.
CID#18479 Argument cannot be negative

close doesn't accept a negative value for
fd. Moving this close instruction at the
end of the if statement is the correct
way to proceed.
Use LogCrit on idmapping errors.

A fatal error here probably wasn't intended.

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
Ported from 1.5.x: 71cbffce2acfa5c84a0efa099a35b045f6425735

(Fixes RPCSEC_GSS group mapping.)

Signed-off-by: suhrud <supatank@in.ibm.com>
Signed-off-by: Matt Benjamin <matt@linuxbox.com>

Conflicts:
	src/IdMapper/idmapper.c
	src/include/idmapper.h
CID#18192 Unsigned compared against 0

Here namesize was of type size_t and could store
a negative value. ssize_t is prefered in this case
since we want to catch a negative return value
treated as an error.
CID#18162 Unsigned compared against 0

Here namesize was of type size_t and could store
a negative value. ssize_t is prefered in this case
since we want to catch a negative return value
treated as an error.
CID#18482 Unsigned compared against 0

Here namesize was of type size_t and could store
a negative value. ssize_t is prefered in this case
since we want to catch a negative return value
treated as an error.
CID#18458 Missing unlock

When returning EINVAL, the handle mutex wasn't released.
This is to be more consistent with the normal case where
the lock is released. I don't think it's required to
destroy it though.
Added ignoring vim swap files
Forgot the wildcard to get rid of vim swap files
CID#18457 Missing unlock

The mutex hold by fsal_lock wasn't released at the end of
the function. Though it might not be truly necessary, we
unlock it anyway.
CID#18502 Dereference before NULL check

recall is dereferenced before checking whether it's NULL
or not.
CID#18449 Logically dead code

Setting rc cannot be reached under any circumstances.
recall memory allocation is checked at the beginning,
therefore it can't be NULL at this stage.
Code cleanup: glist function name change

To prepare for 2.0 RC, this patch renames init_glist to
glist_init. The function was named this way to avoid a
conflict when building with MySQL support. Since the
later has been dropped along with the POSIX FSAL, a
general rename is done.
Fix fallthrough in cache_inode_destroyer

Thanks to Thomas Fabre-Bulle's coverity report.

Signed-off-by: Adam C. Emerson <aemerson@linuxbox.com>
Finish removing structure-renaming macros

These weren't type safe and some had typos that would start causing
problems if anyone used them.

Signed-off-by: Adam C. Emerson <aemerson@linuxbox.com>
Hpss build: fix install path, don't link MainNFSD/ganesha.nfsd against hpss, only set rpath for the fsal