mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-09 01:18:39 +03:00
thin: add lvconvert pool metadata spare
Support poolmetadataspare when convering volumes into thin pool. Same rules applied as with lvcreate.
This commit is contained in:
parent
3075784955
commit
aab53f46ee
@ -170,6 +170,7 @@ xx(lvconvert,
|
|||||||
"\t[--poolmetadata ThinMetadataLogicalVolume[Path] |\n"
|
"\t[--poolmetadata ThinMetadataLogicalVolume[Path] |\n"
|
||||||
"\t [--poolmetadatasize size]\n"
|
"\t [--poolmetadatasize size]\n"
|
||||||
"\t [-r|--readahead ReadAheadSectors|auto|none]\n"
|
"\t [-r|--readahead ReadAheadSectors|auto|none]\n"
|
||||||
|
"\t [--poolmetadataspare {y|n}]\n"
|
||||||
"\t [--stripes Stripes [-I|--stripesize StripeSize]]]\n"
|
"\t [--stripes Stripes [-I|--stripesize StripeSize]]]\n"
|
||||||
"\t[-T|--thin ExternalLogicalVolume[Path]\n"
|
"\t[-T|--thin ExternalLogicalVolume[Path]\n"
|
||||||
"\t [--originname NewExternalOriginVolumeName]]\n"
|
"\t [--originname NewExternalOriginVolumeName]]\n"
|
||||||
@ -180,8 +181,9 @@ xx(lvconvert,
|
|||||||
merge_ARG, mirrorlog_ARG, mirrors_ARG, name_ARG, noudevsync_ARG,
|
merge_ARG, mirrorlog_ARG, mirrors_ARG, name_ARG, noudevsync_ARG,
|
||||||
readahead_ARG, regionsize_ARG, repair_ARG, replace_ARG, snapshot_ARG, splitmirrors_ARG,
|
readahead_ARG, regionsize_ARG, repair_ARG, replace_ARG, snapshot_ARG, splitmirrors_ARG,
|
||||||
trackchanges_ARG, type_ARG, stripes_long_ARG, stripesize_ARG, test_ARG,
|
trackchanges_ARG, type_ARG, stripes_long_ARG, stripesize_ARG, test_ARG,
|
||||||
chunksize_ARG, discards_ARG, poolmetadata_ARG, poolmetadatasize_ARG,
|
chunksize_ARG, discards_ARG, originname_ARG,
|
||||||
originname_ARG, thin_ARG, thinpool_ARG,
|
poolmetadata_ARG, poolmetadatasize_ARG, poolmetadataspare_ARG,
|
||||||
|
thin_ARG, thinpool_ARG,
|
||||||
use_policies_ARG, force_ARG, zero_ARG)
|
use_policies_ARG, force_ARG, zero_ARG)
|
||||||
|
|
||||||
xx(lvcreate,
|
xx(lvcreate,
|
||||||
|
@ -21,6 +21,7 @@ struct lvconvert_params {
|
|||||||
int snapshot;
|
int snapshot;
|
||||||
int merge;
|
int merge;
|
||||||
int merge_mirror;
|
int merge_mirror;
|
||||||
|
int poolmetadataspare;
|
||||||
int thin;
|
int thin;
|
||||||
int yes;
|
int yes;
|
||||||
int zero;
|
int zero;
|
||||||
@ -253,6 +254,9 @@ static int _read_params(struct lvconvert_params *lp, struct cmd_context *cmd,
|
|||||||
} else if (arg_count(cmd, discards_ARG)) {
|
} else if (arg_count(cmd, discards_ARG)) {
|
||||||
log_error("--discards is only valid with --thinpool.");
|
log_error("--discards is only valid with --thinpool.");
|
||||||
return 0;
|
return 0;
|
||||||
|
} else if (arg_count(cmd, poolmetadataspare_ARG)) {
|
||||||
|
log_error("--poolmetadataspare is only valid with --thinpool.");
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -486,6 +490,9 @@ static int _read_params(struct lvconvert_params *lp, struct cmd_context *cmd,
|
|||||||
return_0;
|
return_0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* TODO: default in lvm.conf ? */
|
||||||
|
lp->poolmetadataspare = arg_int_value(cmd, poolmetadataspare_ARG,
|
||||||
|
DEFAULT_POOL_METADATA_SPARE);
|
||||||
lp->force = arg_count(cmd, force_ARG);
|
lp->force = arg_count(cmd, force_ARG);
|
||||||
lp->yes = arg_count(cmd, yes_ARG);
|
lp->yes = arg_count(cmd, yes_ARG);
|
||||||
|
|
||||||
@ -2158,6 +2165,10 @@ static int _lvconvert_thinpool(struct cmd_context *cmd,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!handle_pool_metadata_spare(pool_lv->vg, metadata_lv->le_count,
|
||||||
|
lp->pvh, lp->poolmetadataspare))
|
||||||
|
return_0;
|
||||||
|
|
||||||
old_name = data_lv->name; /* Use for pool name */
|
old_name = data_lv->name; /* Use for pool name */
|
||||||
/*
|
/*
|
||||||
* Since we wish to have underlaying devs to match _tdata
|
* Since we wish to have underlaying devs to match _tdata
|
||||||
|
Loading…
Reference in New Issue
Block a user