core: moved back the pthread_key_t specific variables as global

in a patch to move all the global variables inside 'ctx', moved all
the pthread_key_t specific globals, which needed to be global, not inside
some structures.

Change-Id: I5e7107a8a64f5b80e90fd469fb084f62b2312705
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 764890
Reviewed-on: http://review.gluster.com/3783
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
logging: do the 'right' check for loglevel

logging functions should not print anything if loglevel in argument list
is lower than what is set for the process.

Change-Id: Id61779ffe6b76724243aa222c6889dd51a8f2f9b
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 846201
Reviewed-on: http://review.gluster.com/3786
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
geo-rep: don't leak or segfault upon OOM

In glusterd_urltransform, a failed GF_REALLOC would clobber
the would-be-realloc'd buffer, linearr, with a NULL pointer,
(thus leaking that memory) and then control would pass to the
error-handling code that would attempt to free
(via glusterd_urltransform_free) linearr[i], which is almost
guaranteed to segfault when linearr is NULL.

Change-Id: Ia75bf70fd8ff893a18804d49688048ef96db6037
BUG: 846755
Signed-off-by: Jim Meyering <meyering@redhat.com>
Reviewed-on: http://review.gluster.com/3791
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
fuse-bridge: fuse_thread_proc: avoid realloc-clobber induced leak upon OOM

Change-Id: I835d14b702b875bb07f41e157583592df9b72f36
BUG: 846755
Signed-off-by: Jim Meyering <meyering@redhat.com>
Reviewed-on: http://review.gluster.com/3792
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
performance/write-behind: store the wb_inode in local before winding

* Store the write-behind's inode context in the local structure before
  winding the call so that in callback inode context is found.

* Before returning EBADFD check if the inode context (wb_inode) is NULL,
  along with the inode type.

Change-Id: If5a1c667efe6882a6efef1439cee3effc32ff9a7
BUG: 846536
Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
Reviewed-on: http://review.gluster.com/3796
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
NetBSD swapcontext() portability fix

Further analysis of the problem reveals some wrong conclusions I made
before. NetBSD's swapcontext() preempts no thread. It alters the
pthread private pointer, leading to multiple threads with the same
pthread pointer. That led me to the wrong conclusion that thread were
preempted. I guess this can be called a bug: NetBSD swapcontext()
is incompatible with libpthread.

Fortunately, there is a workaround, swapcontext() can be told to
let the pthread private pointer untouched. This change just does
that, fixing the crashes without sacrifying performances.

There is just one problem: not all NetBSD ports have the capability
to do that: at least ports using sh3, sparc, sparc64 and powerpc
are left broken by this change. This problem will be addressed by
upcoming fixes in NetBSD.

BUG: 764655
Change-Id: I4191cb984176fce7064730ab55bd62c9156846cd
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.com/3794
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
cluster/dht: Optimize readdirp calls in DHT

Bring in option which is supported by posix xlator
to filter out directory's entries from being returned.
DHT would now request non-first subvols to filter out
directory entries.

dht xlator-option readdir-optimize will enable this
optimization

Change-Id: I35224bc81c9657f54f952efac02790276c35ded5
BUG: 838199
Signed-off-by: shishir gowda <sgowda@redhat.com>
Reviewed-on: http://review.gluster.com/3772
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
rfc.sh: set 'Change-Id: ' header on first run

Let first run of rfc.sh include 'Change-Id:' as well

Change-Id: I7b45a00d98f8c70ca3658c223a98f412f20cbb6f
BUG: 764890
Signed-off-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.com/3785
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Merge branch 'master' into op-version
Some fixes based on KP's comments

Change-Id: I7b7d18f5a7bf2d1bcfde546100762e79b985fdbb