Merge pull request #35 from Open-CAS/kw-fixes-06-2019

Code cleanup
This commit is contained in:
Michał Wysoczański 2019-06-13 13:06:06 +02:00 committed by GitHub
commit a6a167359c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 13 deletions

View File

@ -1171,16 +1171,10 @@ int cache_status(unsigned int cache_id, unsigned int core_id, int io_class_id,
if (create_pipe_pair(intermediate_file)) {
cas_printf(LOG_ERR,"Failed to create unidirectional pipe.\n");
close(ctrl_fd);
return FAILURE;
}
/* Select file to which statistics shall be printed and
*
*/
FILE *outfile;
outfile = stdout;
/**
* printing in statistics will be performed in separate
* thread, so that we can interleave statistics collecting
@ -1188,7 +1182,7 @@ int cache_status(unsigned int cache_id, unsigned int core_id, int io_class_id,
*/
struct stats_printout_ctx printout_ctx;
printout_ctx.intermediate = intermediate_file[0];
printout_ctx.out = outfile;
printout_ctx.out = stdout;
printout_ctx.type = (OUTPUT_FORMAT_CSV == output_format ? CSV : TEXT);
pthread_t thread;
pthread_create(&thread, 0, stats_printout, &printout_ctx);
@ -1301,8 +1295,5 @@ cleanup:
fclose(intermediate_file[0]);
if (outfile != stdout) {
fclose(outfile);
}
return ret;
}

View File

@ -95,7 +95,6 @@ char *table_get(struct table *t,int y, int x)
static const char * empty="";
if (y >= t->height || x >= t->width) {
assert(0);
abort();
return (char*)empty;
}

View File

@ -694,7 +694,7 @@ void cas_cls_rule_apply(ocf_cache_t cache,
if (old)
CAS_CLS_DEBUG_MSG("Removed rule for class %d\n", part_id);
if (new)
CAS_CLS_DEBUG_MSG("New rule for for class %d\n", part_id);
CAS_CLS_DEBUG_MSG("New rule for class %d\n", part_id);
return;
}