All: remove memset() before sprintf()
It's not needed. There's a good chance the compiler is smart enough to remove it anyway, but it can't hurt - I hope. Compile-tested only! Change-Id: Id7c054e146ba630227affa591007803f3046416b updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
This commit is contained in:
parent
32c8f70f49
commit
b2b6ab8eff
@ -469,7 +469,6 @@ cli_cmd_sys_exec_cbk (struct cli_state *state, struct cli_cmd_word *word,
|
||||
tmp = strtok_r (NULL, " ", &saveptr);
|
||||
if (tmp) {
|
||||
in_cmd_args_count++;
|
||||
memset (cmd_arg_name, '\0', sizeof(cmd_arg_name));
|
||||
snprintf (cmd_arg_name, sizeof(cmd_arg_name),
|
||||
"cmd_arg_%d", in_cmd_args_count);
|
||||
ret = dict_set_str (dict, cmd_arg_name, tmp);
|
||||
@ -491,7 +490,6 @@ cli_cmd_sys_exec_cbk (struct cli_state *state, struct cli_cmd_word *word,
|
||||
|
||||
for (i=1; i <= cmd_args_count; i++) {
|
||||
in_cmd_args_count++;
|
||||
memset (cmd_arg_name, '\0', sizeof(cmd_arg_name));
|
||||
snprintf (cmd_arg_name, sizeof(cmd_arg_name),
|
||||
"cmd_arg_%d", in_cmd_args_count);
|
||||
ret = dict_set_str (dict, cmd_arg_name,
|
||||
|
@ -2633,7 +2633,6 @@ cli_get_detail_status (dict_t *dict, int i, cli_volume_status_t *status)
|
||||
char key[1024] = {0};
|
||||
int ret = 0;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "brick%d.free", i);
|
||||
ret = dict_get_uint64 (dict, key, &free);
|
||||
|
||||
@ -2641,7 +2640,6 @@ cli_get_detail_status (dict_t *dict, int i, cli_volume_status_t *status)
|
||||
if (!status->free)
|
||||
goto out;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "brick%d.total", i);
|
||||
ret = dict_get_uint64 (dict, key, &total);
|
||||
|
||||
@ -2649,13 +2647,11 @@ cli_get_detail_status (dict_t *dict, int i, cli_volume_status_t *status)
|
||||
if (!status->total)
|
||||
goto out;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "brick%d.device", i);
|
||||
ret = dict_get_str (dict, key, &(status->device));
|
||||
if (ret)
|
||||
status->device = NULL;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "brick%d.block_size", i);
|
||||
ret = dict_get_uint64 (dict, key, &(status->block_size));
|
||||
if (ret) {
|
||||
@ -2663,13 +2659,11 @@ cli_get_detail_status (dict_t *dict, int i, cli_volume_status_t *status)
|
||||
status->block_size = 0;
|
||||
}
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "brick%d.mnt_options", i);
|
||||
ret = dict_get_str (dict, key, &(status->mount_options));
|
||||
if (ret)
|
||||
status->mount_options = NULL;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "brick%d.fs_name", i);
|
||||
ret = dict_get_str (dict, key, &(status->fs_name));
|
||||
if (ret) {
|
||||
@ -2677,20 +2671,17 @@ cli_get_detail_status (dict_t *dict, int i, cli_volume_status_t *status)
|
||||
status->fs_name = NULL;
|
||||
}
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "brick%d.inode_size", i);
|
||||
ret = dict_get_str (dict, key, &(status->inode_size));
|
||||
if (ret)
|
||||
status->inode_size = NULL;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "brick%d.total_inodes", i);
|
||||
ret = dict_get_uint64 (dict, key,
|
||||
&(status->total_inodes));
|
||||
if (ret)
|
||||
status->total_inodes = 0;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "brick%d.free_inodes", i);
|
||||
ret = dict_get_uint64 (dict, key, &(status->free_inodes));
|
||||
if (ret) {
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -270,7 +270,6 @@ cli_xml_output_vol_status_common (xmlTextWriterPtr writer, dict_t *dict,
|
||||
"%s", hostname);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "brick%d.path", brick_index);
|
||||
ret = dict_get_str (dict, key, &path);
|
||||
if (ret)
|
||||
@ -279,7 +278,6 @@ cli_xml_output_vol_status_common (xmlTextWriterPtr writer, dict_t *dict,
|
||||
"%s", path);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "brick%d.peerid", brick_index);
|
||||
ret = dict_get_str (dict, key, &uuid);
|
||||
if (ret)
|
||||
@ -288,7 +286,6 @@ cli_xml_output_vol_status_common (xmlTextWriterPtr writer, dict_t *dict,
|
||||
"%s", uuid);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "brick%d.status", brick_index);
|
||||
ret = dict_get_int32 (dict, key, &status);
|
||||
if (ret)
|
||||
@ -298,13 +295,11 @@ cli_xml_output_vol_status_common (xmlTextWriterPtr writer, dict_t *dict,
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
*online = status;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "brick%d.port", brick_index);
|
||||
ret = dict_get_int32 (dict, key, &port);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "brick%d.rdma_port", brick_index);
|
||||
ret = dict_get_int32 (dict, key, &rdma_port);
|
||||
|
||||
@ -364,7 +359,6 @@ cli_xml_output_vol_status_common (xmlTextWriterPtr writer, dict_t *dict,
|
||||
ret = xmlTextWriterEndElement (writer);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "brick%d.pid", brick_index);
|
||||
ret = dict_get_int32 (dict, key, &pid);
|
||||
if (ret)
|
||||
@ -402,7 +396,6 @@ cli_xml_output_vol_status_detail (xmlTextWriterPtr writer, dict_t *dict,
|
||||
"%"PRIu64, size_total);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
}
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "brick%d.free", brick_index);
|
||||
ret = dict_get_uint64 (dict, key, &size_free);
|
||||
if (!ret) {
|
||||
@ -411,7 +404,6 @@ cli_xml_output_vol_status_detail (xmlTextWriterPtr writer, dict_t *dict,
|
||||
"%"PRIu64, size_free);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
}
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "brick%d.device", brick_index);
|
||||
ret = dict_get_str (dict, key, &device);
|
||||
if (!ret) {
|
||||
@ -420,7 +412,6 @@ cli_xml_output_vol_status_detail (xmlTextWriterPtr writer, dict_t *dict,
|
||||
"%s", device);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
}
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "brick%d.block_size", brick_index);
|
||||
ret = dict_get_uint64 (dict, key, &block_size);
|
||||
if (!ret) {
|
||||
@ -429,7 +420,6 @@ cli_xml_output_vol_status_detail (xmlTextWriterPtr writer, dict_t *dict,
|
||||
"%"PRIu64, block_size);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
}
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "brick%d.mnt_options", brick_index);
|
||||
ret = dict_get_str (dict, key, &mnt_options);
|
||||
if (!ret) {
|
||||
@ -438,7 +428,6 @@ cli_xml_output_vol_status_detail (xmlTextWriterPtr writer, dict_t *dict,
|
||||
"%s", mnt_options);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
}
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "brick%d.fs_name", brick_index);
|
||||
ret = dict_get_str (dict, key, &fs_name);
|
||||
if (!ret) {
|
||||
@ -447,7 +436,6 @@ cli_xml_output_vol_status_detail (xmlTextWriterPtr writer, dict_t *dict,
|
||||
"%s", fs_name);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
}
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "brick%d.inode_size", brick_index);
|
||||
ret = dict_get_str (dict, key, &inode_size);
|
||||
if (!ret) {
|
||||
@ -456,7 +444,6 @@ cli_xml_output_vol_status_detail (xmlTextWriterPtr writer, dict_t *dict,
|
||||
"%s", fs_name);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
}
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "brick%d.total_inodes", brick_index);
|
||||
ret = dict_get_uint64 (dict, key, &inodes_total);
|
||||
if (!ret) {
|
||||
@ -465,7 +452,6 @@ cli_xml_output_vol_status_detail (xmlTextWriterPtr writer, dict_t *dict,
|
||||
"%"PRIu64, inodes_total);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
}
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "brick%d.free_inodes", brick_index);
|
||||
ret = dict_get_uint64 (dict, key, &inodes_free);
|
||||
if (!ret) {
|
||||
@ -514,7 +500,6 @@ cli_xml_output_vol_status_mempool (xmlTextWriterPtr writer, dict_t *dict,
|
||||
ret = xmlTextWriterStartElement (writer, (xmlChar *)"pool");
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.pool%d.name", prefix, i);
|
||||
ret = dict_get_str (dict, key, &name);
|
||||
if (ret)
|
||||
@ -524,7 +509,6 @@ cli_xml_output_vol_status_mempool (xmlTextWriterPtr writer, dict_t *dict,
|
||||
"%s", name);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.pool%d.hotcount", prefix, i);
|
||||
ret = dict_get_int32 (dict, key, &hotcount);
|
||||
if (ret)
|
||||
@ -534,7 +518,6 @@ cli_xml_output_vol_status_mempool (xmlTextWriterPtr writer, dict_t *dict,
|
||||
"%d", hotcount);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.pool%d.coldcount", prefix, i);
|
||||
ret = dict_get_int32 (dict, key, &coldcount);
|
||||
if (ret)
|
||||
@ -544,7 +527,6 @@ cli_xml_output_vol_status_mempool (xmlTextWriterPtr writer, dict_t *dict,
|
||||
"%d", coldcount);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.pool%d.paddedsizeof",
|
||||
prefix, i);
|
||||
ret = dict_get_uint64 (dict, key, &paddedsizeof);
|
||||
@ -555,7 +537,6 @@ cli_xml_output_vol_status_mempool (xmlTextWriterPtr writer, dict_t *dict,
|
||||
paddedsizeof);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.pool%d.alloccount", prefix, i);
|
||||
ret = dict_get_uint64 (dict, key, &alloccount);
|
||||
if (ret)
|
||||
@ -565,7 +546,6 @@ cli_xml_output_vol_status_mempool (xmlTextWriterPtr writer, dict_t *dict,
|
||||
"%"PRIu64, alloccount);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.pool%d.max_alloc", prefix, i);
|
||||
ret = dict_get_int32 (dict, key, &maxalloc);
|
||||
if (ret)
|
||||
@ -575,7 +555,6 @@ cli_xml_output_vol_status_mempool (xmlTextWriterPtr writer, dict_t *dict,
|
||||
"%d", maxalloc);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.pool%d.pool-misses", prefix, i);
|
||||
ret = dict_get_uint64 (dict, key, &alloccount);
|
||||
if (ret)
|
||||
@ -585,7 +564,6 @@ cli_xml_output_vol_status_mempool (xmlTextWriterPtr writer, dict_t *dict,
|
||||
"%"PRIu64, alloccount);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.pool%d.max-stdalloc", prefix, i);
|
||||
ret = dict_get_int32 (dict, key, &maxalloc);
|
||||
if (ret)
|
||||
@ -643,7 +621,6 @@ cli_xml_output_vol_status_mem (xmlTextWriterPtr writer, dict_t *dict,
|
||||
"%d", arena);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "brick%d.mallinfo.ordblks", brick_index);
|
||||
ret = dict_get_int32 (dict, key, &ordblks);
|
||||
if (ret)
|
||||
@ -652,7 +629,6 @@ cli_xml_output_vol_status_mem (xmlTextWriterPtr writer, dict_t *dict,
|
||||
"%d", ordblks);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "brick%d.mallinfo.smblks", brick_index);
|
||||
ret = dict_get_int32 (dict, key, &smblks);
|
||||
if (ret)
|
||||
@ -661,7 +637,6 @@ cli_xml_output_vol_status_mem (xmlTextWriterPtr writer, dict_t *dict,
|
||||
"%d", smblks);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "brick%d.mallinfo.hblks", brick_index);
|
||||
ret = dict_get_int32 (dict, key, &hblks);
|
||||
if (ret)
|
||||
@ -670,7 +645,6 @@ cli_xml_output_vol_status_mem (xmlTextWriterPtr writer, dict_t *dict,
|
||||
"%d", hblks);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "brick%d.mallinfo.hblkhd", brick_index);
|
||||
ret = dict_get_int32 (dict, key, &hblkhd);
|
||||
if (ret)
|
||||
@ -679,7 +653,6 @@ cli_xml_output_vol_status_mem (xmlTextWriterPtr writer, dict_t *dict,
|
||||
"%d", hblkhd);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "brick%d.mallinfo.usmblks", brick_index);
|
||||
ret = dict_get_int32 (dict, key, &usmblks);
|
||||
if (ret)
|
||||
@ -688,7 +661,6 @@ cli_xml_output_vol_status_mem (xmlTextWriterPtr writer, dict_t *dict,
|
||||
"%d", usmblks);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "brick%d.mallinfo.fsmblks", brick_index);
|
||||
ret = dict_get_int32 (dict, key, &fsmblks);
|
||||
if (ret)
|
||||
@ -697,7 +669,6 @@ cli_xml_output_vol_status_mem (xmlTextWriterPtr writer, dict_t *dict,
|
||||
"%d", fsmblks);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "brick%d.mallinfo.uordblks", brick_index);
|
||||
ret = dict_get_int32 (dict, key, &uordblks);
|
||||
if (ret)
|
||||
@ -706,7 +677,6 @@ cli_xml_output_vol_status_mem (xmlTextWriterPtr writer, dict_t *dict,
|
||||
"%d", uordblks);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "brick%d.mallinfo.fordblks", brick_index);
|
||||
ret = dict_get_int32 (dict, key, &fordblks);
|
||||
if (ret)
|
||||
@ -715,7 +685,6 @@ cli_xml_output_vol_status_mem (xmlTextWriterPtr writer, dict_t *dict,
|
||||
"%d", fordblks);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "brick%d.mallinfo.keepcost", brick_index);
|
||||
ret = dict_get_int32 (dict, key, &keepcost);
|
||||
if (ret)
|
||||
@ -728,7 +697,6 @@ cli_xml_output_vol_status_mem (xmlTextWriterPtr writer, dict_t *dict,
|
||||
ret = xmlTextWriterEndElement (writer);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "brick%d", brick_index);
|
||||
ret = cli_xml_output_vol_status_mempool (writer, dict, key);
|
||||
if (ret)
|
||||
@ -774,7 +742,6 @@ cli_xml_output_vol_status_clients (xmlTextWriterPtr writer, dict_t *dict,
|
||||
ret = xmlTextWriterStartElement (writer, (xmlChar *)"client");
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "brick%d.client%d.hostname",
|
||||
brick_index, i);
|
||||
ret = dict_get_str (dict, key, &hostname);
|
||||
@ -785,7 +752,6 @@ cli_xml_output_vol_status_clients (xmlTextWriterPtr writer, dict_t *dict,
|
||||
"%s", hostname);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "brick%d.client%d.bytesread",
|
||||
brick_index, i);
|
||||
ret = dict_get_uint64 (dict, key, &bytes_read);
|
||||
@ -796,7 +762,6 @@ cli_xml_output_vol_status_clients (xmlTextWriterPtr writer, dict_t *dict,
|
||||
"%"PRIu64, bytes_read);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "brick%d.client%d.byteswrite",
|
||||
brick_index, i);
|
||||
ret = dict_get_uint64 (dict, key, &bytes_write);
|
||||
@ -807,7 +772,6 @@ cli_xml_output_vol_status_clients (xmlTextWriterPtr writer, dict_t *dict,
|
||||
"%"PRIu64, bytes_write);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "brick%d.client%d.opversion",
|
||||
brick_index, i);
|
||||
ret = dict_get_uint32 (dict, key, &opversion);
|
||||
@ -854,7 +818,6 @@ cli_xml_output_vol_status_inode_entry (xmlTextWriterPtr writer, dict_t *dict,
|
||||
"%s", gfid);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key,0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.nlookup", prefix);
|
||||
ret = dict_get_uint64 (dict, key, &nlookup);
|
||||
if (ret)
|
||||
@ -863,7 +826,6 @@ cli_xml_output_vol_status_inode_entry (xmlTextWriterPtr writer, dict_t *dict,
|
||||
"%"PRIu64, nlookup);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key,0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.ref", prefix);
|
||||
ret = dict_get_uint32 (dict, key, &ref);
|
||||
if (ret)
|
||||
@ -872,7 +834,6 @@ cli_xml_output_vol_status_inode_entry (xmlTextWriterPtr writer, dict_t *dict,
|
||||
"%"PRIu32, ref);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key,0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.ia_type", prefix);
|
||||
ret = dict_get_int32 (dict, key, &ia_type);
|
||||
if (ret)
|
||||
@ -914,7 +875,6 @@ cli_xml_output_vol_status_itable (xmlTextWriterPtr writer, dict_t *dict,
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
for (i = 0; i < active_size; i++) {
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.active%d", prefix, i);
|
||||
ret = cli_xml_output_vol_status_inode_entry
|
||||
(writer, dict, key);
|
||||
@ -926,7 +886,6 @@ cli_xml_output_vol_status_itable (xmlTextWriterPtr writer, dict_t *dict,
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
}
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.lru_size", prefix);
|
||||
ret = dict_get_uint32 (dict, key, &lru_size);
|
||||
if (ret)
|
||||
@ -940,7 +899,6 @@ cli_xml_output_vol_status_itable (xmlTextWriterPtr writer, dict_t *dict,
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
for (i = 0; i < lru_size; i++) {
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.lru%d", prefix, i);
|
||||
ret = cli_xml_output_vol_status_inode_entry
|
||||
(writer, dict, key);
|
||||
@ -952,7 +910,6 @@ cli_xml_output_vol_status_itable (xmlTextWriterPtr writer, dict_t *dict,
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
}
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.purge_size", prefix);
|
||||
ret = dict_get_uint32 (dict, key, &purge_size);
|
||||
if (ret)
|
||||
@ -966,7 +923,6 @@ cli_xml_output_vol_status_itable (xmlTextWriterPtr writer, dict_t *dict,
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
for (i = 0; i < purge_size; i++) {
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.purge%d", prefix, i);
|
||||
ret = cli_xml_output_vol_status_inode_entry
|
||||
(writer, dict, key);
|
||||
@ -1010,7 +966,6 @@ cli_xml_output_vol_status_inode (xmlTextWriterPtr writer, dict_t *dict,
|
||||
(xmlChar *)"connection");
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "brick%d.conn%d.itable",
|
||||
brick_index, i);
|
||||
ret = cli_xml_output_vol_status_itable (writer, dict, key);
|
||||
@ -1058,7 +1013,6 @@ cli_xml_output_vol_status_fdtable (xmlTextWriterPtr writer, dict_t *dict,
|
||||
"%d", refcount);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.maxfds", prefix);
|
||||
ret = dict_get_uint32 (dict, key, &maxfds);
|
||||
if (ret)
|
||||
@ -1067,7 +1021,6 @@ cli_xml_output_vol_status_fdtable (xmlTextWriterPtr writer, dict_t *dict,
|
||||
"%"PRIu32, maxfds);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.firstfree", prefix);
|
||||
ret = dict_get_int32 (dict, key, &firstfree);
|
||||
if (ret)
|
||||
@ -1076,7 +1029,6 @@ cli_xml_output_vol_status_fdtable (xmlTextWriterPtr writer, dict_t *dict,
|
||||
"%d", firstfree);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.openfds", prefix);
|
||||
ret = dict_get_int32 (dict, key, &openfds);
|
||||
if (ret)
|
||||
@ -1086,20 +1038,17 @@ cli_xml_output_vol_status_fdtable (xmlTextWriterPtr writer, dict_t *dict,
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
for (i = 0; i < maxfds; i++) {
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.fdentry%d.pid", prefix, i);
|
||||
ret = dict_get_int32 (dict, key, &fd_pid);
|
||||
if (ret)
|
||||
continue;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.fdentry%d.refcount",
|
||||
prefix, i);
|
||||
ret = dict_get_int32 (dict, key, &fd_refcount);
|
||||
if (ret)
|
||||
continue;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.fdentry%d.flags", prefix, i);
|
||||
ret = dict_get_int32 (dict, key, &fd_flags);
|
||||
if (ret)
|
||||
@ -1170,7 +1119,6 @@ cli_xml_output_vol_status_fd (xmlTextWriterPtr writer, dict_t *dict,
|
||||
(xmlChar *)"connection");
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "brick%d.conn%d.fdtable",
|
||||
brick_index, i);
|
||||
ret = cli_xml_output_vol_status_fdtable (writer, dict, key);
|
||||
@ -1218,7 +1166,6 @@ cli_xml_output_vol_status_callframe (xmlTextWriterPtr writer, dict_t *dict,
|
||||
"%d", ref_count);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.translator", prefix);
|
||||
ret = dict_get_str (dict, key, &translator);
|
||||
if (ret)
|
||||
@ -1227,7 +1174,6 @@ cli_xml_output_vol_status_callframe (xmlTextWriterPtr writer, dict_t *dict,
|
||||
"%s", translator);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.complete", prefix);
|
||||
ret = dict_get_int32 (dict, key, &complete);
|
||||
if (ret)
|
||||
@ -1236,7 +1182,6 @@ cli_xml_output_vol_status_callframe (xmlTextWriterPtr writer, dict_t *dict,
|
||||
"%d", complete);
|
||||
XML_RET_CHECK_AND_GOTO (ret ,out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.parent", prefix);
|
||||
ret = dict_get_str (dict, key, &parent);
|
||||
if (!ret) {
|
||||
@ -1246,7 +1191,6 @@ cli_xml_output_vol_status_callframe (xmlTextWriterPtr writer, dict_t *dict,
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
}
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.windfrom", prefix);
|
||||
ret = dict_get_str (dict, key, &wind_from);
|
||||
if (!ret) {
|
||||
@ -1256,7 +1200,6 @@ cli_xml_output_vol_status_callframe (xmlTextWriterPtr writer, dict_t *dict,
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
}
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.windto", prefix);
|
||||
ret = dict_get_str (dict, key, &wind_to);
|
||||
if (!ret) {
|
||||
@ -1266,7 +1209,6 @@ cli_xml_output_vol_status_callframe (xmlTextWriterPtr writer, dict_t *dict,
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
}
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.unwindfrom", prefix);
|
||||
ret = dict_get_str (dict, key, &unwind_from);
|
||||
if (!ret) {
|
||||
@ -1276,7 +1218,6 @@ cli_xml_output_vol_status_callframe (xmlTextWriterPtr writer, dict_t *dict,
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
}
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.unwindto", prefix);
|
||||
ret = dict_get_str (dict, key, &unwind_to);
|
||||
if (!ret) {
|
||||
@ -1319,7 +1260,6 @@ cli_xml_output_vol_status_callstack (xmlTextWriterPtr writer, dict_t *dict,
|
||||
"%d", uid);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.gid", prefix);
|
||||
ret = dict_get_int32 (dict, key, &gid);
|
||||
if (ret)
|
||||
@ -1328,7 +1268,6 @@ cli_xml_output_vol_status_callstack (xmlTextWriterPtr writer, dict_t *dict,
|
||||
"%d", gid);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.pid", prefix);
|
||||
ret = dict_get_int32 (dict, key, &pid);
|
||||
if (ret)
|
||||
@ -1337,7 +1276,6 @@ cli_xml_output_vol_status_callstack (xmlTextWriterPtr writer, dict_t *dict,
|
||||
"%d", pid);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.unique", prefix);
|
||||
ret = dict_get_uint64 (dict, key, &unique);
|
||||
if (ret)
|
||||
@ -1346,7 +1284,6 @@ cli_xml_output_vol_status_callstack (xmlTextWriterPtr writer, dict_t *dict,
|
||||
"%"PRIu64, unique);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.count", prefix);
|
||||
ret = dict_get_int32 (dict, key, &frame_count);
|
||||
if (ret)
|
||||
@ -1356,7 +1293,6 @@ cli_xml_output_vol_status_callstack (xmlTextWriterPtr writer, dict_t *dict,
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
for (i = 0; i < frame_count; i++) {
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.frame%d", prefix, i);
|
||||
ret = cli_xml_output_vol_status_callframe (writer, dict,
|
||||
key);
|
||||
@ -1394,7 +1330,6 @@ cli_xml_output_vol_status_callpool (xmlTextWriterPtr writer, dict_t *dict,
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
for (i = 0; i < call_count; i++) {
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "brick%d.callpool.stack%d",
|
||||
brick_index, i);
|
||||
ret = cli_xml_output_vol_status_callstack (writer, dict,
|
||||
@ -1488,7 +1423,6 @@ cli_xml_output_remove_brick_task_params (xmlTextWriterPtr writer, dict_t *dict,
|
||||
goto out;
|
||||
|
||||
for (i = 1; i <= count; i++) {
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.brick%d", prefix, i);
|
||||
ret = dict_get_str (dict, key, &brick);
|
||||
if (ret)
|
||||
@ -1532,7 +1466,6 @@ cli_xml_output_vol_status_tasks (cli_local_t *local, dict_t *dict) {
|
||||
(xmlChar *)"task");
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "task%d.type", i);
|
||||
ret = dict_get_str (dict, key, &task_type);
|
||||
if (ret)
|
||||
@ -1542,7 +1475,6 @@ cli_xml_output_vol_status_tasks (cli_local_t *local, dict_t *dict) {
|
||||
"%s", task_type);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "task%d.id", i);
|
||||
ret = dict_get_str (dict, key, &task_id_str);
|
||||
if (ret)
|
||||
@ -1552,7 +1484,6 @@ cli_xml_output_vol_status_tasks (cli_local_t *local, dict_t *dict) {
|
||||
"%s", task_id_str);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "task%d.status", i);
|
||||
ret = dict_get_int32 (dict, key, &status);
|
||||
if (ret)
|
||||
@ -1569,7 +1500,6 @@ cli_xml_output_vol_status_tasks (cli_local_t *local, dict_t *dict) {
|
||||
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "task%d", i);
|
||||
if (!strcmp (task_type, "Remove brick")) {
|
||||
ret = cli_xml_output_remove_brick_task_params
|
||||
@ -1830,7 +1760,6 @@ cli_xml_output_vol_top_rw_perf (xmlTextWriterPtr writer, dict_t *dict,
|
||||
"%s", filename);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%d-value-%d", brick_index, member_index);
|
||||
ret = dict_get_uint64 (dict, key, &throughput);
|
||||
if (ret)
|
||||
@ -1839,14 +1768,12 @@ cli_xml_output_vol_top_rw_perf (xmlTextWriterPtr writer, dict_t *dict,
|
||||
"%"PRIu64, throughput);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%d-time-sec-%d", brick_index,
|
||||
member_index);
|
||||
ret = dict_get_int32 (dict, key, (int32_t *)&time_sec);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%d-time-usec-%d", brick_index,
|
||||
member_index);
|
||||
ret = dict_get_int32 (dict, key, (int32_t *)&time_usec);
|
||||
@ -1892,7 +1819,6 @@ cli_xml_output_vol_top_other (xmlTextWriterPtr writer, dict_t *dict,
|
||||
"%s", filename);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%d-value-%d", brick_index, member_index);
|
||||
ret = dict_get_uint64 (dict, key, &count);
|
||||
if (ret)
|
||||
@ -1965,7 +1891,6 @@ cli_xml_output_vol_top (dict_t *dict, int op_ret, int op_errno,
|
||||
ret = xmlTextWriterStartElement (writer, (xmlChar *)"brick");
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%d-brick", i);
|
||||
ret = dict_get_str (dict, key, &brick_name);
|
||||
if (ret)
|
||||
@ -1975,7 +1900,6 @@ cli_xml_output_vol_top (dict_t *dict, int op_ret, int op_errno,
|
||||
"%s", brick_name);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key , sizeof (key), "%d-members", i);
|
||||
ret = dict_get_int32 (dict, key, &members);
|
||||
if (ret)
|
||||
@ -1987,7 +1911,6 @@ cli_xml_output_vol_top (dict_t *dict, int op_ret, int op_errno,
|
||||
|
||||
switch (top_op) {
|
||||
case GF_CLI_TOP_OPEN:
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%d-current-open", i);
|
||||
ret = dict_get_uint64 (dict, key, ¤t_open);
|
||||
if (ret)
|
||||
@ -1997,7 +1920,6 @@ cli_xml_output_vol_top (dict_t *dict, int op_ret, int op_errno,
|
||||
current_open);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%d-max-open", i);
|
||||
ret = dict_get_uint64 (dict, key, &max_open);
|
||||
if (ret)
|
||||
@ -2007,7 +1929,6 @@ cli_xml_output_vol_top (dict_t *dict, int op_ret, int op_errno,
|
||||
max_open);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%d-max-openfd-time", i);
|
||||
ret = dict_get_str (dict, key, &max_open_time);
|
||||
if (ret)
|
||||
@ -2026,11 +1947,9 @@ cli_xml_output_vol_top (dict_t *dict, int op_ret, int op_errno,
|
||||
|
||||
case GF_CLI_TOP_READ_PERF:
|
||||
case GF_CLI_TOP_WRITE_PERF:
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%d-throughput", i);
|
||||
ret = dict_get_double (dict, key, &throughput);
|
||||
if (!ret) {
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%d-time", i);
|
||||
ret = dict_get_double (dict, key, &time_taken);
|
||||
}
|
||||
@ -2126,7 +2045,6 @@ cli_xml_output_vol_profile_stats (xmlTextWriterPtr writer, dict_t *dict,
|
||||
(writer, (xmlChar *)"size", "%"PRIu32, (1 << i));
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%d-%d-read-%d", brick_index,
|
||||
interval, (1 << i));
|
||||
ret = dict_get_uint64 (dict, key, &read_count);
|
||||
@ -2136,7 +2054,6 @@ cli_xml_output_vol_profile_stats (xmlTextWriterPtr writer, dict_t *dict,
|
||||
(writer, (xmlChar *)"reads", "%"PRIu64, read_count);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%d-%d-write-%d", brick_index,
|
||||
interval, (1 << i));
|
||||
ret = dict_get_uint64 (dict, key, &write_count);
|
||||
@ -2160,28 +2077,24 @@ cli_xml_output_vol_profile_stats (xmlTextWriterPtr writer, dict_t *dict,
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
for (i = 0; i < GF_FOP_MAXVALUE; i++) {
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%d-%d-%d-hits", brick_index,
|
||||
interval, i);
|
||||
ret = dict_get_uint64 (dict, key, &hits);
|
||||
if (ret)
|
||||
goto cont;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%d-%d-%d-avglatency", brick_index,
|
||||
interval, i);
|
||||
ret = dict_get_double (dict, key, &avg_latency);
|
||||
if (ret)
|
||||
goto cont;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%d-%d-%d-minlatency", brick_index,
|
||||
interval, i);
|
||||
ret = dict_get_double (dict, key, &min_latency);
|
||||
if (ret)
|
||||
goto cont;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%d-%d-%d-maxlatency", brick_index,
|
||||
interval, i);
|
||||
ret = dict_get_double (dict, key, &max_latency);
|
||||
@ -2229,7 +2142,6 @@ cont:
|
||||
min_latency = 0.0;
|
||||
max_latency = 0.0;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%d-%d-%d-upcall-hits", brick_index,
|
||||
interval, i);
|
||||
ret = dict_get_uint64 (dict, key, &hits);
|
||||
@ -2269,7 +2181,6 @@ cont:
|
||||
ret = xmlTextWriterEndElement (writer);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%d-%d-duration", brick_index, interval);
|
||||
ret = dict_get_uint64 (dict, key, &duration);
|
||||
if (ret)
|
||||
@ -2278,7 +2189,6 @@ cont:
|
||||
"%"PRIu64, duration);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%d-%d-total-read", brick_index, interval);
|
||||
ret = dict_get_uint64 (dict, key, &total_read);
|
||||
if (ret)
|
||||
@ -2287,7 +2197,6 @@ cont:
|
||||
"%"PRIu64, total_read);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%d-%d-total-write", brick_index, interval);
|
||||
ret = dict_get_uint64 (dict, key, &total_write);
|
||||
if (ret)
|
||||
@ -2400,7 +2309,6 @@ cli_xml_output_vol_profile (dict_t *dict, int op_ret, int op_errno,
|
||||
goto out;
|
||||
}
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%d-interval", i);
|
||||
ret = dict_get_int32 (dict, key, &interval);
|
||||
if (ret == 0) {
|
||||
@ -2463,7 +2371,6 @@ cli_xml_output_vol_list (dict_t *dict, int op_ret, int op_errno,
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "volume%d", i);
|
||||
ret = dict_get_str (dict, key, &volname);
|
||||
if (ret)
|
||||
@ -2656,7 +2563,6 @@ cli_xml_output_vol_info (cli_local_t *local, dict_t *dict)
|
||||
(xmlChar *)"volume");
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "volume%d.name", i);
|
||||
ret = dict_get_str (dict, key, &volname);
|
||||
if (ret)
|
||||
@ -2666,7 +2572,6 @@ cli_xml_output_vol_info (cli_local_t *local, dict_t *dict)
|
||||
"%s", volname);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "volume%d.volume_id", i);
|
||||
ret = dict_get_str (dict, key, &volume_id);
|
||||
if (ret)
|
||||
@ -2676,7 +2581,6 @@ cli_xml_output_vol_info (cli_local_t *local, dict_t *dict)
|
||||
"%s", volume_id);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "volume%d.status", i);
|
||||
ret = dict_get_int32 (dict, key, &status);
|
||||
if (ret)
|
||||
@ -2691,7 +2595,6 @@ cli_xml_output_vol_info (cli_local_t *local, dict_t *dict)
|
||||
cli_vol_status_str[status]);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "volume%d.snap_count", i);
|
||||
ret = dict_get_int32 (dict, key, &snap_count);
|
||||
if (ret)
|
||||
@ -2702,7 +2605,6 @@ cli_xml_output_vol_info (cli_local_t *local, dict_t *dict)
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "volume%d.brick_count", i);
|
||||
ret = dict_get_int32 (dict, key, &brick_count);
|
||||
if (ret)
|
||||
@ -2712,7 +2614,6 @@ cli_xml_output_vol_info (cli_local_t *local, dict_t *dict)
|
||||
"%d", brick_count);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "volume%d.dist_count", i);
|
||||
ret = dict_get_int32 (dict, key, &dist_count);
|
||||
if (ret)
|
||||
@ -2722,7 +2623,6 @@ cli_xml_output_vol_info (cli_local_t *local, dict_t *dict)
|
||||
"%d", dist_count);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "volume%d.stripe_count", i);
|
||||
ret = dict_get_int32 (dict, key, &stripe_count);
|
||||
if (ret)
|
||||
@ -2732,7 +2632,6 @@ cli_xml_output_vol_info (cli_local_t *local, dict_t *dict)
|
||||
"%d", stripe_count);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "volume%d.replica_count", i);
|
||||
ret = dict_get_int32 (dict, key, &replica_count);
|
||||
if (ret)
|
||||
@ -2742,7 +2641,6 @@ cli_xml_output_vol_info (cli_local_t *local, dict_t *dict)
|
||||
"%d", replica_count);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "volume%d.arbiter_count", i);
|
||||
ret = dict_get_int32 (dict, key, &arbiter_count);
|
||||
if (ret)
|
||||
@ -2752,7 +2650,6 @@ cli_xml_output_vol_info (cli_local_t *local, dict_t *dict)
|
||||
"%d", arbiter_count);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "volume%d.disperse_count", i);
|
||||
ret = dict_get_int32 (dict, key, &disperse_count);
|
||||
if (ret)
|
||||
@ -2762,7 +2659,6 @@ cli_xml_output_vol_info (cli_local_t *local, dict_t *dict)
|
||||
"%d", disperse_count);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "volume%d.redundancy_count", i);
|
||||
ret = dict_get_int32 (dict, key, &redundancy_count);
|
||||
if (ret)
|
||||
@ -2772,7 +2668,6 @@ cli_xml_output_vol_info (cli_local_t *local, dict_t *dict)
|
||||
"%d", redundancy_count);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "volume%d.type", i);
|
||||
ret = dict_get_int32 (dict, key, &type);
|
||||
if (ret)
|
||||
@ -2793,7 +2688,6 @@ cli_xml_output_vol_info (cli_local_t *local, dict_t *dict)
|
||||
vol_type_str[type]);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "volume%d.transport", i);
|
||||
ret = dict_get_int32 (dict, key, &transport);
|
||||
if (ret)
|
||||
@ -2810,7 +2704,6 @@ cli_xml_output_vol_info (cli_local_t *local, dict_t *dict)
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
for (k = 0; ; k++) {
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key),"volume%d.xlator%d", i, k);
|
||||
ret = dict_get_str (dict, key, &caps);
|
||||
if (ret)
|
||||
@ -2833,7 +2726,6 @@ cli_xml_output_vol_info (cli_local_t *local, dict_t *dict)
|
||||
|
||||
j = 0;
|
||||
for (j = 0; ;j++) {
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key),
|
||||
"volume%d.xlator%d.caps%d", i, k, j);
|
||||
ret = dict_get_str (dict, key, &caps);
|
||||
@ -2868,7 +2760,6 @@ cli_xml_output_vol_info (cli_local_t *local, dict_t *dict)
|
||||
* always */
|
||||
for (c = COLD_BRICK_COUNT; c < MAX; c++) {
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, 256, keys[c], i);
|
||||
ret = dict_get_int32 (dict, key, &value[c]);
|
||||
if (ret)
|
||||
@ -2940,7 +2831,6 @@ cli_xml_output_vol_info (cli_local_t *local, dict_t *dict)
|
||||
(local->writer, (xmlChar *)"brick");
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key),
|
||||
"volume%d.brick%d.uuid", i, index);
|
||||
ret = dict_get_str (dict, key, &uuid);
|
||||
@ -3051,7 +2941,6 @@ cli_xml_output_vol_info (cli_local_t *local, dict_t *dict)
|
||||
(local->writer, (xmlChar *)"brick");
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key),
|
||||
"volume%d.brick%d.uuid", i, index);
|
||||
ret = dict_get_str (dict, key, &uuid);
|
||||
@ -3076,7 +2965,6 @@ cli_xml_output_vol_info (cli_local_t *local, dict_t *dict)
|
||||
"%s", uuid);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key),
|
||||
"volume%d.brick%d.isArbiter", i,
|
||||
index);
|
||||
@ -3103,7 +2991,6 @@ cli_xml_output_vol_info (cli_local_t *local, dict_t *dict)
|
||||
(local->writer, (xmlChar *)"brick");
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key),
|
||||
"volume%d.brick%d.uuid", i, j);
|
||||
ret = dict_get_str (dict, key, &uuid);
|
||||
@ -3114,7 +3001,6 @@ cli_xml_output_vol_info (cli_local_t *local, dict_t *dict)
|
||||
uuid);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key),
|
||||
"volume%d.brick%d", i, j);
|
||||
ret = dict_get_str (dict, key, &brick);
|
||||
@ -3134,7 +3020,6 @@ cli_xml_output_vol_info (cli_local_t *local, dict_t *dict)
|
||||
"%s", uuid);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key),
|
||||
"volume%d.brick%d.isArbiter", i, j);
|
||||
if (dict_get (dict, key))
|
||||
@ -3157,7 +3042,6 @@ cli_xml_output_vol_info (cli_local_t *local, dict_t *dict)
|
||||
ret = xmlTextWriterEndElement (local->writer);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "volume%d", i);
|
||||
ret = cli_xml_output_vol_info_options (local->writer, dict,
|
||||
key);
|
||||
@ -3311,7 +3195,6 @@ cli_xml_output_peer_hostnames (xmlTextWriterPtr writer, dict_t *dict,
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.hostname%d", prefix, i);
|
||||
ret = dict_get_str (dict, key, &hostname);
|
||||
if (ret)
|
||||
@ -3373,7 +3256,6 @@ cli_xml_output_peer_status (dict_t *dict, int op_ret, int op_errno,
|
||||
ret = xmlTextWriterStartElement (writer, (xmlChar *)"peer");
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "friend%d.uuid", i);
|
||||
ret = dict_get_str (dict, key, &uuid);
|
||||
if (ret)
|
||||
@ -3384,7 +3266,6 @@ cli_xml_output_peer_status (dict_t *dict, int op_ret, int op_errno,
|
||||
"%s", uuid);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "friend%d.hostname", i);
|
||||
ret = dict_get_str (dict, key, &hostname);
|
||||
if (ret)
|
||||
@ -3395,18 +3276,15 @@ cli_xml_output_peer_status (dict_t *dict, int op_ret, int op_errno,
|
||||
"%s", hostname);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "friend%d.hostname_count", i);
|
||||
ret = dict_get_int32 (dict, key, &hostname_count);
|
||||
if ((ret == 0) && (hostname_count > 0)) {
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "friend%d", i);
|
||||
ret = cli_xml_output_peer_hostnames (writer, dict, key,
|
||||
hostname_count);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
}
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "friend%d.connected", i);
|
||||
ret = dict_get_int32 (dict, key, &connected);
|
||||
if (ret)
|
||||
@ -3417,7 +3295,6 @@ cli_xml_output_peer_status (dict_t *dict, int op_ret, int op_errno,
|
||||
"%d", connected);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "friend%d.stateId", i);
|
||||
ret = dict_get_int32 (dict, key, &state_id);
|
||||
if (!ret) {
|
||||
@ -3428,7 +3305,6 @@ cli_xml_output_peer_status (dict_t *dict, int op_ret, int op_errno,
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
}
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "friend%d.state", i);
|
||||
ret = dict_get_str (dict, key, &state_str);
|
||||
if (!ret) {
|
||||
@ -3505,7 +3381,6 @@ cli_xml_output_vol_rebalance_status (xmlTextWriterPtr writer, dict_t *dict,
|
||||
/* Getting status early, to skip nodes that don't have the
|
||||
* rebalance process started
|
||||
*/
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "status-%d", i);
|
||||
ret = dict_get_int32 (dict, key, &status_rcd);
|
||||
|
||||
@ -3520,7 +3395,6 @@ cli_xml_output_vol_rebalance_status (xmlTextWriterPtr writer, dict_t *dict,
|
||||
ret = xmlTextWriterStartElement (writer, (xmlChar *)"node");
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "node-name-%d", i);
|
||||
ret = dict_get_str (dict, key, &node_name);
|
||||
if (ret)
|
||||
@ -3530,7 +3404,6 @@ cli_xml_output_vol_rebalance_status (xmlTextWriterPtr writer, dict_t *dict,
|
||||
"%s", node_name);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "node-uuid-%d", i);
|
||||
ret = dict_get_str (dict, key, &node_uuid);
|
||||
if (ret)
|
||||
@ -3540,7 +3413,6 @@ cli_xml_output_vol_rebalance_status (xmlTextWriterPtr writer, dict_t *dict,
|
||||
"%s", node_uuid);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "files-%d", i);
|
||||
ret = dict_get_uint64 (dict, key, &files);
|
||||
if (ret)
|
||||
@ -3551,7 +3423,6 @@ cli_xml_output_vol_rebalance_status (xmlTextWriterPtr writer, dict_t *dict,
|
||||
"%"PRIu64, files);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "size-%d", i);
|
||||
ret = dict_get_uint64 (dict, key, &size);
|
||||
if (ret)
|
||||
@ -3562,7 +3433,6 @@ cli_xml_output_vol_rebalance_status (xmlTextWriterPtr writer, dict_t *dict,
|
||||
"%"PRIu64,size);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "lookups-%d", i);
|
||||
ret = dict_get_uint64 (dict, key, &lookups);
|
||||
if (ret)
|
||||
@ -3573,13 +3443,11 @@ cli_xml_output_vol_rebalance_status (xmlTextWriterPtr writer, dict_t *dict,
|
||||
"%"PRIu64, lookups);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "failures-%d", i);
|
||||
ret = dict_get_uint64 (dict, key, &failures);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "skipped-%d", i);
|
||||
|
||||
ret = dict_get_uint64 (dict, key, &skipped);
|
||||
@ -3615,8 +3483,7 @@ cli_xml_output_vol_rebalance_status (xmlTextWriterPtr writer, dict_t *dict,
|
||||
cli_vol_task_status_str[status_rcd]);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, 256);
|
||||
snprintf (key, 256, "run-time-%d", i);
|
||||
snprintf (key, sizeof (key), "run-time-%d", i);
|
||||
ret = dict_get_double (dict, key, &elapsed);
|
||||
if (ret)
|
||||
goto out;
|
||||
@ -3741,7 +3608,6 @@ cli_xml_output_vol_tier_status (xmlTextWriterPtr writer, dict_t *dict,
|
||||
ret = xmlTextWriterStartElement (writer, (xmlChar *)"node");
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "node-name-%d", i);
|
||||
ret = dict_get_str (dict, key, &node_name);
|
||||
if (ret)
|
||||
@ -3751,7 +3617,6 @@ cli_xml_output_vol_tier_status (xmlTextWriterPtr writer, dict_t *dict,
|
||||
"%s", node_name);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "promoted-%d", i);
|
||||
ret = dict_get_uint64 (dict, key, &promoted);
|
||||
if (ret)
|
||||
@ -3762,7 +3627,6 @@ cli_xml_output_vol_tier_status (xmlTextWriterPtr writer, dict_t *dict,
|
||||
promoted);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "demoted-%d", i);
|
||||
ret = dict_get_uint64 (dict, key, &demoted);
|
||||
if (ret)
|
||||
@ -3773,8 +3637,7 @@ cli_xml_output_vol_tier_status (xmlTextWriterPtr writer, dict_t *dict,
|
||||
demoted);
|
||||
XML_RET_CHECK_AND_GOTO (ret, out);
|
||||
|
||||
memset (key, 0, 256);
|
||||
snprintf (key, 256, "status-%d", i);
|
||||
snprintf (key, sizeof (key), "status-%d", i);
|
||||
ret = dict_get_int32 (dict, key, (int32_t *)&status_rcd);
|
||||
|
||||
status_str = cli_vol_task_status_str[status_rcd];
|
||||
|
@ -776,7 +776,6 @@ glfsh_heal_entries (glfs_t *fs, xlator_t *top_subvol, loc_t *rootloc,
|
||||
if ((strcmp (entry->d_name, ".") == 0) ||
|
||||
(strcmp (entry->d_name, "..") == 0))
|
||||
continue;
|
||||
memset (file, 0, sizeof(file));
|
||||
snprintf (file, sizeof(file), "gfid:%s", entry->d_name);
|
||||
ret = glfsh_heal_splitbrain_file (fs, top_subvol, rootloc, file,
|
||||
xattr_req);
|
||||
|
@ -745,7 +745,6 @@ gf_client_dump_fdtables_to_dict (xlator_t *this, dict_t *dict)
|
||||
continue;
|
||||
client = clienttable->cliententries[count].client;
|
||||
if (!strcmp (client->bound_xl->name, this->name)) {
|
||||
memset(key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "conn%d", count++);
|
||||
fdtable_dump_to_dict (client->server_ctx.
|
||||
fdtable,
|
||||
@ -864,7 +863,6 @@ gf_client_dump_inodes_to_dict (xlator_t *this, dict_t *dict)
|
||||
continue;
|
||||
client = clienttable->cliententries[count].client;
|
||||
if (!strcmp (client->bound_xl->name, this->name)) {
|
||||
memset(key, 0, sizeof (key));
|
||||
if (client->bound_xl && client->bound_xl->
|
||||
itable) {
|
||||
/* Presently every brick contains only
|
||||
@ -880,7 +878,6 @@ gf_client_dump_inodes_to_dict (xlator_t *this, dict_t *dict)
|
||||
continue;
|
||||
prev_bound_xl = client->bound_xl;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "conn%d",
|
||||
count);
|
||||
inode_table_dump_to_dict (client->
|
||||
|
@ -1164,19 +1164,16 @@ fdentry_dump_to_dict (fdentry_t *fdentry, char *prefix, dict_t *dict,
|
||||
return;
|
||||
|
||||
if (fdentry->fd) {
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.pid", prefix);
|
||||
ret = dict_set_uint64 (dict, key, fdentry->fd->pid);
|
||||
if (ret)
|
||||
return;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.refcount", prefix);
|
||||
ret = dict_set_int32 (dict, key, GF_ATOMIC_GET (fdentry->fd->refcount));
|
||||
if (ret)
|
||||
return;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.flags", prefix);
|
||||
ret = dict_set_int32 (dict, key, fdentry->fd->flags);
|
||||
|
||||
@ -1202,19 +1199,16 @@ fdtable_dump_to_dict (fdtable_t *fdtable, char *prefix, dict_t *dict)
|
||||
if (ret)
|
||||
return;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.fdtable.refcount", prefix);
|
||||
ret = dict_set_int32 (dict, key, fdtable->refcount);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.fdtable.maxfds", prefix);
|
||||
ret = dict_set_uint32 (dict, key, fdtable->max_fds);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.fdtable.firstfree", prefix);
|
||||
ret = dict_set_int32 (dict, key, fdtable->first_free);
|
||||
if (ret)
|
||||
@ -1223,7 +1217,6 @@ fdtable_dump_to_dict (fdtable_t *fdtable, char *prefix, dict_t *dict)
|
||||
for (i = 0; i < fdtable->max_fds; i++) {
|
||||
if (GF_FDENTRY_ALLOCATED ==
|
||||
fdtable->fdentries[i].next_free) {
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.fdtable.fdentry%d",
|
||||
prefix, i);
|
||||
fdentry_dump_to_dict (&fdtable->fdentries[i], key,
|
||||
@ -1231,7 +1224,6 @@ fdtable_dump_to_dict (fdtable_t *fdtable, char *prefix, dict_t *dict)
|
||||
}
|
||||
}
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.fdtable.openfds", prefix);
|
||||
ret = dict_set_int32 (dict, key, openfds);
|
||||
|
||||
|
@ -2449,25 +2449,21 @@ inode_dump_to_dict (inode_t *inode, char *prefix, dict_t *dict)
|
||||
if (ret)
|
||||
return;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.gfid", prefix);
|
||||
ret = dict_set_dynstr (dict, key, gf_strdup (uuid_utoa (inode->gfid)));
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.nlookup", prefix);
|
||||
ret = dict_set_uint64 (dict, key, inode->nlookup);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.ref", prefix);
|
||||
ret = dict_set_uint32 (dict, key, inode->ref);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.ia_type", prefix);
|
||||
ret = dict_set_int32 (dict, key, inode->ia_type);
|
||||
|
||||
@ -2488,26 +2484,22 @@ inode_table_dump_to_dict (inode_table_t *itable, char *prefix, dict_t *dict)
|
||||
if (ret)
|
||||
return;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.itable.active_size", prefix);
|
||||
ret = dict_set_uint32 (dict, key, itable->active_size);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.itable.lru_size", prefix);
|
||||
ret = dict_set_uint32 (dict, key, itable->lru_size);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.itable.purge_size", prefix);
|
||||
ret = dict_set_uint32 (dict, key, itable->purge_size);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
list_for_each_entry (inode, &itable->active, list) {
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.itable.active%d", prefix,
|
||||
count++);
|
||||
inode_dump_to_dict (inode, key, dict);
|
||||
@ -2515,7 +2507,6 @@ inode_table_dump_to_dict (inode_table_t *itable, char *prefix, dict_t *dict)
|
||||
count = 0;
|
||||
|
||||
list_for_each_entry (inode, &itable->lru, list) {
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.itable.lru%d", prefix,
|
||||
count++);
|
||||
inode_dump_to_dict (inode, key, dict);
|
||||
@ -2523,7 +2514,6 @@ inode_table_dump_to_dict (inode_table_t *itable, char *prefix, dict_t *dict)
|
||||
count = 0;
|
||||
|
||||
list_for_each_entry (inode, &itable->purge, list) {
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.itable.purge%d", prefix,
|
||||
count++);
|
||||
inode_dump_to_dict (inode, key, dict);
|
||||
|
@ -97,7 +97,6 @@ gf_proc_dump_call_frame (call_frame_t *call_frame, const char *key_buf,...)
|
||||
|
||||
GF_ASSERT (key_buf);
|
||||
|
||||
memset(prefix, 0, sizeof(prefix));
|
||||
memset(&my_frame, 0, sizeof(my_frame));
|
||||
va_start(ap, key_buf);
|
||||
vsnprintf(prefix, GF_DUMP_MAX_BUF_LEN, key_buf, ap);
|
||||
@ -169,7 +168,6 @@ gf_proc_dump_call_stack (call_stack_t *call_stack, const char *key_buf,...)
|
||||
|
||||
GF_ASSERT (key_buf);
|
||||
|
||||
memset(prefix, 0, sizeof(prefix));
|
||||
va_start(ap, key_buf);
|
||||
vsnprintf(prefix, GF_DUMP_MAX_BUF_LEN, key_buf, ap);
|
||||
va_end(ap);
|
||||
@ -267,26 +265,22 @@ gf_proc_dump_call_frame_to_dict (call_frame_t *call_frame,
|
||||
memcpy (&tmp_frame, call_frame, sizeof (tmp_frame));
|
||||
UNLOCK (&call_frame->lock);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.refcount", prefix);
|
||||
ret = dict_set_int32 (dict, key, tmp_frame.ref_count);
|
||||
if (ret)
|
||||
return;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.translator", prefix);
|
||||
ret = dict_set_dynstr (dict, key, gf_strdup (tmp_frame.this->name));
|
||||
if (ret)
|
||||
return;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.complete", prefix);
|
||||
ret = dict_set_int32 (dict, key, tmp_frame.complete);
|
||||
if (ret)
|
||||
return;
|
||||
|
||||
if (tmp_frame.root->ctx->measure_latency) {
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.timings", prefix);
|
||||
snprintf (msg, sizeof (msg), "%ld.%"GF_PRI_SNSECONDS
|
||||
" -> %ld.%"GF_PRI_SNSECONDS,
|
||||
@ -298,7 +292,6 @@ gf_proc_dump_call_frame_to_dict (call_frame_t *call_frame,
|
||||
}
|
||||
|
||||
if (tmp_frame.parent) {
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.parent", prefix);
|
||||
ret = dict_set_dynstr (dict, key,
|
||||
gf_strdup (tmp_frame.parent->this->name));
|
||||
@ -307,7 +300,6 @@ gf_proc_dump_call_frame_to_dict (call_frame_t *call_frame,
|
||||
}
|
||||
|
||||
if (tmp_frame.wind_from) {
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.windfrom", prefix);
|
||||
ret = dict_set_dynstr (dict, key,
|
||||
gf_strdup (tmp_frame.wind_from));
|
||||
@ -316,7 +308,6 @@ gf_proc_dump_call_frame_to_dict (call_frame_t *call_frame,
|
||||
}
|
||||
|
||||
if (tmp_frame.wind_to) {
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.windto", prefix);
|
||||
ret = dict_set_dynstr (dict, key,
|
||||
gf_strdup (tmp_frame.wind_to));
|
||||
@ -325,7 +316,6 @@ gf_proc_dump_call_frame_to_dict (call_frame_t *call_frame,
|
||||
}
|
||||
|
||||
if (tmp_frame.unwind_from) {
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.unwindfrom", prefix);
|
||||
ret = dict_set_dynstr (dict, key,
|
||||
gf_strdup (tmp_frame.unwind_from));
|
||||
@ -334,7 +324,6 @@ gf_proc_dump_call_frame_to_dict (call_frame_t *call_frame,
|
||||
}
|
||||
|
||||
if (tmp_frame.unwind_to) {
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.unwind_to", prefix);
|
||||
ret = dict_set_dynstr (dict, key,
|
||||
gf_strdup (tmp_frame.unwind_to));
|
||||
@ -357,31 +346,26 @@ gf_proc_dump_call_stack_to_dict (call_stack_t *call_stack,
|
||||
return;
|
||||
|
||||
count = call_frames_count (call_stack);
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.uid", prefix);
|
||||
ret = dict_set_int32 (dict, key, call_stack->uid);
|
||||
if (ret)
|
||||
return;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.gid", prefix);
|
||||
ret = dict_set_int32 (dict, key, call_stack->gid);
|
||||
if (ret)
|
||||
return;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.pid", prefix);
|
||||
ret = dict_set_int32 (dict, key, call_stack->pid);
|
||||
if (ret)
|
||||
return;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.unique", prefix);
|
||||
ret = dict_set_uint64 (dict, key, call_stack->unique);
|
||||
if (ret)
|
||||
return;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.op", prefix);
|
||||
if (call_stack->type == GF_OP_TYPE_FOP)
|
||||
ret = dict_set_str (dict, key,
|
||||
@ -392,20 +376,17 @@ gf_proc_dump_call_stack_to_dict (call_stack_t *call_stack,
|
||||
if (ret)
|
||||
return;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.type", prefix);
|
||||
ret = dict_set_int32 (dict, key, call_stack->type);
|
||||
if (ret)
|
||||
return;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.count", prefix);
|
||||
ret = dict_set_int32 (dict, key, count);
|
||||
if (ret)
|
||||
return;
|
||||
|
||||
list_for_each_entry (trav, &call_stack->myframes, frames) {
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.frame%d",
|
||||
prefix, i);
|
||||
gf_proc_dump_call_frame_to_dict (trav, key, dict);
|
||||
@ -439,7 +420,6 @@ gf_proc_dump_pending_frames_to_dict (call_pool_t *call_pool, dict_t *dict)
|
||||
goto out;
|
||||
|
||||
list_for_each_entry (trav, &call_pool->all_frames, all_frames) {
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "callpool.stack%d", i);
|
||||
gf_proc_dump_call_stack_to_dict (trav, key, dict);
|
||||
i++;
|
||||
|
@ -126,7 +126,6 @@ gf_proc_dump_add_section_fd (char *key, va_list ap)
|
||||
|
||||
GF_ASSERT(key);
|
||||
|
||||
memset (buf, 0, sizeof(buf));
|
||||
snprintf (buf, GF_DUMP_MAX_BUF_LEN, "\n[");
|
||||
vsnprintf (buf + strlen(buf),
|
||||
GF_DUMP_MAX_BUF_LEN - strlen (buf), key, ap);
|
||||
@ -175,10 +174,7 @@ gf_proc_dump_write_fd (char *key, char *value, va_list ap)
|
||||
|
||||
GF_ASSERT (key);
|
||||
|
||||
offset = strlen (key);
|
||||
|
||||
memset (buf, 0, GF_DUMP_MAX_BUF_LEN);
|
||||
snprintf (buf, GF_DUMP_MAX_BUF_LEN, "%s", key);
|
||||
offset = snprintf (buf, GF_DUMP_MAX_BUF_LEN, "%s", key);
|
||||
snprintf (buf + offset, GF_DUMP_MAX_BUF_LEN - offset, "=");
|
||||
offset += 1;
|
||||
vsnprintf (buf + offset, GF_DUMP_MAX_BUF_LEN - offset, value, ap);
|
||||
@ -429,49 +425,41 @@ gf_proc_dump_mempool_info_to_dict (glusterfs_ctx_t *ctx, dict_t *dict)
|
||||
return;
|
||||
|
||||
list_for_each_entry (pool, &ctx->mempool_list, global_list) {
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "pool%d.name", count);
|
||||
ret = dict_set_str (dict, key, pool->name);
|
||||
if (ret)
|
||||
return;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "pool%d.hotcount", count);
|
||||
ret = dict_set_int32 (dict, key, pool->hot_count);
|
||||
if (ret)
|
||||
return;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "pool%d.coldcount", count);
|
||||
ret = dict_set_int32 (dict, key, pool->cold_count);
|
||||
if (ret)
|
||||
return;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "pool%d.paddedsizeof", count);
|
||||
ret = dict_set_uint64 (dict, key, pool->padded_sizeof_type);
|
||||
if (ret)
|
||||
return;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "pool%d.alloccount", count);
|
||||
ret = dict_set_uint64 (dict, key, pool->alloc_count);
|
||||
if (ret)
|
||||
return;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "pool%d.max_alloc", count);
|
||||
ret = dict_set_int32 (dict, key, pool->max_alloc);
|
||||
if (ret)
|
||||
return;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "pool%d.max-stdalloc", count);
|
||||
ret = dict_set_int32 (dict, key, pool->max_stdalloc);
|
||||
if (ret)
|
||||
return;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "pool%d.pool-misses", count);
|
||||
ret = dict_set_uint64 (dict, key, pool->pool_misses);
|
||||
if (ret)
|
||||
@ -893,9 +881,7 @@ gf_proc_dump_info (int signum, glusterfs_ctx_t *ctx)
|
||||
//swallow the errors of write for start and end marker
|
||||
ret = sys_write (gf_dump_fd, sign_string, strlen (sign_string));
|
||||
|
||||
memset (sign_string, 0, sizeof (sign_string));
|
||||
memset (timestr, 0, sizeof (timestr));
|
||||
memset (&tv, 0, sizeof (tv));
|
||||
|
||||
if (GF_PROC_DUMP_IS_OPTION_ENABLED (mem)) {
|
||||
gf_proc_dump_mem_info ();
|
||||
|
@ -411,7 +411,6 @@ af_inet_server_get_local_sockaddr (rpc_transport_t *this,
|
||||
listen_host = data_to_str (listen_host_data);
|
||||
}
|
||||
|
||||
memset (service, 0, sizeof (service));
|
||||
sprintf (service, "%d", listen_port);
|
||||
|
||||
memset (&hints, 0, sizeof (hints));
|
||||
|
@ -409,7 +409,6 @@ af_inet_server_get_local_sockaddr (rpc_transport_t *this,
|
||||
}
|
||||
}
|
||||
|
||||
memset (service, 0, sizeof (service));
|
||||
sprintf (service, "%d", listen_port);
|
||||
|
||||
memset (&hints, 0, sizeof (hints));
|
||||
|
@ -4322,7 +4322,7 @@ fill_layout_info (dht_layout_t *layout, char *buf)
|
||||
char tmp_buf[128] = {0,};
|
||||
|
||||
for (i = 0; i < layout->cnt; i++) {
|
||||
snprintf (tmp_buf, 128, "(%s %u %u)",
|
||||
snprintf (tmp_buf, sizeof (tmp_buf), "(%s %u %u)",
|
||||
layout->list[i].xlator->name,
|
||||
layout->list[i].start,
|
||||
layout->list[i].stop);
|
||||
|
@ -631,7 +631,7 @@ dht_filter_loc_subvol_key (xlator_t *this, loc_t *loc, loc_t *new_loc,
|
||||
|
||||
trav = this->children;
|
||||
while (trav) {
|
||||
snprintf (key, 1024, "*@%s:%s", this->name, trav->xlator->name);
|
||||
snprintf (key, sizeof (key), "*@%s:%s", this->name, trav->xlator->name);
|
||||
if (fnmatch (key, loc->name, FNM_NOESCAPE) == 0) {
|
||||
new_name = GF_CALLOC(strlen (loc->name),
|
||||
sizeof (char),
|
||||
|
@ -261,7 +261,7 @@ stripe_fill_pathinfo_xattr (xlator_t *this, stripe_local_t *local,
|
||||
goto out;
|
||||
}
|
||||
|
||||
(void) snprintf (stripe_size_str, 20, "%"PRId64,
|
||||
(void) snprintf (stripe_size_str, sizeof (stripe_size_str), "%"PRId64,
|
||||
(long long) (local->fctx) ? local->fctx->stripe_size : 0);
|
||||
|
||||
/* extra bytes for decorations (brackets and <>'s) */
|
||||
|
@ -1301,10 +1301,6 @@ io_stats_dump_global_to_logfp (xlator_t *this, struct ios_global_stats *stats,
|
||||
ios_log (this, logfp, "%s", str_read);
|
||||
ios_log (this, logfp, "%s\n", str_write);
|
||||
|
||||
memset (str_header, 0, sizeof (str_header));
|
||||
memset (str_read, 0, sizeof (str_read));
|
||||
memset (str_write, 0, sizeof (str_write));
|
||||
|
||||
snprintf (str_header, sizeof (str_header), "%-12s %c",
|
||||
"Block Size", ':');
|
||||
snprintf (str_read, sizeof (str_read), "%-12s %c",
|
||||
@ -1437,7 +1433,6 @@ io_stats_dump_global_to_dict (xlator_t *this, struct ios_global_stats *stats,
|
||||
gf_log (this->name, GF_LOG_ERROR, "failed to set "
|
||||
"interval %d", interval);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%d-duration", interval);
|
||||
sec = (uint64_t) (now->tv_sec - stats->started_at.tv_sec);
|
||||
ret = dict_set_uint64 (dict, key, sec);
|
||||
@ -1447,7 +1442,6 @@ io_stats_dump_global_to_dict (xlator_t *this, struct ios_global_stats *stats,
|
||||
goto out;
|
||||
}
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%d-total-read", interval);
|
||||
ret = dict_set_uint64 (dict, key, GF_ATOMIC_GET (stats->data_read));
|
||||
if (ret) {
|
||||
@ -1457,7 +1451,6 @@ io_stats_dump_global_to_dict (xlator_t *this, struct ios_global_stats *stats,
|
||||
goto out;
|
||||
}
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%d-total-write", interval);
|
||||
ret = dict_set_uint64 (dict, key, GF_ATOMIC_GET (stats->data_written));
|
||||
if (ret) {
|
||||
@ -1469,7 +1462,6 @@ io_stats_dump_global_to_dict (xlator_t *this, struct ios_global_stats *stats,
|
||||
for (i = 0; i < 32; i++) {
|
||||
count = GF_ATOMIC_GET (stats->block_count_read[i]);
|
||||
if (count) {
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%d-read-%d", interval,
|
||||
(1 << i));
|
||||
ret = dict_set_uint64 (dict, key, count);
|
||||
|
@ -5248,7 +5248,6 @@ glusterd_op_sys_exec (dict_t *dict, char **op_errstr, dict_t *rsp_dict)
|
||||
}
|
||||
|
||||
for (i=1; i <= cmd_args_count; i++) {
|
||||
memset (cmd_arg_name, '\0', sizeof(cmd_arg_name));
|
||||
snprintf (cmd_arg_name, sizeof(cmd_arg_name),
|
||||
"cmd_arg_%d", i);
|
||||
ret = dict_get_str (dict, cmd_arg_name, &cmd_args[i-1]);
|
||||
@ -5288,7 +5287,6 @@ glusterd_op_sys_exec (dict_t *dict, char **op_errstr, dict_t *rsp_dict)
|
||||
output_count = 1;
|
||||
else
|
||||
output_count++;
|
||||
memset (output_name, '\0', sizeof (output_name));
|
||||
snprintf (output_name, sizeof (output_name),
|
||||
"output_%d", output_count);
|
||||
if (buf[strlen(buf) - 1] == '\n')
|
||||
|
@ -320,7 +320,7 @@ _build_option_key (dict_t *d, char *k, data_t *v, void *tmp)
|
||||
(strcmp (k, "snap-max-soft-limit") == 0))
|
||||
return 0;
|
||||
|
||||
snprintf (reconfig_key, 256, "volume%d.option.%s",
|
||||
snprintf (reconfig_key, sizeof (reconfig_key), "volume%d.option.%s",
|
||||
pack->vol_count, k);
|
||||
ret = dict_set_str (pack->dict, reconfig_key, v->data);
|
||||
if (0 == ret)
|
||||
@ -339,66 +339,56 @@ glusterd_add_tier_volume_detail_to_dict (glusterd_volinfo_t *volinfo,
|
||||
GF_ASSERT (volinfo);
|
||||
GF_ASSERT (dict);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, 256, "volume%d.cold_type", count);
|
||||
snprintf (key, sizeof (key), "volume%d.cold_type", count);
|
||||
ret = dict_set_int32 (dict, key, volinfo->tier_info.cold_type);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, 256, "volume%d.cold_brick_count", count);
|
||||
snprintf (key, sizeof (key), "volume%d.cold_brick_count", count);
|
||||
ret = dict_set_int32 (dict, key, volinfo->tier_info.cold_brick_count);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, 256, "volume%d.cold_dist_count", count);
|
||||
snprintf (key, sizeof (key), "volume%d.cold_dist_count", count);
|
||||
ret = dict_set_int32 (dict, key,
|
||||
volinfo->tier_info.cold_dist_leaf_count);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, 256, "volume%d.cold_replica_count", count);
|
||||
snprintf (key, sizeof (key), "volume%d.cold_replica_count", count);
|
||||
ret = dict_set_int32 (dict, key,
|
||||
volinfo->tier_info.cold_replica_count);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, 256, "volume%d.cold_arbiter_count", count);
|
||||
snprintf (key, sizeof (key), "volume%d.cold_arbiter_count", count);
|
||||
ret = dict_set_int32 (dict, key, volinfo->arbiter_count);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, 256, "volume%d.cold_disperse_count", count);
|
||||
snprintf (key, sizeof (key), "volume%d.cold_disperse_count", count);
|
||||
ret = dict_set_int32 (dict, key,
|
||||
volinfo->tier_info.cold_disperse_count);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, 256, "volume%d.cold_redundancy_count", count);
|
||||
snprintf (key, sizeof (key), "volume%d.cold_redundancy_count", count);
|
||||
ret = dict_set_int32 (dict, key,
|
||||
volinfo->tier_info.cold_redundancy_count);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, 256, "volume%d.hot_type", count);
|
||||
snprintf (key, sizeof (key), "volume%d.hot_type", count);
|
||||
ret = dict_set_int32 (dict, key, volinfo->tier_info.hot_type);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, 256, "volume%d.hot_brick_count", count);
|
||||
snprintf (key, sizeof (key), "volume%d.hot_brick_count", count);
|
||||
ret = dict_set_int32 (dict, key, volinfo->tier_info.hot_brick_count);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, 256, "volume%d.hot_replica_count", count);
|
||||
snprintf (key, sizeof (key), "volume%d.hot_replica_count", count);
|
||||
ret = dict_set_int32 (dict, key, volinfo->tier_info.hot_replica_count);
|
||||
if (ret)
|
||||
goto out;
|
||||
@ -431,8 +421,7 @@ glusterd_add_arbiter_info_to_bricks (glusterd_volinfo_t *volinfo,
|
||||
if ((i - start_index + 1) %
|
||||
volinfo->tier_info.cold_replica_count != 0)
|
||||
continue;
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, 256, "volume%d.brick%d.isArbiter",
|
||||
snprintf (key, sizeof (key), "volume%d.brick%d.isArbiter",
|
||||
count, i);
|
||||
ret = dict_set_int32 (volumes, key, 1);
|
||||
if (ret)
|
||||
@ -444,8 +433,7 @@ glusterd_add_arbiter_info_to_bricks (glusterd_volinfo_t *volinfo,
|
||||
for (i = 1; i <= volinfo->brick_count; i++) {
|
||||
if (i % volinfo->replica_count != 0)
|
||||
continue;
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, 256, "volume%d.brick%d.isArbiter",
|
||||
snprintf (key, sizeof (key), "volume%d.brick%d.isArbiter",
|
||||
count, i);
|
||||
ret = dict_set_int32 (volumes, key, 1);
|
||||
if (ret)
|
||||
@ -481,27 +469,27 @@ glusterd_add_volume_detail_to_dict (glusterd_volinfo_t *volinfo,
|
||||
|
||||
GF_ASSERT (priv);
|
||||
|
||||
snprintf (key, 256, "volume%d.name", count);
|
||||
snprintf (key, sizeof (key), "volume%d.name", count);
|
||||
ret = dict_set_str (volumes, key, volinfo->volname);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
snprintf (key, 256, "volume%d.type", count);
|
||||
snprintf (key, sizeof (key), "volume%d.type", count);
|
||||
ret = dict_set_int32 (volumes, key, volinfo->type);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
snprintf (key, 256, "volume%d.status", count);
|
||||
snprintf (key, sizeof (key), "volume%d.status", count);
|
||||
ret = dict_set_int32 (volumes, key, volinfo->status);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
snprintf (key, 256, "volume%d.brick_count", count);
|
||||
snprintf (key, sizeof (key), "volume%d.brick_count", count);
|
||||
ret = dict_set_int32 (volumes, key, volinfo->brick_count);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
snprintf (key, 256, "volume%d.hot_brick_count", count);
|
||||
snprintf (key, sizeof (key), "volume%d.hot_brick_count", count);
|
||||
ret = dict_set_int32 (volumes, key, volinfo->tier_info.hot_brick_count);
|
||||
if (ret)
|
||||
goto out;
|
||||
@ -513,27 +501,27 @@ glusterd_add_volume_detail_to_dict (glusterd_volinfo_t *volinfo,
|
||||
goto out;
|
||||
}
|
||||
|
||||
snprintf (key, 256, "volume%d.dist_count", count);
|
||||
snprintf (key, sizeof (key), "volume%d.dist_count", count);
|
||||
ret = dict_set_int32 (volumes, key, volinfo->dist_leaf_count);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
snprintf (key, 256, "volume%d.stripe_count", count);
|
||||
snprintf (key, sizeof (key), "volume%d.stripe_count", count);
|
||||
ret = dict_set_int32 (volumes, key, volinfo->stripe_count);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
snprintf (key, 256, "volume%d.replica_count", count);
|
||||
snprintf (key, sizeof (key), "volume%d.replica_count", count);
|
||||
ret = dict_set_int32 (volumes, key, volinfo->replica_count);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
snprintf (key, 256, "volume%d.disperse_count", count);
|
||||
snprintf (key, sizeof (key), "volume%d.disperse_count", count);
|
||||
ret = dict_set_int32 (volumes, key, volinfo->disperse_count);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
snprintf (key, 256, "volume%d.redundancy_count", count);
|
||||
snprintf (key, sizeof (key), "volume%d.redundancy_count", count);
|
||||
ret = dict_set_int32 (volumes, key, volinfo->redundancy_count);
|
||||
if (ret)
|
||||
goto out;
|
||||
@ -543,7 +531,7 @@ glusterd_add_volume_detail_to_dict (glusterd_volinfo_t *volinfo,
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
snprintf (key, 256, "volume%d.transport", count);
|
||||
snprintf (key, sizeof (key), "volume%d.transport", count);
|
||||
ret = dict_set_int32 (volumes, key, volinfo->transport_type);
|
||||
if (ret)
|
||||
goto out;
|
||||
@ -557,12 +545,12 @@ glusterd_add_volume_detail_to_dict (glusterd_volinfo_t *volinfo,
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
snprintf (key, 256, "volume%d.rebalance", count);
|
||||
snprintf (key, sizeof (key), "volume%d.rebalance", count);
|
||||
ret = dict_set_int32 (volumes, key, volinfo->rebal.defrag_cmd);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
snprintf (key, 256, "volume%d.snap_count", count);
|
||||
snprintf (key, sizeof (key), "volume%d.snap_count", count);
|
||||
ret = dict_set_int32 (volumes, key, volinfo->snap_count);
|
||||
if (ret)
|
||||
goto out;
|
||||
@ -570,7 +558,7 @@ glusterd_add_volume_detail_to_dict (glusterd_volinfo_t *volinfo,
|
||||
#ifdef HAVE_BD_XLATOR
|
||||
if (volinfo->caps) {
|
||||
caps = 0;
|
||||
snprintf (key, 256, "volume%d.xlator0", count);
|
||||
snprintf (key, sizeof (key), "volume%d.xlator0", count);
|
||||
buf = GF_MALLOC (256, gf_common_mt_char);
|
||||
if (!buf) {
|
||||
ret = ENOMEM;
|
||||
@ -585,7 +573,7 @@ glusterd_add_volume_detail_to_dict (glusterd_volinfo_t *volinfo,
|
||||
}
|
||||
|
||||
if (volinfo->caps & CAPS_THIN) {
|
||||
snprintf (key, 256, "volume%d.xlator0.caps%d", count,
|
||||
snprintf (key, sizeof (key), "volume%d.xlator0.caps%d", count,
|
||||
caps++);
|
||||
buf = GF_MALLOC (256, gf_common_mt_char);
|
||||
if (!buf) {
|
||||
@ -601,7 +589,7 @@ glusterd_add_volume_detail_to_dict (glusterd_volinfo_t *volinfo,
|
||||
}
|
||||
|
||||
if (volinfo->caps & CAPS_OFFLOAD_COPY) {
|
||||
snprintf (key, 256, "volume%d.xlator0.caps%d", count,
|
||||
snprintf (key, sizeof (key), "volume%d.xlator0.caps%d", count,
|
||||
caps++);
|
||||
buf = GF_MALLOC (256, gf_common_mt_char);
|
||||
if (!buf) {
|
||||
@ -617,7 +605,7 @@ glusterd_add_volume_detail_to_dict (glusterd_volinfo_t *volinfo,
|
||||
}
|
||||
|
||||
if (volinfo->caps & CAPS_OFFLOAD_SNAPSHOT) {
|
||||
snprintf (key, 256, "volume%d.xlator0.caps%d", count,
|
||||
snprintf (key, sizeof (key), "volume%d.xlator0.caps%d", count,
|
||||
caps++);
|
||||
buf = GF_MALLOC (256, gf_common_mt_char);
|
||||
if (!buf) {
|
||||
@ -633,7 +621,7 @@ glusterd_add_volume_detail_to_dict (glusterd_volinfo_t *volinfo,
|
||||
}
|
||||
|
||||
if (volinfo->caps & CAPS_OFFLOAD_ZERO) {
|
||||
snprintf (key, 256, "volume%d.xlator0.caps%d", count,
|
||||
snprintf (key, sizeof (key), "volume%d.xlator0.caps%d", count,
|
||||
caps++);
|
||||
buf = GF_MALLOC (256, gf_common_mt_char);
|
||||
if (!buf) {
|
||||
@ -654,8 +642,8 @@ glusterd_add_volume_detail_to_dict (glusterd_volinfo_t *volinfo,
|
||||
cds_list_for_each_entry (brickinfo, &volinfo->bricks, brick_list) {
|
||||
char brick[1024] = {0,};
|
||||
char brick_uuid[64] = {0,};
|
||||
snprintf (key, 256, "volume%d.brick%d", count, i);
|
||||
len = snprintf (brick, 1024, "%s:%s", brickinfo->hostname,
|
||||
snprintf (key, sizeof (key), "volume%d.brick%d", count, i);
|
||||
len = snprintf (brick, sizeof (brick), "%s:%s", brickinfo->hostname,
|
||||
brickinfo->path);
|
||||
if ((len < 0) || (len >= 1024)) {
|
||||
ret = -1;
|
||||
@ -665,8 +653,8 @@ glusterd_add_volume_detail_to_dict (glusterd_volinfo_t *volinfo,
|
||||
ret = dict_set_dynstr (volumes, key, buf);
|
||||
if (ret)
|
||||
goto out;
|
||||
snprintf (key, 256, "volume%d.brick%d.uuid", count, i);
|
||||
snprintf (brick_uuid, 64, "%s", uuid_utoa (brickinfo->uuid));
|
||||
snprintf (key, sizeof (key), "volume%d.brick%d.uuid", count, i);
|
||||
snprintf (brick_uuid, sizeof (brick_uuid), "%s", uuid_utoa (brickinfo->uuid));
|
||||
buf = gf_strdup (brick_uuid);
|
||||
if (!buf)
|
||||
goto out;
|
||||
@ -676,7 +664,7 @@ glusterd_add_volume_detail_to_dict (glusterd_volinfo_t *volinfo,
|
||||
|
||||
#ifdef HAVE_BD_XLATOR
|
||||
if (volinfo->caps & CAPS_BD) {
|
||||
snprintf (key, 256, "volume%d.vg%d", count, i);
|
||||
snprintf (key, sizeof (key), "volume%d.vg%d", count, i);
|
||||
snprintf (brick, 1024, "%s", brickinfo->vg);
|
||||
buf = gf_strdup (brick);
|
||||
ret = dict_set_dynstr (volumes, key, buf);
|
||||
@ -702,7 +690,7 @@ glusterd_add_volume_detail_to_dict (glusterd_volinfo_t *volinfo,
|
||||
dict_foreach (dict, _build_option_key, (void *) &pack);
|
||||
dict_foreach (priv->opts, _build_option_key, &pack);
|
||||
|
||||
snprintf (key, 256, "volume%d.opt_count", pack.vol_count);
|
||||
snprintf (key, sizeof (key), "volume%d.opt_count", pack.vol_count);
|
||||
ret = dict_set_int32 (volumes, key, pack.opt_count);
|
||||
out:
|
||||
return ret;
|
||||
@ -1843,7 +1831,6 @@ __glusterd_handle_cli_list_volume (rpcsvc_request_t *req)
|
||||
goto out;
|
||||
|
||||
cds_list_for_each_entry (volinfo, &priv->volumes, vol_list) {
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "volume%d", count);
|
||||
ret = dict_set_str (dict, key, volinfo->volname);
|
||||
if (ret)
|
||||
@ -2773,7 +2760,6 @@ __glusterd_handle_friend_update (rpcsvc_request_t *req)
|
||||
|
||||
args.mode = GD_MODE_ON;
|
||||
while ( i <= count) {
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "friend%d.uuid", i);
|
||||
ret = dict_get_str (dict, key, &uuid_buf);
|
||||
if (ret)
|
||||
@ -2788,7 +2774,6 @@ __glusterd_handle_friend_update (rpcsvc_request_t *req)
|
||||
continue;
|
||||
}
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "friend%d", i);
|
||||
|
||||
rcu_read_lock ();
|
||||
@ -4105,18 +4090,18 @@ unlock:
|
||||
|
||||
if (flags == GF_CLI_LIST_POOL_NODES) {
|
||||
count++;
|
||||
snprintf (key, 256, "friend%d.uuid", count);
|
||||
snprintf (key, sizeof (key), "friend%d.uuid", count);
|
||||
uuid_utoa_r (MY_UUID, my_uuid_str);
|
||||
ret = dict_set_str (friends, key, my_uuid_str);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
snprintf (key, 256, "friend%d.hostname", count);
|
||||
snprintf (key, sizeof (key), "friend%d.hostname", count);
|
||||
ret = dict_set_str (friends, key, "localhost");
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
snprintf (key, 256, "friend%d.connected", count);
|
||||
snprintf (key, sizeof (key), "friend%d.connected", count);
|
||||
ret = dict_set_int32 (friends, key, 1);
|
||||
if (ret)
|
||||
goto out;
|
||||
@ -5103,7 +5088,7 @@ glusterd_print_gsync_status_by_vol (FILE *fp, glusterd_volinfo_t *volinfo)
|
||||
if (!gsync_rsp_dict)
|
||||
goto out;
|
||||
|
||||
ret = gethostname(my_hostname, 256);
|
||||
ret = gethostname(my_hostname, sizeof (my_hostname));
|
||||
if (ret) {
|
||||
/* stick to N/A */
|
||||
(void) strcpy (my_hostname, "N/A");
|
||||
@ -5275,7 +5260,6 @@ glusterd_print_client_details (FILE *fp, dict_t *dict,
|
||||
|
||||
int i;
|
||||
for (i = 1; i <= client_count; i++) {
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "client%d.hostname", i-1);
|
||||
ret = dict_get_str (args.dict, key, &clientname);
|
||||
if (ret) {
|
||||
@ -5285,12 +5269,10 @@ glusterd_print_client_details (FILE *fp, dict_t *dict,
|
||||
goto out;
|
||||
}
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "Client%d.hostname", i);
|
||||
fprintf (fp, "Volume%d.Brick%d.%s: %s\n",
|
||||
volcount, brickcount, key, clientname);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "client%d.bytesread", i-1);
|
||||
ret = dict_get_uint64 (args.dict, key, &bytesread);
|
||||
if (ret) {
|
||||
@ -5300,12 +5282,10 @@ glusterd_print_client_details (FILE *fp, dict_t *dict,
|
||||
goto out;
|
||||
}
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "Client%d.bytesread", i);
|
||||
fprintf (fp, "Volume%d.Brick%d.%s: %"PRIu64"\n",
|
||||
volcount, brickcount, key, bytesread);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "client%d.byteswrite", i-1);
|
||||
ret = dict_get_uint64 (args.dict, key, &byteswrite);
|
||||
if (ret) {
|
||||
@ -5315,12 +5295,10 @@ glusterd_print_client_details (FILE *fp, dict_t *dict,
|
||||
goto out;
|
||||
}
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "Client%d.byteswrite", i);
|
||||
fprintf (fp, "Volume%d.Brick%d.%s: %"PRIu64"\n",
|
||||
volcount, brickcount, key, byteswrite);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "client%d.opversion", i-1);
|
||||
ret = dict_get_uint32 (args.dict, key, &opversion);
|
||||
if (ret) {
|
||||
@ -5330,7 +5308,6 @@ glusterd_print_client_details (FILE *fp, dict_t *dict,
|
||||
goto out;
|
||||
}
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "Client%d.opversion", i);
|
||||
fprintf (fp, "Volume%d.Brick%d.%s: %"PRIu32"\n",
|
||||
volcount, brickcount, key, opversion);
|
||||
|
@ -3442,7 +3442,6 @@ _add_remove_bricks_to_dict (dict_t *dict, glusterd_volinfo_t *volinfo,
|
||||
}
|
||||
|
||||
for (i = 1; i <= count; i++) {
|
||||
memset (brick_key, 0, sizeof (brick_key));
|
||||
snprintf (brick_key, sizeof (brick_key), "brick%d", i);
|
||||
|
||||
ret = dict_get_str (volinfo->rebal.dict, brick_key, &brick);
|
||||
@ -3453,7 +3452,6 @@ _add_remove_bricks_to_dict (dict_t *dict, glusterd_volinfo_t *volinfo,
|
||||
goto out;
|
||||
}
|
||||
|
||||
memset (dict_key, 0, sizeof (dict_key));
|
||||
len = snprintf (dict_key, sizeof (dict_key), "%s.%s", prefix,
|
||||
brick_key);
|
||||
if ((len < 0) || (len >= sizeof(dict_key))) {
|
||||
@ -3527,7 +3525,6 @@ _add_task_to_dict (dict_t *dict, glusterd_volinfo_t *volinfo, int op, int index)
|
||||
goto out;
|
||||
}
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "task%d.id", index);
|
||||
|
||||
if (!uuid_str)
|
||||
@ -3541,7 +3538,6 @@ _add_task_to_dict (dict_t *dict, glusterd_volinfo_t *volinfo, int op, int index)
|
||||
}
|
||||
uuid_str = NULL;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "task%d.status", index);
|
||||
ret = dict_set_int32 (dict, key, status);
|
||||
if (ret) {
|
||||
@ -4856,7 +4852,6 @@ glusterd_op_volume_dict_uuid_to_hostname (dict_t *dict, const char *key_fmt,
|
||||
GF_ASSERT (key_fmt);
|
||||
|
||||
for (i = idx_min; i < idx_max; i++) {
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), key_fmt, i);
|
||||
ret = dict_get_str (dict, key, &uuid_str);
|
||||
if (ret) {
|
||||
@ -4971,8 +4966,7 @@ glusterd_op_check_peer_defrag_status (dict_t *dict, int count)
|
||||
}
|
||||
|
||||
do {
|
||||
memset (key, 0, 256);
|
||||
snprintf (key, 256, "status-%d", i);
|
||||
snprintf (key, sizeof (key), "status-%d", i);
|
||||
ret = dict_get_int32 (dict, key, (int32_t *)&status);
|
||||
if (ret) {
|
||||
gf_msg (THIS->name, GF_LOG_WARNING, 0,
|
||||
@ -5036,13 +5030,11 @@ glusterd_op_modify_port_key (dict_t *op_ctx, int brick_index_max)
|
||||
|
||||
for (i = 0; i <= brick_index_max; i++) {
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "brick%d.rdma_port", i);
|
||||
ret = dict_get_str (op_ctx, key, &port);
|
||||
|
||||
if (ret) {
|
||||
|
||||
memset (old_key, 0, sizeof (old_key));
|
||||
snprintf (old_key, sizeof (old_key),
|
||||
"brick%d.port", i);
|
||||
ret = dict_get_str (op_ctx, old_key, &port);
|
||||
@ -5141,7 +5133,6 @@ glusterd_op_modify_op_ctx (glusterd_op_t op, void *ctx)
|
||||
goto out;
|
||||
|
||||
for (i = 0; i <= brick_index_max; i++) {
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "brick%d.rdma_port", i);
|
||||
ret = dict_get_str (op_ctx, key, &port);
|
||||
if (ret) {
|
||||
@ -5169,11 +5160,9 @@ glusterd_op_modify_op_ctx (glusterd_op_t op, void *ctx)
|
||||
int i;
|
||||
|
||||
for (i = brick_index_max + 1; i < count; i++) {
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "brick%d.path", i);
|
||||
ret = dict_get_str (op_ctx, key, &uuid_str);
|
||||
if (!ret) {
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key),
|
||||
"brick%d.peerid", i);
|
||||
uuid = gf_strdup (uuid_str);
|
||||
@ -5249,11 +5238,9 @@ glusterd_op_modify_op_ctx (glusterd_op_t op, void *ctx)
|
||||
int i;
|
||||
|
||||
for (i = 1; i <= count; i++) {
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "node-uuid-%d", i);
|
||||
ret = dict_get_str (op_ctx, key, &uuid_str);
|
||||
if (!ret) {
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key),
|
||||
"node-name-%d", i);
|
||||
uuid = gf_strdup (uuid_str);
|
||||
|
@ -590,7 +590,6 @@ gd_add_friend_to_dict (glusterd_peerinfo_t *friend, dict_t *dict,
|
||||
/* Setting the first hostname from the list with this key for backward
|
||||
* compatibility
|
||||
*/
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.hostname", prefix);
|
||||
address = cds_list_entry (&friend->hostnames, glusterd_peer_hostname_t,
|
||||
hostname_list);
|
||||
@ -612,7 +611,6 @@ gd_add_friend_to_dict (glusterd_peerinfo_t *friend, dict_t *dict,
|
||||
cds_list_for_each_entry (address, &friend->hostnames, hostname_list) {
|
||||
GF_VALIDATE_OR_GOTO (this->name, (address != NULL), out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.hostname%d", prefix, count);
|
||||
ret = dict_set_dynstr_with_alloc (dict, key, address->hostname);
|
||||
if (ret) {
|
||||
@ -623,7 +621,6 @@ gd_add_friend_to_dict (glusterd_peerinfo_t *friend, dict_t *dict,
|
||||
}
|
||||
count++;
|
||||
}
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.address-count", prefix);
|
||||
ret = dict_set_int32 (dict, key, count);
|
||||
if (ret)
|
||||
@ -771,7 +768,6 @@ gd_update_peerinfo_from_dict (glusterd_peerinfo_t *peerinfo, dict_t *dict,
|
||||
GF_VALIDATE_OR_GOTO (this->name, (dict != NULL), out);
|
||||
GF_VALIDATE_OR_GOTO (this->name, (prefix != NULL), out);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.hostname", prefix);
|
||||
ret = dict_get_str (dict, key, &hostname);
|
||||
if (ret) {
|
||||
@ -797,7 +793,6 @@ gd_update_peerinfo_from_dict (glusterd_peerinfo_t *peerinfo, dict_t *dict,
|
||||
goto out;
|
||||
}
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.address-count", prefix);
|
||||
ret = dict_get_int32 (dict, key, &count);
|
||||
if (ret) {
|
||||
@ -808,7 +803,6 @@ gd_update_peerinfo_from_dict (glusterd_peerinfo_t *peerinfo, dict_t *dict,
|
||||
}
|
||||
hostname = NULL;
|
||||
for (i = 0; i < count; i++) {
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.hostname%d",prefix, i);
|
||||
ret = dict_get_str (dict, key, &hostname);
|
||||
if (ret) {
|
||||
@ -916,7 +910,6 @@ gd_add_peer_hostnames_to_dict (glusterd_peerinfo_t *peerinfo, dict_t *dict,
|
||||
GF_VALIDATE_OR_GOTO (this->name, (prefix != NULL), out);
|
||||
|
||||
cds_list_for_each_entry (addr, &peerinfo->hostnames, hostname_list) {
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.hostname%d", prefix, count);
|
||||
ret = dict_set_dynstr_with_alloc (dict, key, addr->hostname);
|
||||
if (ret)
|
||||
@ -924,7 +917,6 @@ gd_add_peer_hostnames_to_dict (glusterd_peerinfo_t *peerinfo, dict_t *dict,
|
||||
count++;
|
||||
}
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.hostname_count", prefix);
|
||||
ret = dict_set_int32 (dict, key, count);
|
||||
|
||||
@ -950,38 +942,32 @@ gd_add_peer_detail_to_dict (glusterd_peerinfo_t *peerinfo, dict_t *friends,
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "friend%d.hostname", count);
|
||||
ret = dict_set_str (friends, key, peerinfo->hostname);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "friend%d.port", count);
|
||||
ret = dict_set_int32 (friends, key, peerinfo->port);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "friend%d.stateId", count);
|
||||
ret = dict_set_int32 (friends, key, peerinfo->state.state);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "friend%d.state", count);
|
||||
ret = dict_set_str (friends, key,
|
||||
glusterd_friend_sm_state_name_get(peerinfo->state.state));
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "friend%d.connected", count);
|
||||
ret = dict_set_int32 (friends, key, (int32_t)peerinfo->connected);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "friend%d", count);
|
||||
ret = gd_add_peer_hostnames_to_dict (peerinfo, friends, key);
|
||||
|
||||
|
@ -132,7 +132,6 @@ glusterd_quotadsvc_start (glusterd_svc_t *svc, int flags)
|
||||
goto out;
|
||||
|
||||
for (i = 0; options[i]; i++) {
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "arg%d", i);
|
||||
ret = dict_set_str (cmdline, key, options[i]);
|
||||
if (ret)
|
||||
|
@ -562,7 +562,6 @@ glusterd_ac_send_friend_update (glusterd_friend_sm_event_t *event, void *ctx)
|
||||
|
||||
count++;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "friend%d", count);
|
||||
ret = gd_add_friend_to_dict (peerinfo, friends, key);
|
||||
if (ret)
|
||||
@ -666,7 +665,6 @@ glusterd_ac_update_friend (glusterd_friend_sm_event_t *event, void *ctx)
|
||||
|
||||
count++;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "friend%d", count);
|
||||
ret = gd_add_friend_to_dict (peerinfo, friends, key);
|
||||
if (ret)
|
||||
|
@ -483,7 +483,6 @@ gd_add_brick_snap_details_to_dict (dict_t *dict, char *prefix,
|
||||
goto out;
|
||||
}
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.device_path", prefix);
|
||||
ret = dict_set_str (dict, key, brickinfo->device_path);
|
||||
if (ret) {
|
||||
@ -514,7 +513,6 @@ gd_add_brick_snap_details_to_dict (dict_t *dict, char *prefix,
|
||||
goto out;
|
||||
}
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.mount_dir", prefix);
|
||||
ret = dict_set_str (dict, key, brickinfo->mount_dir);
|
||||
if (ret)
|
||||
@ -567,7 +565,6 @@ gd_add_vol_snap_details_to_dict (dict_t *dict, char *prefix,
|
||||
}
|
||||
|
||||
if (strlen (volinfo->parent_volname) > 0) {
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.parent_volname", prefix);
|
||||
ret = dict_set_dynstr_with_alloc (dict, key,
|
||||
volinfo->parent_volname);
|
||||
@ -579,7 +576,6 @@ gd_add_vol_snap_details_to_dict (dict_t *dict, char *prefix,
|
||||
}
|
||||
}
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.is_snap_volume", prefix);
|
||||
ret = dict_set_uint32 (dict, key, volinfo->is_snap_volume);
|
||||
if (ret) {
|
||||
@ -589,7 +585,6 @@ gd_add_vol_snap_details_to_dict (dict_t *dict, char *prefix,
|
||||
goto out;
|
||||
}
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.snap-max-hard-limit", prefix);
|
||||
ret = dict_set_uint64 (dict, key, volinfo->snap_max_hard_limit);
|
||||
if (ret) {
|
||||
@ -891,7 +886,6 @@ gd_import_new_brick_snap_details (dict_t *dict, char *prefix,
|
||||
goto out;
|
||||
}
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.device_path", prefix);
|
||||
ret = dict_get_str (dict, key, &snap_device);
|
||||
if (ret) {
|
||||
@ -919,7 +913,6 @@ gd_import_new_brick_snap_details (dict_t *dict, char *prefix,
|
||||
}
|
||||
gf_strncpy (brickinfo->mnt_opts, mnt_opts, sizeof(brickinfo->mnt_opts));
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.mount_dir", prefix);
|
||||
ret = dict_get_str (dict, key, &mount_dir);
|
||||
if (ret) {
|
||||
@ -978,7 +971,6 @@ gd_import_volume_snap_details (dict_t *dict, glusterd_volinfo_t *volinfo,
|
||||
}
|
||||
volinfo->is_snap_volume = (is_snap_int != 0);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.restored_from_snap", prefix);
|
||||
ret = dict_get_str (dict, key, &restored_snap);
|
||||
if (ret) {
|
||||
@ -990,7 +982,6 @@ gd_import_volume_snap_details (dict_t *dict, glusterd_volinfo_t *volinfo,
|
||||
|
||||
gf_uuid_parse (restored_snap, volinfo->restored_from_snap);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.snap-max-hard-limit", prefix);
|
||||
ret = dict_get_uint64 (dict, key,
|
||||
&volinfo->snap_max_hard_limit);
|
||||
@ -2228,7 +2219,6 @@ glusterd_add_snapd_to_dict (glusterd_volinfo_t *volinfo,
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.port", base_key);
|
||||
ret = dict_set_int32 (dict, key, volinfo->snapd.port);
|
||||
if (ret)
|
||||
@ -2240,13 +2230,11 @@ glusterd_add_snapd_to_dict (glusterd_volinfo_t *volinfo,
|
||||
if (brick_online == _gf_false)
|
||||
pid = -1;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.pid", base_key);
|
||||
ret = dict_set_int32 (dict, key, pid);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.status", base_key);
|
||||
ret = dict_set_int32 (dict, key, brick_online);
|
||||
|
||||
|
@ -1540,7 +1540,6 @@ glusterd_snap_create_clone_pre_val_use_rsp_dict (dict_t *dst, dict_t *src)
|
||||
}
|
||||
|
||||
for (i = 0; i < volume_count; i++) {
|
||||
memset (snapbrckcnt, '\0', sizeof(snapbrckcnt));
|
||||
ret = snprintf (snapbrckcnt, sizeof(snapbrckcnt) - 1,
|
||||
"vol%"PRId64"_brickcount", i+1);
|
||||
ret = dict_get_int64 (src, snapbrckcnt, &brick_count);
|
||||
|
@ -315,7 +315,6 @@ gd_store_brick_snap_details_write (int fd, glusterd_brickinfo_t *brickinfo)
|
||||
}
|
||||
|
||||
if (strlen(brickinfo->mount_dir) > 0) {
|
||||
memset (value, 0, sizeof (value));
|
||||
snprintf (value, sizeof(value), "%s", brickinfo->mount_dir);
|
||||
ret = gf_store_save_value (fd,
|
||||
GLUSTERD_STORE_KEY_BRICK_MOUNT_DIR, value);
|
||||
@ -347,14 +346,12 @@ gd_store_brick_snap_details_write (int fd, glusterd_brickinfo_t *brickinfo)
|
||||
}
|
||||
}
|
||||
|
||||
memset (value, 0, sizeof (value));
|
||||
snprintf (value, sizeof(value), "%d", brickinfo->snap_status);
|
||||
ret = gf_store_save_value (fd, GLUSTERD_STORE_KEY_BRICK_SNAP_STATUS,
|
||||
value);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
memset (value, 0, sizeof (value));
|
||||
snprintf (value, sizeof (value), "%lu", brickinfo->statfs_fsid);
|
||||
ret = gf_store_save_value (fd, GLUSTERD_STORE_KEY_BRICK_FSID, value);
|
||||
|
||||
@ -828,7 +825,6 @@ glusterd_volume_write_snap_details (int fd, glusterd_volinfo_t *volinfo)
|
||||
goto out;
|
||||
}
|
||||
|
||||
memset (buf, 0, sizeof (buf));
|
||||
snprintf (buf, sizeof (buf), "%"PRIu64, volinfo->snap_max_hard_limit);
|
||||
ret = gf_store_save_value (fd, GLUSTERD_STORE_KEY_SNAP_MAX_HARD_LIMIT,
|
||||
buf);
|
||||
@ -4931,7 +4927,6 @@ glusterd_store_save_quota_version_and_cksum (glusterd_volinfo_t *volinfo)
|
||||
goto out;
|
||||
}
|
||||
|
||||
memset (buf, 0, sizeof (buf));
|
||||
snprintf (buf, sizeof (buf)-1, "%u", volinfo->quota_conf_version);
|
||||
ret = gf_store_save_value (fd, "version", buf);
|
||||
if (ret) {
|
||||
|
@ -1138,7 +1138,6 @@ glusterd_add_tierd_to_dict (glusterd_volinfo_t *volinfo,
|
||||
* an zero value to parse.
|
||||
* */
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.port", base_key);
|
||||
ret = dict_set_int32 (dict, key, 0);
|
||||
if (ret)
|
||||
@ -1148,13 +1147,11 @@ glusterd_add_tierd_to_dict (glusterd_volinfo_t *volinfo,
|
||||
|
||||
brick_online = gf_is_service_running (pidfile, &pid);
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.pid", base_key);
|
||||
ret = dict_set_int32 (dict, key, pid);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "%s.status", base_key);
|
||||
ret = dict_set_int32 (dict, key, brick_online);
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1587,7 +1587,6 @@ gfproxy_server_graph_builder (volgen_graph_t *graph,
|
||||
return -1;
|
||||
}
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
if (password) {
|
||||
snprintf (key, sizeof (key), "auth.login.%s.password",
|
||||
username);
|
||||
@ -1596,7 +1595,6 @@ gfproxy_server_graph_builder (volgen_graph_t *graph,
|
||||
goto out;
|
||||
}
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "gfproxyd-%s", volinfo->volname);
|
||||
ret = xlator_set_option (xl, "auth-path", key);
|
||||
|
||||
@ -2532,7 +2530,6 @@ brick_graph_add_server (volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
|
||||
}
|
||||
|
||||
if (username) {
|
||||
memset (key, 0, sizeof (key));
|
||||
len = snprintf (key, sizeof (key), "auth.login.%s.allow",
|
||||
brickinfo->path);
|
||||
if ((len < 0) || (len >= sizeof(key))) {
|
||||
@ -2545,7 +2542,6 @@ brick_graph_add_server (volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
|
||||
}
|
||||
|
||||
if (password) {
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "auth.login.%s.password",
|
||||
username);
|
||||
|
||||
@ -2554,7 +2550,6 @@ brick_graph_add_server (volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
|
||||
return -1;
|
||||
}
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "auth-path");
|
||||
|
||||
ret = xlator_set_option (xl, key, brickinfo->path);
|
||||
@ -2566,7 +2561,6 @@ brick_graph_add_server (volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
|
||||
|
||||
|
||||
if (volname && !strcmp (volname, GLUSTER_SHARED_STORAGE)) {
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "strict-auth-accept");
|
||||
|
||||
ret = xlator_set_option (xl, key, "true");
|
||||
@ -2575,7 +2569,6 @@ brick_graph_add_server (volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
|
||||
}
|
||||
|
||||
if (dict_get_str (volinfo->dict, "auth.ssl-allow", &ssl_user) == 0) {
|
||||
memset (key, 0, sizeof (key));
|
||||
len = snprintf (key, sizeof (key), "auth.login.%s.ssl-allow",
|
||||
brickinfo->path);
|
||||
if ((len < 0) || (len >= sizeof(key))) {
|
||||
|
@ -1664,7 +1664,6 @@ nfs_priv_to_dict (xlator_t *this, dict_t *dict, char *brickname)
|
||||
if (!_nfs_export_is_for_vol (mentry->exname, volname))
|
||||
continue;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "client%d.hostname", count);
|
||||
ret = dict_set_str (dict, key, mentry->hostname);
|
||||
if (ret) {
|
||||
@ -1677,7 +1676,6 @@ nfs_priv_to_dict (xlator_t *this, dict_t *dict, char *brickname)
|
||||
/* No connection data available yet in nfs server.
|
||||
* Hence, setting to 0 to prevent cli failing
|
||||
*/
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "client%d.bytesread", count);
|
||||
ret = dict_set_uint64 (dict, key, 0);
|
||||
if (ret) {
|
||||
@ -1687,7 +1685,6 @@ nfs_priv_to_dict (xlator_t *this, dict_t *dict, char *brickname)
|
||||
goto out;
|
||||
}
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "client%d.byteswrite", count);
|
||||
ret = dict_set_uint64 (dict, key, 0);
|
||||
if (ret) {
|
||||
|
@ -5535,7 +5535,7 @@ nfs3_init_subvolume_options (xlator_t *nfsx,
|
||||
if (gf_nfs_dvm_off (nfs_state (nfsx)))
|
||||
goto no_dvm;
|
||||
|
||||
ret = snprintf (searchkey, 1024, "nfs3.%s.volume-id",exp->subvol->name);
|
||||
ret = snprintf (searchkey, sizeof (searchkey), "nfs3.%s.volume-id",exp->subvol->name);
|
||||
if (ret < 0) {
|
||||
gf_msg (GF_MNT, GF_LOG_ERROR, 0, NFS_MSG_SNPRINTF_FAIL,
|
||||
"snprintf failed");
|
||||
@ -5574,7 +5574,7 @@ nfs3_init_subvolume_options (xlator_t *nfsx,
|
||||
no_dvm:
|
||||
/* Volume Access */
|
||||
name = exp->subvol->name;
|
||||
ret = snprintf (searchkey, 1024, "nfs3.%s.volume-access", name);
|
||||
ret = snprintf (searchkey, sizeof (searchkey), "nfs3.%s.volume-access", name);
|
||||
if (ret < 0) {
|
||||
gf_msg (GF_NFS3, GF_LOG_ERROR, 0, NFS_MSG_SNPRINTF_FAIL,
|
||||
"snprintf failed");
|
||||
@ -5596,7 +5596,7 @@ no_dvm:
|
||||
exp->access = GF_NFS3_VOLACCESS_RO;
|
||||
}
|
||||
|
||||
ret = snprintf (searchkey, 1024, "rpc-auth.%s.unix", name);
|
||||
ret = snprintf (searchkey, sizeof (searchkey), "rpc-auth.%s.unix", name);
|
||||
if (ret < 0) {
|
||||
gf_msg (GF_NFS3, GF_LOG_ERROR, 0, NFS_MSG_SNPRINTF_FAIL,
|
||||
"snprintf failed");
|
||||
@ -5615,7 +5615,7 @@ no_dvm:
|
||||
}
|
||||
|
||||
exp->trusted_sync = 0;
|
||||
ret = snprintf (searchkey, 1024, "nfs3.%s.trusted-sync", name);
|
||||
ret = snprintf (searchkey, sizeof (searchkey), "nfs3.%s.trusted-sync", name);
|
||||
if (ret < 0) {
|
||||
gf_msg (GF_NFS3, GF_LOG_ERROR, 0, NFS_MSG_SNPRINTF_FAIL,
|
||||
"snprintf failed");
|
||||
@ -5646,7 +5646,7 @@ no_dvm:
|
||||
}
|
||||
|
||||
exp->trusted_write = 0;
|
||||
ret = snprintf (searchkey, 1024, "nfs3.%s.trusted-write", name);
|
||||
ret = snprintf (searchkey, sizeof (searchkey), "nfs3.%s.trusted-write", name);
|
||||
if (ret < 0) {
|
||||
gf_msg (GF_NFS3, GF_LOG_ERROR, 0, NFS_MSG_SNPRINTF_FAIL,
|
||||
"snprintf failed");
|
||||
|
@ -193,7 +193,6 @@ server_priv_to_dict (xlator_t *this, dict_t *dict, char *brickname)
|
||||
(!strcmp (brickname,
|
||||
xprt->xl_private->bound_xl->name))) {
|
||||
peerinfo = &xprt->peerinfo;
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key),
|
||||
"client%d.hostname",
|
||||
count);
|
||||
@ -202,7 +201,6 @@ server_priv_to_dict (xlator_t *this, dict_t *dict, char *brickname)
|
||||
if (ret)
|
||||
goto unlock;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key),
|
||||
"client%d.bytesread",
|
||||
count);
|
||||
@ -211,7 +209,6 @@ server_priv_to_dict (xlator_t *this, dict_t *dict, char *brickname)
|
||||
if (ret)
|
||||
goto unlock;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key),
|
||||
"client%d.byteswrite",
|
||||
count);
|
||||
@ -220,7 +217,6 @@ server_priv_to_dict (xlator_t *this, dict_t *dict, char *brickname)
|
||||
if (ret)
|
||||
goto unlock;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key),
|
||||
"client%d.opversion",
|
||||
count);
|
||||
@ -229,7 +225,6 @@ server_priv_to_dict (xlator_t *this, dict_t *dict, char *brickname)
|
||||
if (ret)
|
||||
goto unlock;
|
||||
|
||||
memset (key, 0, sizeof (key));
|
||||
snprintf (key, sizeof (key), "client%d.name",
|
||||
count);
|
||||
ret = dict_set_str (dict, key,
|
||||
|
Loading…
x
Reference in New Issue
Block a user