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

Append z to lv_attr if new blocks will be zeroed.

This commit is contained in:
Alasdair Kergon 2011-09-09 01:15:18 +00:00
parent dbb48de507
commit 5081181b5d
4 changed files with 13 additions and 3 deletions

View File

@ -308,9 +308,10 @@ char *lv_attr_dup(struct dm_pool *mem, const struct logical_volume *lv)
{
percent_t snap_percent;
struct lvinfo info;
struct lv_segment *seg;
char *repstr;
if (!(repstr = dm_pool_zalloc(mem, 8))) {
if (!(repstr = dm_pool_zalloc(mem, 9))) {
log_error("dm_pool_alloc failed");
return 0;
}
@ -405,6 +406,13 @@ char *lv_attr_dup(struct dm_pool *mem, const struct logical_volume *lv)
else
repstr[6] = '-';
if ((lv_is_thin_volume(lv) && (seg = first_seg(lv)) && seg->pool_lv && (seg = first_seg(seg->pool_lv))) ||
(lv_is_thin_pool(lv) && (seg = first_seg(lv))) &&
seg->zero_new_blocks)
repstr[7] = 'z';
else
repstr[7] = '-';
out:
return repstr;
}

View File

@ -372,7 +372,7 @@ struct pv_list *find_pv_in_pv_list(const struct dm_list *pl,
struct lv_segment *find_seg_by_le(const struct logical_volume *lv, uint32_t le);
/* Find pool LV segment given a thin pool data or metadata segment. */
struct lv_segment *find_pool_seg(struct lv_segment *seg);
struct lv_segment *find_pool_seg(const struct lv_segment *seg);
/*
* Remove a dev_dir if present.

View File

@ -61,7 +61,7 @@ int detach_pool_lv(struct lv_segment *seg)
return remove_seg_from_segs_using_this_lv(seg->pool_lv, seg);
}
struct lv_segment *find_pool_seg(struct lv_segment *seg)
struct lv_segment *find_pool_seg(const struct lv_segment *seg)
{
struct lv_segment *pool_seg;

View File

@ -94,6 +94,8 @@ for example, mirror images, mirror logs as well as mirrors themselves appear as
equivalents using the md raid kernel driver all appear as (r).
Snapshots using the original device-mapper driver appear as (s); whereas
snapshots of thin volumes using the new thin provisioning driver appear as (t).
.IP 8 3
Newly-allocated data blocks are overwritten with blocks of (z)eroes before use.
.RE
.TP
.I \-\-segments