]> sourceware.org Git - lvm2.git/commitdiff
Fix chunksize field in reports.
authorAlasdair Kergon <agk@redhat.com>
Fri, 23 Sep 2005 17:06:01 +0000 (17:06 +0000)
committerAlasdair Kergon <agk@redhat.com>
Fri, 23 Sep 2005 17:06:01 +0000 (17:06 +0000)
WHATS_NEW
lib/report/columns.h
lib/report/report.c
tools/reporter.c

index 95d7ec454c773a63abff1e8f0daddd3031e5a654..286d3cb489ea28f09f89cfae1db20af5fee83cb4 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -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.
index 3207f78d07e50e3b2e9715114ae674210bf44438..9ff748e916aac780c113f37715363d3da811e47f 100644 (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")
index d4f6129f540dbd295d5ec3cc4c4a1879e424a9b2..2e9206c8913faa63760d33fb951bc8d1c6a41783 100644 (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)
 {
index 4cee509cc84896a093e557c441969ceb50358ad9..d7ab9ccf7358b2fa1208bebac949aaa7f260f798 100644 (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);
This page took 0.043874 seconds and 5 git commands to generate.