gfapi: handle graph switch (cwd, fds, locks)

- Migrate open fds to new graph
- Migrate locks held in open fd to new fd
- Refresh CWD, so resolution of relative paths happens on refreshed
  inode (on new graph).

Change-Id: I4b18083b9b290107ebda1f917fc85b635ab72fb4
BUG: 953694
Signed-off-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.org/5059
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra G <raghavendra@gluster.com>
logging: Fix to avoid excessive logging.

mem_get function: Log message related to mem_pool 
calloc is removed  as its been calculated in mempool
'stats'.  This messgae is consuming nearly half of 
the total log messages in DEBUG mode.

dht_hash_compute function: Changed log level from DEBUG 
to TRACE.

client_fdctx_destroy function: Changed log  level from DEBUG 
to TRACE.

Change-Id: Ic948db0419e76df4e95ebd0cabaf66eadbaada6b
BUG: 966851
Signed-off-by: Venkatesh Somyajulu <vsomyaju@redhat.com>
Reviewed-on: http://review.gluster.org/5086
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
protocol/client: Prevent excessive logging of client's "disconnect" messages.

Problem: Currently when gluster volume start force is executed, client process
         will talk to glusterd to get the port of the brick. But if brick's path
         is not available it cannot return brick's port. So client process will
         keep connecting and disconnecting from glusterd for port-query which
         is ultimately responsible for execssive logging of disconnect messages.

Fix:     Message will be logged just once at INFO level after the first
         disconnect from glusterd. Afterwards "disconnect" messages will be
         logged in DEBUG mode.

Change-Id: I2b787f3820b5da45e090c562e5698fcfe24a02cd
BUG: 959969
Signed-off-by: Venkatesh Somyajulu <vsomyaju@redhat.com>
Reviewed-on: http://review.gluster.org/4953
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
doc: Move relevant files out of legacy.

Change-Id: Iff9166dd7baa3d60b70ffab5ce9a692d211fa4fb
BUG: 811311
Signed-off-by: Vijay Bellur <vbellur@redhat.com>
Reviewed-on: http://review.gluster.org/5091
Reviewed-by: Justin Clift <jclift@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
performance/write-behind: Enable write-behind when strict_O_DIRECT is not set.

When open() with O_DIRECT happens, write-behind was being disabled for the
fd irrespective of strict_O_DIRECT option. This commit disables write-behind
only when strict_O_DIRECT is enabled.

Change-Id: Ieef180e52910c3bf64d46b26b0e5dc3b8542f6d2
BUG: 923556
Signed-off-by: Vijay Bellur <vbellur@redhat.com>
Reviewed-on: http://review.gluster.org/4697
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
glusterd-volgen: Enable open-behind based on op-version

This patch enables the open-behind by default only when the op-version
allows it. Also the volume op-version calculations take account of this
enablement.

Change-Id: Idf7a3c274ec4828aafc815cdd1df829ecb853354
BUG: 954256
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.org/4866
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
configure.ac: add build option for glupy

Check whether Python.h, glupy dependency, is installed in the system.
 ('Python.h' part of python-devel or python-dev package.)

Allow following build options:
 --enable-glupy   build glupy; If dependencies are not met, abort
                  configure script run with error.

 --disable-glupy  don't build glupy even if dependencies are met.

 default          build glupy; If dependencies are not met, don't build
                  glupy and allow configure script run with warning.

glupy-specific dependencies:
 python2.x, python-devel/python-dev package

Change-Id: Ia495dd00cac7d12ad76645c8576a0adc0cb5d590
BUG: 961856
Signed-off-by: Ram Raja <rraja@redhat.com>
Reviewed-on: http://review.gluster.org/5093
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
socket: convert socket functions to file scope (static)

The function names used in socket.c conflict with Samba's
socket functions (samba.git/source4/lib/socket/socket.h). Convert
our functions to file scope as they are anyways not called across
files.

Change-Id: If98ae557d3e2868f257c021b283ede6a5e92de02
BUG: 953694
Signed-off-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.org/5104
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
api/Makefile: link api.so against libgfapi (and dependencies)

Samba opens vfs_gluster.so with dlopen(..,RTLD_LOCAL). This makes
the symobls in the shared module and the library it exclusively
links against (specifically gfapi) not resolvable from the .so
files which are opened in turn within (like xlator .so files)
unless explicitly linked against the dependent libraries.

This is not otherwise required in case of glusterfsd as the main
executable symbols are always available for resolution from
dlopen()'ed shared objects, making Samba's vfs_glusterfs
requirement unique, but luckily not incompatible.

Change-Id: I894c521daade7d46ec5bf07793f2eea02ebc9700
BUG: 953694
Signed-off-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.org/5105
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
gfapi: add new API glfs_dup() to copy a file descriptor

Duplicate a glfs_fd file descriptor. Inherit the internal
fd_t with a reference.

Change-Id: Ib30e9a46b608b9f78202957f4dab6ba6265a9ec0
BUG: 953694
Signed-off-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.org/5109
Reviewed-by: Raghavendra Talur <rtalur@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
nfs: update nfs.addr-namelookup description

replaced rpc-auth.addr.* with nfs.rpc-auth-* in
keeping with the latest option exposed to the user.

Change-Id: I418354a4d171dae28dd0befe8ba9e5ee893cd013
BUG: 965025
Signed-off-by: Rajesh Amaravathi <rajesh@redhat.com>
Reviewed-on: http://review.gluster.org/5049
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
api: Fix api.so and libgfapi.so build time dependency

Not all versions of autoconf handle dependencies expressed
as "A: B". Use the xxx_DEPENDENCIES variable to make it
version independent

Change-Id: Ia0b13399d0bf10995d9845e04cd9eb3ef6518dbe
BUG: 953694
Signed-off-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.org/5118
Reviewed-by: Raghavendra Talur <rtalur@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
cli: set min-op-version and max-op-version for getspec

Change-Id: I2185df5d6b560d9367ae404c91812048e1655180
BUG: 969193
Signed-off-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-on: http://review.gluster.org/5119
Reviewed-by: Kaushal M <kaushal@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
cluster/dht: Do migration inprog/complete check only if ENOENT

Additionally, update op_errno to the lasted failure. If failures
found in complete_check, error returned would be EUCLEAN instead
of the right failure (in this case ENOENT)

Change-Id: Ib813867f4b817af651627b9ea07b0b09fa2b26ce
BUG: 966852
Signed-off-by: shishir gowda <sgowda@redhat.com>
Reviewed-on: http://review.gluster.org/4989
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
tests/bugs: Increase timeout for rebalance completion check

Change-Id: Ic299c0d7b3996f6e85f9627430efbdf3f9ea0a8f
BUG: 884455
Signed-off-by: shishir gowda <sgowda@redhat.com>
Reviewed-on: http://review.gluster.org/4942
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
statedump: Print entries in cb buffer in FIFO order

Currently cb buffer was being printed in LIFO order, which
is was against the percieved notion of logs having older
entries printed before newer entries in the state dumps.

Re-did the loop to prevent crash as when w_index == 0, we
would access cb[w_index - 1].

Change-Id: Idd085f73fa6937e506a2a1925e42fbcfd2d9bb1c
BUG: 966847
Signed-off-by: shishir gowda <sgowda@redhat.com>
Reviewed-on: http://review.gluster.org/4968
Reviewed-by: Santosh Pradhan <spradhan@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>