mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
thin: move segment info display to correct code section
Relocate info from thin pool and thin volume segments to proper code section for segments. Add discards and thin count status info. Info is shown with 'lvdisplay --maps' (like for other segments).
This commit is contained in:
parent
71314a9905
commit
4c405a9b49
@ -1,5 +1,6 @@
|
||||
Version 2.02.107 -
|
||||
==================================
|
||||
Move segment thin pool/volume info into segment display 'lvdisplay --maps'.
|
||||
Display thin pool usage even when just thin volume is available.
|
||||
Display monitoring status for monitorable segments in 'lvdisplay --maps'.
|
||||
Display virtual extents for virtual LVs in 'lvdisplay --maps'.
|
||||
|
@ -509,7 +509,6 @@ int lvdisplay_full(struct cmd_context *cmd,
|
||||
if (lv_is_thin_volume(lv)) {
|
||||
seg = first_seg(lv);
|
||||
log_print("LV Pool name %s", seg->pool_lv->name);
|
||||
log_print("LV Thin device ID %u", seg->device_id);
|
||||
if (seg->origin)
|
||||
log_print("LV Thin origin name %s",
|
||||
seg->origin->name);
|
||||
@ -531,13 +530,8 @@ int lvdisplay_full(struct cmd_context *cmd,
|
||||
}
|
||||
/* FIXME: display thin_pool targets transid for activated LV as well */
|
||||
seg = first_seg(lv);
|
||||
log_print("LV Pool transaction ID %" PRIu64, seg->transaction_id);
|
||||
log_print("LV Pool metadata %s", seg->metadata_lv->name);
|
||||
log_print("LV Pool data %s", seg_lv(seg, 0)->name);
|
||||
log_print("LV Pool chunk size %s",
|
||||
display_size(cmd, seg->chunk_size));
|
||||
log_print("LV Zero new blocks %s",
|
||||
seg->zero_new_blocks ? "yes" : "no");
|
||||
}
|
||||
|
||||
if (inkernel && info.suspended)
|
||||
|
@ -13,6 +13,7 @@
|
||||
*/
|
||||
|
||||
#include "lib.h"
|
||||
#include "display.h"
|
||||
#include "metadata.h"
|
||||
#include "segtype.h"
|
||||
#include "text_export.h"
|
||||
@ -40,6 +41,20 @@ static const char *_thin_pool_name(const struct lv_segment *seg)
|
||||
return seg->segtype->name;
|
||||
}
|
||||
|
||||
static void _thin_pool_display(const struct lv_segment *seg)
|
||||
{
|
||||
log_print(" Chunk size\t\t%s",
|
||||
display_size(seg->lv->vg->cmd, seg->chunk_size));
|
||||
log_print(" Discards\t\t%s", get_pool_discards_name(seg->discards));
|
||||
log_print(" Thin count\t\t%u",
|
||||
dm_list_size(&seg->lv->segs_using_this_lv));
|
||||
log_print(" Transaction ID\t%" PRIu64, seg->transaction_id);
|
||||
log_print(" Zero new blocks\t%s",
|
||||
seg->zero_new_blocks ? "yes" : "no");
|
||||
|
||||
log_print(" ");
|
||||
}
|
||||
|
||||
static int _thin_pool_add_message(struct lv_segment *seg,
|
||||
const char *key,
|
||||
const struct dm_config_node *sn)
|
||||
@ -439,6 +454,13 @@ static const char *_thin_name(const struct lv_segment *seg)
|
||||
return seg->segtype->name;
|
||||
}
|
||||
|
||||
static void _thin_display(const struct lv_segment *seg)
|
||||
{
|
||||
log_print(" Device ID\t\t%u", seg->device_id);
|
||||
|
||||
log_print(" ");
|
||||
}
|
||||
|
||||
static int _thin_text_import(struct lv_segment *seg,
|
||||
const struct dm_config_node *sn,
|
||||
struct dm_hash_table *pv_hash __attribute__((unused)))
|
||||
@ -699,6 +721,7 @@ static void _thin_destroy(struct segment_type *segtype)
|
||||
|
||||
static struct segtype_handler _thin_pool_ops = {
|
||||
.name = _thin_pool_name,
|
||||
.display = _thin_pool_display,
|
||||
.text_import = _thin_pool_text_import,
|
||||
.text_import_area_count = _thin_pool_text_import_area_count,
|
||||
.text_export = _thin_pool_text_export,
|
||||
@ -720,6 +743,7 @@ static struct segtype_handler _thin_pool_ops = {
|
||||
|
||||
static struct segtype_handler _thin_ops = {
|
||||
.name = _thin_name,
|
||||
.display = _thin_display,
|
||||
.text_import = _thin_text_import,
|
||||
.text_export = _thin_text_export,
|
||||
#ifdef DEVMAPPER_SUPPORT
|
||||
|
Loading…
Reference in New Issue
Block a user