summaryrefslogtreecommitdiffstats
path: root/xlators/features/compress/src
diff options
context:
space:
mode:
authorPrashanth Pai <ppai@redhat.com>2014-02-17 20:42:42 +0530
committerVijay Bellur <vbellur@redhat.com>2014-02-26 09:18:35 -0800
commitf69e85511645fcbd0526e38ca88dd3e5bf0ed917 (patch)
tree88d9b3355bd9eb147a62e059dd62a5951762f101 /xlators/features/compress/src
parent64079f83528edb4cc4ae1a85a8633fd578b6e393 (diff)
feature/compress: Validate option and enable doc
* Validate network.compression option * Enable descriptions of xlator configurable options * Improve indentation in code * Make network.compression.mode not configurable by user. This is similar to "iam-self-heal-daemon" option in AFR xlator. Fixes BUGs: 1065658, 1065640, 1065655 Change-Id: I99d82b574ee0e5c8c2baf5f5d52dbf8d015d330a BUG: 1065640 Signed-off-by: Prashanth Pai <ppai@redhat.com> Reviewed-on: http://review.gluster.org/7024 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/features/compress/src')
-rw-r--r--xlators/features/compress/src/cdc.c78
1 files changed, 39 insertions, 39 deletions
diff --git a/xlators/features/compress/src/cdc.c b/xlators/features/compress/src/cdc.c
index eb7d87c5698..a334c7e061c 100644
--- a/xlators/features/compress/src/cdc.c
+++ b/xlators/features/compress/src/cdc.c
@@ -115,8 +115,8 @@ cdc_writev_cbk (call_frame_t *frame,
struct iatt *postbuf, dict_t *xdata)
{
- STACK_UNWIND_STRICT (writev, frame, op_ret, op_errno, prebuf, postbuf, xdata);
- return 0;
+ STACK_UNWIND_STRICT (writev, frame, op_ret, op_errno, prebuf, postbuf, xdata);
+ return 0;
}
int32_t
@@ -129,24 +129,23 @@ cdc_writev (call_frame_t *frame,
uint32_t flags,
struct iobref *iobref, dict_t *xdata)
{
- int ret = -1;
- cdc_priv_t *priv = NULL;
- cdc_info_t ci = {0,};
- size_t isize = 0;
+ int ret = -1;
+ cdc_priv_t *priv = NULL;
+ cdc_info_t ci = {0,};
+ size_t isize = 0;
- GF_VALIDATE_OR_GOTO ("cdc", this, default_out);
- GF_VALIDATE_OR_GOTO (this->name, frame, default_out);
+ GF_VALIDATE_OR_GOTO ("cdc", this, default_out);
+ GF_VALIDATE_OR_GOTO (this->name, frame, default_out);
- priv = this->private;
+ priv = this->private;
- isize = iov_length(vector, count);
+ isize = iov_length(vector, count);
- if (isize <= 0)
- goto default_out;
+ if (isize <= 0)
+ goto default_out;
- if ( (priv->min_file_size != 0)
- && (isize < priv->min_file_size) )
- goto default_out;
+ if ( (priv->min_file_size != 0) && (isize < priv->min_file_size) )
+ goto default_out;
ci.count = count;
ci.ibytes = isize;
@@ -159,18 +158,18 @@ cdc_writev (call_frame_t *frame,
/* A writev compresses on the client side and decompresses on the server side
*/
- if (priv->op_mode == GF_CDC_MODE_CLIENT) {
- ret = cdc_compress (this, priv, &ci, &xdata);
- } else if (priv->op_mode == GF_CDC_MODE_SERVER) {
- ret = cdc_decompress (this, priv, &ci, xdata);
- } else {
- gf_log (this->name, GF_LOG_ERROR, "Invalid operation mode (%d) ", priv->op_mode);
- }
-
- if (ret)
- goto default_out;
-
- STACK_WIND (frame,
+ if (priv->op_mode == GF_CDC_MODE_CLIENT) {
+ ret = cdc_compress (this, priv, &ci, &xdata);
+ } else if (priv->op_mode == GF_CDC_MODE_SERVER) {
+ ret = cdc_decompress (this, priv, &ci, xdata);
+ } else {
+ gf_log (this->name, GF_LOG_ERROR, "Invalid operation mode (%d) ", priv->op_mode);
+ }
+
+ if (ret)
+ goto default_out;
+
+ STACK_WIND (frame,
cdc_writev_cbk,
FIRST_CHILD (this),
FIRST_CHILD (this)->fops->writev,
@@ -181,13 +180,13 @@ cdc_writev (call_frame_t *frame,
return 0;
default_out:
- STACK_WIND (frame,
+ STACK_WIND (frame,
cdc_writev_cbk,
FIRST_CHILD (this),
FIRST_CHILD (this)->fops->writev,
fd, vector, count, offset, flags,
iobref, xdata);
- return 0;
+ return 0;
}
int32_t
@@ -309,17 +308,17 @@ struct volume_options options[] = {
{ .key = {"mem-level"},
.default_value = "8",
.type = GF_OPTION_TYPE_INT,
- .description = "Memory allocated for internal compression state.\
- 1 uses minimum memory but is slow and reduces \
- compression ratio; memLevel=9 uses maximum memory \
- for optimal speed. The default value is 8."
+ .description = "Memory allocated for internal compression state. "
+ "1 uses minimum memory but is slow and reduces "
+ "compression ratio; memLevel=9 uses maximum memory "
+ "for optimal speed. The default value is 8."
},
{ .key = {"compression-level"},
.default_value = "-1",
.type = GF_OPTION_TYPE_INT,
- .description = "Compression levels \
- 0 : no compression, 1 : best speed, \
- 9 : best compression, -1 : default compression "
+ .description = "Compression levels \n"
+ "0 : no compression, 1 : best speed, \n"
+ "9 : best compression, -1 : default compression "
},
{ .key = {"min-size"},
.default_value = "0",
@@ -329,13 +328,14 @@ struct volume_options options[] = {
{ .key = {"mode"},
.value = {"server", "client"},
.type = GF_OPTION_TYPE_STR,
- .description = "Set on the basis of where the xlator is loaded."
+ .description = "Set on the basis of where the xlator is loaded. "
+ "This option should NOT be configured by user."
},
{ .key = {"debug"},
.default_value = "false",
.type = GF_OPTION_TYPE_BOOL,
- .description = "This is used in testing. Will dump compressed data \
- to disk as a gzip file."
+ .description = "This is used in testing. Will dump compressed data "
+ "to disk as a gzip file."
},
{ .key = {NULL}
},