MT-SAFE iteration over LRU L1 (lru_thread).

The unique instance of itertion over any qlane's L1 queue
can be made MT-safe by ensuring that invalidating operations
(only delete, due to queue semantics) also update the
the iteration.

Mark qlanes as active when iteration is in progress, and
update lane iterators iif active.

Fix an apparent reference accounting problem--lru refcnt was
not elevated over lru_thread migration of entries to L2.

Remove redundant while loop checking qlength and per-lane work,
as these are checked in the iteration.

Reorder operations in L1->L2.

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
Make sure directory is updated correctly.
ganesha leaves dangling FSAL locks when file locked via NFSv3 and NFSv4

Signed-off-by: Rick Mesta <rmesta@us.ibm.com>
Add reindent script and readme

This is for the great reformatting.  The reindenture script will
reindent everything under a given directory.

Jim Lieb also wants us to follow kernel practice and clean things up as
per checkpatch, so there are directions for how to invoke it in the
README.

Signed-off-by: Adam C. Emerson <aemerson@linuxbox.com>
Update ntirpc submodule.

Take FreeBSD/portability fixes from Sachin Bhamare.

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
Merge branch 'dbus_dev' into merge_next
Merge remote-tracking branch 'tfb-bull/next' into merge_next

More Coverity fixes
Merge remote-tracking branch 'marc/dev-45' into merge_next
Merge remote-tracking branch 'rmesta/dev_44' into merge_next
Merge remote-tracking branch 'linuxbox2/next' into merge_next
Fixup iteration when lru->q == glistn, not glist.

If the node being dequeued is the one currently being processed
by lru_thread, then the value of glistn is stable and is the next
queue entry as desired.

However if the node being dequeued is that pointed to by glistn,
then lru_thread will proximately fault, so glistn must be updated
to point to the next entry in the queue.

Also it is useless to update glist, since it already points to the
entry before glistn (obviously).

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
Merge remote-tracking branch 'linuxbox2/next' into merge_next
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.