call-stub: remove fall-through in ftruncate

Change-Id: I58bf6b881ff63d627051bef1ab30bd0337ab65e2
BUG: 913544
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/4564
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
glusterd: use gf_strdup() in place of strdup()

Change-Id: Idee71019dbc6eeaa0a808d671b29d6f3038a1a89
BUG: 913487
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: http://review.gluster.org/4562
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
glusterd: allow multiple instances of glusterd on one machine

This is needed to support automated testing of cluster-communication
features such as probing and quorum.  In order to use this, you need to
do the following preparatory steps.

* Copy /var/lib/glusterd to another directory for each virtual host

* Ensure that each virtual host has a different UUID in its glusterd.info

Now you can start each copy of glusterd with the following xlator-options.

* management.transport.socket.bind-address=$ip_address

* management.working-directory=$unique_working_directory

You can use 127.x.y.z addresses for binding without needing to assign
them to interfaces explicitly.  Note that you must use addresses, not
names, because of some stuff in the socket code that's not worth fixing
just for this usage, but after that you can use names in /etc/hosts
instead.

At this point you can issue CLI commands to a specific glusterd using
the --remote-host option.  So far probe, volume create/start/stop,
mount, and basic I/O all seem to work as expected with multiple
instances.

Change-Id: I1beabb44cff8763d2774bc208b2ffcda27c1a550
BUG: 913555
Signed-off-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-on: http://review.gluster.org/4556
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
features/compress: Compression/DeCompression translator

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.

Other minor changes :
* Check for min file size and buffer size while loading xlator
* Change OS type in gzip header from invalid(254) to UNIX(3)

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

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