1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-02 01:18:26 +03:00

Fix chunksize field in reports.

This commit is contained in:
Alasdair Kergon 2005-09-23 17:06:01 +00:00
parent 540b379902
commit 88d2bdc668
4 changed files with 21 additions and 3 deletions

View File

@ -1,5 +1,6 @@
Version 2.01.15 -
=================================
Fix chunksize field in reports.
Don't hide snapshots from default 'lvs' output.
Add is_dm_major() for use in duplicate device detection in lvmcache_add().
Really switch device number in lvmcache when it says it is doing so.

View File

@ -49,7 +49,7 @@ FIELD(PVS, pv, STR, "PV Tags", tags, 7, tags, "pv_tags")
FIELD(VGS, vg, STR, "Fmt", cmd, 3, vgfmt, "vg_fmt")
FIELD(VGS, vg, STR, "VG UUID", id, 38, uuid, "vg_uuid")
FIELD(VGS, vg, STR, "VG", name, 4, string, "vg_name")
FIELD(VGS, vg, STR, "Attr", cmd, 6, vgstatus, "vg_attr")
FIELD(VGS, vg, STR, "Attr", cmd, 5, vgstatus, "vg_attr")
FIELD(VGS, vg, NUM, "VSize", cmd, 5, vgsize, "vg_size")
FIELD(VGS, vg, NUM, "VFree", cmd, 5, vgfree, "vg_free")
FIELD(VGS, vg, STR, "SYS ID", system_id, 6, string, "vg_sysid")
@ -67,7 +67,7 @@ FIELD(VGS, vg, STR, "VG Tags", tags, 7, tags, "vg_tags")
FIELD(SEGS, seg, STR, "Type", list, 4, segtype, "segtype")
FIELD(SEGS, seg, NUM, "#Str", area_count, 4, uint32, "stripes")
FIELD(SEGS, seg, NUM, "Stripe", stripe_size, 6, size32, "stripesize")
FIELD(SEGS, seg, NUM, "Chunk", chunk_size, 5, size32, "chunksize")
FIELD(SEGS, seg, NUM, "Chunk", list, 5, chunksize, "chunksize")
FIELD(SEGS, seg, NUM, "Region", region_size, 6, size32, "regionsize")
FIELD(SEGS, seg, NUM, "Start", list, 5, segstart, "seg_start")
FIELD(SEGS, seg, NUM, "SSize", list, 5, segsize, "seg_size")

View File

@ -660,6 +660,21 @@ static int _segsize_disp(struct report_handle *rh, struct field *field,
return _size64_disp(rh, field, &size);
}
static int _chunksize_disp(struct report_handle *rh, struct field *field,
const void *data)
{
const struct lv_segment *seg = (const struct lv_segment *) data;
struct lv_segment *snap_seg;
uint64_t size;
if ((snap_seg = find_cow(seg->lv)))
size = (uint64_t) snap_seg->chunk_size;
else
size = 0;
return _size64_disp(rh, field, &size);
}
static int _pvused_disp(struct report_handle *rh, struct field *field,
const void *data)
{

View File

@ -83,7 +83,9 @@ static int _pvsegs_sub_single(struct cmd_context *cmd, struct volume_group *vg,
static int _lvsegs_single(struct cmd_context *cmd, struct logical_volume *lv,
void *handle)
{
if (!arg_count(cmd, all_ARG) && !(lv->status & VISIBLE_LV))
/* FIXME Avoid snapshot special-case */
if (!arg_count(cmd, all_ARG) && !(lv->status & VISIBLE_LV) &&
!(lv_is_cow(lv)))
return ECMD_PROCESSED;
return process_each_segment_in_lv(cmd, lv, handle, _segs_single);