storage/posix: Remove a redundant lstat in posix_handle_hard.

Change-Id: I9129b71d5568eff3513c17e3607256783fdc42ec
BUG: 903396
Signed-off-by: Mohammed Junaid <junaid@redhat.com>
Reviewed-on: http://review.gluster.org/4641
Reviewed-by: Peter Portante <pportant@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
object-storage: Restoring multi volume support in UFO.

* Currently, the users of UFO are restricted to use just one volume
  at any given point of time. This patch removes this limitation.

* The usage of gluster-swift-gen-builders has also changed. With this
  commit the users should mention the list of volumes that they want
  to expose through UFO. So, only the volumes mentioned during the
  ring file generation can be accessed.

  Usage: gluster-swift-gen-builders <vol-name1> [<vol-name2>]...

This is an intermediate fix until we remove the account, container and
object server processes. Once we have this frame work running, it will
completely eliminate the ring files.

Change-Id: I9ad3808519fec9c7c60ad846c4f8b653117a8337
BUG: 909053
Signed-off-by: Mohammed Junaid <junaid@redhat.com>
Reviewed-on: http://review.gluster.org/4485
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: Peter Portante <pportant@redhat.com>
object-storage: Fixing the errors and warnings in unittest.

Change-Id: Id22c968aefd82c4b62445b3ecc93cbabc2b35ffc
BUG: 887301
Signed-off-by: Mohammed Junaid <junaid@redhat.com>
Reviewed-on: http://review.gluster.org/4394
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: Peter Portante <pportant@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
gfapi: dict_unref() xattr_req in fop finish instead of dict_destroy()

The current way of calling dict_destroy() at the end of an API fop assumes
that xattr_req is not stored/ref'd by any translators in the stack. However
when translators like DHT store xattr_req in dht_local_t with a dict_ref()
and perform dict_unref() in the unwind path, things get subject to a race.

The race is between the woken up thread (by syncop_wake) i.e, the gfapi
invoking thread and the thread where the FOP was unwound. As the C stack
of STACK_UNWIND unwinds back, dht_local_unref() gets invoked within the
DHT_STACK_UNWIND macro. This thread attempts dict_unref, which would
be "safe" if it wins the race against the gfapi invoking thread. However
if the gfapi invoking thread wins the race, it will perform dict_destroy()
first and therefore make dict_unref() within dht_local_unref perform
a double free.

This is the embarrassing on-screen bug which showed up in a roomful of people
during the gluster dev summit demo of qemu/libgfapi integration.

Change-Id: I284c93de87cdc128d5801f42c84aa87f753090d4
BUG: 839950
Signed-off-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.org/4644
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
cluster/distribute: Fix layout overlaps due to spread-count in selfheal path

We needed to zero out the layout range, before we re-calculate the range.
When spread-count is issued, we would end up with stale ranges in the layout.

Replaced dht_selfheal_dir_xattr with dht_fix_dir_xattr, which correctly resets
the un-used (after re-cal) layouts.

Change-Id: I1a900d15df07335f59356bd23182ccec34381ab2
BUG: 884455
Signed-off-by: shishir gowda <sgowda@redhat.com>
Reviewed-on: http://review.gluster.org/4647
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
iobuf: Added a function iobref_clear

Original-author: Venky Shankar <vshankar@redhat.com>

Change-Id: Ibf861db6c1b084b798d210962344487a1919aad2
Signed-off-by: Prashanth Pai <nullpai@gmail.com>
features/compress: Compression/DeCompression translator

Changes made to original code :
* Changed Makefile.am to reflect changes from commit 58e6296f
* Code to be merged into glusterd-volgen.c moved to
  glusterd-volume-set.c file introduced by commit 99fe09f4
* Added .default_value and .description to xlator options[]
  and removed them from glusterd-volume-set.c
* Moved all cdc xlator specific functions to cdc-helper.c
  retaining only fop implementations in cdc.c
* Changed op_version form 0 to 2 in glusterd-volume-set.c

The following work has been done by Venky Shankar.
Original-author : Venky Shankar <vshankar@redhat.com>

On the server this translator compresses (deflate) data before
it's pushed out to the network to the client. On the client
this compressed data is decompressed (inflate) to it's original
form. What is saved is the amount of data that is sent over
the wire.

(De)Compression is done using Zlib library (inflate/deflate
routines respectively). As of now, data is transferred in
gzip format (header + <compressed data> + trailer). The
header can be taken away to make data more lightweight.
Trailer is needed as it contains the CRC and length of the
original (uncompressed) data used for validating inflated
data.

HOW TO USE
----------
As of now, you'd need to edit the volfile to use this feature;
there is no way to do so from CLI. On the server, load it above
the server translator so that data is compressed just before it
is send out to the network. On the client, load it below the
client translator. But since there can be multiple instances of
the client translator (distribute, replicate etc..), you'd need
to have that many instances of this translator *pointing* to
it's respective client translator.

Change-Id: Ib7a66b6f1f70fe002b7c513588cdf75c69370805
Signed-off-by: Venky Shankar <vshankar@redhat.com>
Signed-off-by: Prashanth Pai <nullpai@gmail.com>
features/compress: Added writev

* Writev compresses data on client and decompresses on server.
  Similarly readv compresses data on server and decompresses
  on client.

* The possible values for "mode" option of the cdc xlator
  were compress/decompress earlier. This has been changed
  after adding writev. Currently the mode option can be
  client/server.

* Removed gzip header while compressing which was an overhead.
  Gzip header will henceforth be used for testing/debugging only.
  Compressed data is identified by xdata key/value.

* Added a debug xlator option. When this is turned on, compressed
  data will be dumped to disk as a gzip file.

Change-Id: If4eb4f8af2d63b4bc059e9daaecfda9e1ad8ea56
Signed-off-by: Prashanth Pai <nullpai@gmail.com>
features/compress: Set compression xlator options from CLI

Ex : gluster volume set <vol_name> compress on
     gluster volume set <vol_name> compress.buffer-size 32768

Change-Id: Id30459fd76f7b5155d7b063c36e9caeee4923339
Signed-off-by: Prashanth Pai <nullpai@gmail.com>