Fix typo in thread fridge

Signed-off-by: Adam C. Emerson <aemerson@linuxbox.com>
LRU Refactor.

Simplify underlying LRU model, esp. locking.

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
Dont leak qlane lock in dec_pin_ref.

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
Safely unref entries on no queue.

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
Hash only (256) packet bytes in drc_tcp_hash, not the bytes plus
the redundant handle data.

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
Cleanup cleanup

Signed-off-by: Adam C. Emerson <aemerson@linuxbox.com>
Find tcmalloc on Debian (and Ubuntu)

Add the required search path to FindTcMalloc.cmake.

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
Add TI-RPC debug flags to ganesha.conf.

Add RPC_Debug_Flags option to NFS_Core_Param.  For possible
values, see the bitfield definitions in rpc/types.h.

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
Fix compilation issues in abstract_atomic

pick from 5473441f67a1484

Signed-off-by: Venkateswararao Jujjuri "<jvrao@linux.vnet.ibm.com>
Signed-off-by: Jim Lieb <jlieb@panasas.com>
Fix compilation if DBUS is not used.

pick from 5473441f67a1484f

Signed-off-by: Venkateswararao Jujjuri "<jvrao@linux.vnet.ibm.com>
Signed-off-by: Jim Lieb <jlieb@panasas.com>
Handle ESRCH error in VFS's posix2fsal_error()

Signed-off-by: Amit Dror <amitd@infinidat.com>
Fix compiler/linker errors on dev_22 when built with -DUSE_9P=OFF.

Signed-off-by: Sachin Bhamare <sbhamare@panasas.com>
(cherry picked from commit f3f2c12c3f65d7171a28a5733ab2d4faffe5e330)

Signed-off-by: Jim Lieb <jlieb@panasas.com>
Get rid of unused function definitions.

Signed-off-by: Sachin Bhamare <sbhamare@panasas.com>
(cherry picked from commit 76f0805f1516b927cf14582d1107fc3784014004)

Signed-off-by: Jim Lieb <jlieb@panasas.com>
Add definitions of two new syscalls to be used on FreeBSD platform.

This commit adds definitions of following 2 syscalls which are essentially
by-handle versions for link and readlink.
1. fhlink() -- Link file by handle.
2. fhreadlink() -- Read the symbolic link by handle.

Signed-off-by: Sachin Bhamare <sbhamare@panasas.com>
(cherry picked from commit 756848d87616e77b1c424949ee351e5b1f8fb6d0)

Signed-off-by: Jim Lieb <jlieb@panasas.com>
Add link_by_handle and readlink_by_handle APIs.

link_by_handle() on freebsd translates to fhlink(), a newly added syscall.
link_by_handle() on linux doesn't change current semantics and continues to use
linkat() with empty path name under the hood.

readlink_by_handle() on freebsd translates to fhreadlink(), a newly added
syscall.
readlink_by_handle() on linux doesn't change current semantics and continues to
use readlinkat() with empty path name under the hood.

Signed-off-by: Sachin Bhamare <sbhamare@panasas.com>
(cherry picked from commit 32d1c0b67cbc14035f7b0ac5477b076a322c8337)

Signed-off-by: Jim Lieb <jlieb@panasas.com>
Re-work VFS FSAL handle code to use newly added by-handle APIs in OS layer.

This commit fixes some places in the VFS FSAL handle code where linkat() and
readlinkat() calls were used with empty path names.
Since FreeBSD doesn't support empty path names in at-syscalls, we ended up
using new syscalls in FreeBSD which allow us to link() and readlink() by handle
instead.
On linux platform, these by-handle APIs continue to use linkat() and
readlinkat() with emprty path names as before.

Signed-off-by: Sachin Bhamare <sbhamare@panasas.com>
(cherry picked from commit 656ec5d01ad71bba0b3b2b5cdff0658538260ef5)

Signed-off-by: Jim Lieb <jlieb@panasas.com>
Merge commit '35907ede5090' from linuxbox2/next into merge_next

Dropped  Optimize Idmapper 7caee8906b67 dute to build probs.  Confirmed
with aemerson

Signed-off-by: Jim Lieb <jlieb@panasas.com>
9P/RDMA: Protect send buffers against early re-use

For 9P/RDMA, ganesha has two sets of buffers : recv and send buffers.
Each recv buffer is associated to a send buffer.
When a request is received on a recv buffer, it is processed and the associated
send buffer is used to send the reply.

But the current code fails to check that the previous message that was to be
sent using this send buffer has actually been sent and that this buffer can
be reused. In case of high traffic, this leads to buffer overwriting and
duplicate messages.

This patch adds a mutex to each buffer. Before processing a request, the mutex
is taken, and it will be released after the reply has been sent. If another request
wants to use the send buffer, it will have to wait for the message to be really
sent.

Signed-off-by: Simon Derr <simon.derr@bull.net>
(cherry picked from commit 859bca0298ebc7010bf11ee511ec90c2719e0ddc)

Signed-off-by: Jim Lieb <jlieb@panasas.com>
9P/RDMA: unlock buffer also when send fails

Signed-off-by: Simon Derr <simon.derr@bull.net>
(cherry picked from commit 6d53d09b2242da497d3b2a3a3d5687c4de8b34c3)

Signed-off-by: Jim Lieb <jlieb@panasas.com>
9P: Implement msize negotiation in TVERSION

Signed-off-by: Simon Derr <simon.derr@bull.net>
(cherry picked from commit 4f2dbe96c100c03322146a12438e6e729bba06d4)

Signed-off-by: Jim Lieb <jlieb@panasas.com>