Do not print exported object path if it was removed
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
This commit is contained in:
parent
92cc06766d
commit
fd1b2dc121
@ -2751,6 +2751,7 @@ int list_caches(unsigned int list_format, bool by_id_path)
|
|||||||
char status_buf[CACHE_STATE_LENGHT];
|
char status_buf[CACHE_STATE_LENGHT];
|
||||||
const char *tmp_status;
|
const char *tmp_status;
|
||||||
char mode_string[12];
|
char mode_string[12];
|
||||||
|
char exp_obj[32];
|
||||||
char cache_ctrl_dev[MAX_STR_LEN] = "-";
|
char cache_ctrl_dev[MAX_STR_LEN] = "-";
|
||||||
float cache_flush_prog;
|
float cache_flush_prog;
|
||||||
float core_flush_prog;
|
float core_flush_prog;
|
||||||
@ -2815,15 +2816,17 @@ int list_caches(unsigned int list_format, bool by_id_path)
|
|||||||
tmp_status = get_core_state_name(curr_core->info.state);
|
tmp_status = get_core_state_name(curr_core->info.state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
snprintf(exp_obj, sizeof(exp_obj), "/dev/cas%d-%d",
|
||||||
|
curr_cache->id, curr_core->id);
|
||||||
|
|
||||||
fprintf(intermediate_file[1], TAG(TREE_LEAF)
|
fprintf(intermediate_file[1], TAG(TREE_LEAF)
|
||||||
"%s,%u,%s,%s,%s,/dev/cas%d-%d\n",
|
"%s,%u,%s,%s,%s,%s\n",
|
||||||
"core", /* type */
|
"core", /* type */
|
||||||
curr_core->id, /* id */
|
curr_core->id, /* id */
|
||||||
core_path, /* path to core*/
|
core_path, /* path to core*/
|
||||||
tmp_status, /* core status */
|
tmp_status, /* core status */
|
||||||
"-", /* write policy */
|
"-", /* write policy */
|
||||||
curr_cache->id, /* core id (part of path)*/
|
curr_core->info.exp_obj_exists ? exp_obj : "-" /* exported object path */);
|
||||||
curr_core->id /* cache id (part of path)*/ );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -188,15 +188,19 @@ static void print_core_conf(const struct kcas_core_info *info, FILE *outfile)
|
|||||||
{
|
{
|
||||||
uint64_t core_size;
|
uint64_t core_size;
|
||||||
float core_size_gb;
|
float core_size_gb;
|
||||||
|
char exp_obj[32];
|
||||||
|
|
||||||
core_size = info->info.core_size_bytes / KiB / 4;
|
core_size = info->info.core_size_bytes / KiB / 4;
|
||||||
core_size_gb = calc_gb(core_size);
|
core_size_gb = calc_gb(core_size);
|
||||||
|
|
||||||
|
snprintf(exp_obj, sizeof(exp_obj), "/dev/cas%d-%d",
|
||||||
|
info->cache_id, info->core_id);
|
||||||
|
|
||||||
print_kv_pair(outfile, "Core Id", "%i", info->core_id);
|
print_kv_pair(outfile, "Core Id", "%i", info->core_id);
|
||||||
print_kv_pair(outfile, "Core Device", "%s",
|
print_kv_pair(outfile, "Core Device", "%s",
|
||||||
info->core_path_name);
|
info->core_path_name);
|
||||||
print_kv_pair(outfile, "Exported Object", "/dev/cas%d-%d",
|
print_kv_pair(outfile, "Exported Object", "%s",
|
||||||
info->cache_id, info->core_id);
|
info->exp_obj_exists ? exp_obj : "-");
|
||||||
print_kv_pair(outfile, "Core Size", "%lu, [" UNIT_BLOCKS "], %.2f, [GiB]",
|
print_kv_pair(outfile, "Core Size", "%lu, [" UNIT_BLOCKS "], %.2f, [GiB]",
|
||||||
core_size, core_size_gb);
|
core_size, core_size_gb);
|
||||||
print_kv_pair_time(outfile, "Dirty for", info->info.dirty_for);
|
print_kv_pair_time(outfile, "Dirty for", info->info.dirty_for);
|
||||||
|
@ -1567,7 +1567,7 @@ int cache_mngt_remove_core_from_cache(struct kcas_remove_core *cmd)
|
|||||||
|
|
||||||
wait_for_completion(&context.cmpl);
|
wait_for_completion(&context.cmpl);
|
||||||
|
|
||||||
if (!result && !cmd->detach)
|
if (result != -OCF_ERR_CORE_NOT_REMOVED && !cmd->detach)
|
||||||
mark_core_id_free(cache, cmd->core_id);
|
mark_core_id_free(cache, cmd->core_id);
|
||||||
|
|
||||||
unlock:
|
unlock:
|
||||||
@ -3123,6 +3123,8 @@ int cache_mngt_get_core_info(struct kcas_core_info *info)
|
|||||||
ocf_cache_t cache;
|
ocf_cache_t cache;
|
||||||
ocf_core_t core;
|
ocf_core_t core;
|
||||||
const struct ocf_volume_uuid *uuid;
|
const struct ocf_volume_uuid *uuid;
|
||||||
|
ocf_volume_t vol;
|
||||||
|
struct bd_object *bdvol;
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
result = mngt_get_cache_by_id(cas_ctx, info->cache_id, &cache);
|
result = mngt_get_cache_by_id(cas_ctx, info->cache_id, &cache);
|
||||||
@ -3152,6 +3154,10 @@ int cache_mngt_get_core_info(struct kcas_core_info *info)
|
|||||||
|
|
||||||
info->state = ocf_core_get_state(core);
|
info->state = ocf_core_get_state(core);
|
||||||
|
|
||||||
|
vol = ocf_core_get_volume(core);
|
||||||
|
bdvol = bd_object(vol);
|
||||||
|
info->exp_obj_exists = bdvol->expobj_valid;
|
||||||
|
|
||||||
unlock:
|
unlock:
|
||||||
ocf_mngt_cache_read_unlock(cache);
|
ocf_mngt_cache_read_unlock(cache);
|
||||||
put:
|
put:
|
||||||
|
@ -205,6 +205,8 @@ struct kcas_core_info {
|
|||||||
|
|
||||||
ocf_core_state_t state;
|
ocf_core_state_t state;
|
||||||
|
|
||||||
|
bool exp_obj_exists;
|
||||||
|
|
||||||
int ext_err_code;
|
int ext_err_code;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -393,7 +395,7 @@ struct kcas_standby_activate
|
|||||||
* 22 * KCAS_IOCTL_INSERT_CORE * OK *
|
* 22 * KCAS_IOCTL_INSERT_CORE * OK *
|
||||||
* 23 * KCAS_IOCTL_REMOVE_CORE * OK *
|
* 23 * KCAS_IOCTL_REMOVE_CORE * OK *
|
||||||
* 24 * KCAS_IOCTL_CACHE_INFO * OK *
|
* 24 * KCAS_IOCTL_CACHE_INFO * OK *
|
||||||
* 25 * KCAS_IOCTL_CORE_INFO * OK *
|
* 25 * KCAS_IOCTL_CORE_INFO * DEPERCATED *
|
||||||
* 26 * KCAS_IOCTL_GET_CORE_POOL_COUNT * OK *
|
* 26 * KCAS_IOCTL_GET_CORE_POOL_COUNT * OK *
|
||||||
* 27 * KCAS_IOCTL_GET_CORE_POOL_PATHS * OK *
|
* 27 * KCAS_IOCTL_GET_CORE_POOL_PATHS * OK *
|
||||||
* 28 * KCAS_IOCTL_CORE_POOL_REMOVE * OK *
|
* 28 * KCAS_IOCTL_CORE_POOL_REMOVE * OK *
|
||||||
@ -408,6 +410,7 @@ struct kcas_standby_activate
|
|||||||
* 37 * KCAS_IOCTL_REMOVE_INACTIVE * OK *
|
* 37 * KCAS_IOCTL_REMOVE_INACTIVE * OK *
|
||||||
* 38 * KCAS_IOCTL_STANDBY_DETACH * OK *
|
* 38 * KCAS_IOCTL_STANDBY_DETACH * OK *
|
||||||
* 39 * KCAS_IOCTL_STANDBY_ACTIVATE * OK *
|
* 39 * KCAS_IOCTL_STANDBY_ACTIVATE * OK *
|
||||||
|
* 40 * KCAS_IOCTL_CORE_INFO * OK *
|
||||||
*******************************************************************************
|
*******************************************************************************
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -459,9 +462,6 @@ struct kcas_standby_activate
|
|||||||
/** Retrieve properties of a running cache instance (incl. mode etc.) */
|
/** Retrieve properties of a running cache instance (incl. mode etc.) */
|
||||||
#define KCAS_IOCTL_CACHE_INFO _IOWR(KCAS_IOCTL_MAGIC, 24, struct kcas_cache_info)
|
#define KCAS_IOCTL_CACHE_INFO _IOWR(KCAS_IOCTL_MAGIC, 24, struct kcas_cache_info)
|
||||||
|
|
||||||
/** Rretrieve statisting of a given core object */
|
|
||||||
#define KCAS_IOCTL_CORE_INFO _IOWR(KCAS_IOCTL_MAGIC, 25, struct kcas_core_info)
|
|
||||||
|
|
||||||
/** Get core pool count */
|
/** Get core pool count */
|
||||||
#define KCAS_IOCTL_GET_CORE_POOL_COUNT _IOR(KCAS_IOCTL_MAGIC, 26, struct kcas_core_pool_count)
|
#define KCAS_IOCTL_GET_CORE_POOL_COUNT _IOR(KCAS_IOCTL_MAGIC, 26, struct kcas_core_pool_count)
|
||||||
|
|
||||||
@ -506,6 +506,9 @@ struct kcas_standby_activate
|
|||||||
/** Activate failover standby cache instance */
|
/** Activate failover standby cache instance */
|
||||||
#define KCAS_IOCTL_STANDBY_ACTIVATE _IOWR(KCAS_IOCTL_MAGIC, 39, struct kcas_standby_activate)
|
#define KCAS_IOCTL_STANDBY_ACTIVATE _IOWR(KCAS_IOCTL_MAGIC, 39, struct kcas_standby_activate)
|
||||||
|
|
||||||
|
/** Rretrieve statisting of a given core object */
|
||||||
|
#define KCAS_IOCTL_CORE_INFO _IOWR(KCAS_IOCTL_MAGIC, 40, struct kcas_core_info)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extended kernel CAS error codes
|
* Extended kernel CAS error codes
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user