1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

Add dev_size column to pvs.

This commit is contained in:
Alasdair Kergon 2004-08-11 13:15:05 +00:00
parent 5fd24a89ec
commit a303dcde2a
4 changed files with 15 additions and 1 deletions

View File

@ -1,5 +1,6 @@
Version 2.00.21 -
=============================
Add dev_size column to pvs.
Add report columns for in-kernel device number.
Version 2.00.20 - 3 July 2004

View File

@ -98,7 +98,7 @@
#define DEFAULT_LVS_COLS_VERB "lv_name,vg_name,seg_count,lv_attr,lv_size,lv_major,lv_minor,lv_kernel_major,lv_kernel_minor,origin,snap_percent,move_pv,copy_percent,lv_uuid"
#define DEFAULT_VGS_COLS_VERB "vg_name,vg_attr,vg_extent_size,pv_count,lv_count,snap_count,vg_size,vg_free,vg_uuid"
#define DEFAULT_PVS_COLS_VERB "pv_name,vg_name,pv_fmt,pv_attr,pv_size,pv_free,pv_uuid"
#define DEFAULT_PVS_COLS_VERB "pv_name,vg_name,pv_fmt,pv_attr,pv_size,pv_free,dev_size,pv_uuid"
#define DEFAULT_SEGS_COLS_VERB "lv_name,vg_name,lv_attr,seg_start,seg_size,stripes,segtype,stripesize,chunksize"
#define DEFAULT_LVS_SORT "vg_name,lv_name"

View File

@ -36,6 +36,7 @@ FIELD(LVS, lv, STR, "LV Tags", tags, 7, tags, "lv_tags")
FIELD(PVS, pv, STR, "Fmt", id, 3, pvfmt, "pv_fmt")
FIELD(PVS, pv, STR, "PV UUID", id, 38, uuid, "pv_uuid")
FIELD(PVS, pv, NUM, "PSize", id, 5, pvsize, "pv_size")
FIELD(PVS, pv, NUM, "DevSize", dev, 7, devsize, "dev_size")
FIELD(PVS, pv, NUM, "PFree", id, 5, pvfree, "pv_free")
FIELD(PVS, pv, NUM, "Used", id, 4, pvused, "pv_used")
FIELD(PVS, pv, STR, "PV", dev, 10, dev_name, "pv_name")

View File

@ -645,6 +645,18 @@ static int _pvsize_disp(struct report_handle *rh, struct field *field,
return _size64_disp(rh, field, &size);
}
static int _devsize_disp(struct report_handle *rh, struct field *field,
const void *data)
{
const struct device *dev = *(const struct device **) data;
uint64_t size;
if (!dev_get_size(dev, &size))
size = 0;
return _size64_disp(rh, field, &size);
}
static int _vgfree_disp(struct report_handle *rh, struct field *field,
const void *data)
{