Consolidate modules
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
This commit is contained in:
@@ -2508,34 +2508,6 @@ int cas_module_version(char *buff, int size)
|
||||
}
|
||||
}
|
||||
|
||||
int disk_module_version(char *buff, int size)
|
||||
{
|
||||
FILE *fd;
|
||||
int n_read;
|
||||
|
||||
if (size <= 0 || size > MAX_STR_LEN) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
fd = fopen("/sys/module/cas_disk/version", "r");
|
||||
if (!fd) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
n_read = fread(buff, 1, size, fd);
|
||||
if (ferror(fd)) {
|
||||
n_read = 0;
|
||||
}
|
||||
fclose(fd);
|
||||
|
||||
if (n_read > 0) {
|
||||
buff[n_read - 1] = '\0';
|
||||
return SUCCESS;
|
||||
} else {
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
float calculate_flush_progress(unsigned dirty, unsigned flushed)
|
||||
{
|
||||
unsigned total_dirty;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright(c) 2012-2021 Intel Corporation
|
||||
* Copyright(c) 2012-2022 Intel Corporation
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
@@ -279,7 +279,6 @@ int partition_setup(unsigned int cache_id, const char *file);
|
||||
int partition_is_name_valid(const char *name);
|
||||
|
||||
int cas_module_version(char *buff, int size);
|
||||
int disk_module_version(char *buff, int size);
|
||||
int list_caches(unsigned int list_format, bool by_id_path);
|
||||
int cache_status(unsigned int cache_id, unsigned int core_id, int io_class_id,
|
||||
unsigned int stats_filters, unsigned int stats_format, bool by_id_path);
|
||||
|
@@ -1849,13 +1849,6 @@ static int handle_version(void)
|
||||
fprintf(intermediate_file[1], "%s\n", buff);
|
||||
}
|
||||
|
||||
fprintf(intermediate_file[1], TAG(TABLE_ROW) OCF_LOGO " Disk Kernel Module,");
|
||||
if (disk_module_version(buff, MAX_STR_LEN)) {
|
||||
fprintf(intermediate_file[1], "Not Loaded\n");
|
||||
} else {
|
||||
fprintf(intermediate_file[1], "%s\n", buff);
|
||||
}
|
||||
|
||||
fprintf(intermediate_file[1], TAG(TABLE_ROW) OCF_LOGO " CLI Utility,");
|
||||
fprintf(intermediate_file[1], "%s\n", CAS_VERSION);
|
||||
|
||||
|
Reference in New Issue
Block a user