mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-10 16:58:47 +03:00
cleanup: simpler checks first
Minor optimizatoins...
This commit is contained in:
parent
f4200acac2
commit
e5456c259f
@ -103,13 +103,13 @@ static int _archive(struct volume_group *vg, int compulsory)
|
|||||||
{
|
{
|
||||||
char *desc;
|
char *desc;
|
||||||
|
|
||||||
|
if (vg_is_archived(vg))
|
||||||
|
return 1; /* VG has been already archived */
|
||||||
|
|
||||||
/* Don't archive orphan VGs. */
|
/* Don't archive orphan VGs. */
|
||||||
if (is_orphan_vg(vg->name))
|
if (is_orphan_vg(vg->name))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (vg_is_archived(vg))
|
|
||||||
return 1; /* VG has been already archived */
|
|
||||||
|
|
||||||
if (!vg->cmd->archive_params->enabled || !vg->cmd->archive_params->dir) {
|
if (!vg->cmd->archive_params->enabled || !vg->cmd->archive_params->dir) {
|
||||||
vg->status |= ARCHIVED_VG;
|
vg->status |= ARCHIVED_VG;
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -371,7 +371,7 @@ static void _check_lv_segment(struct logical_volume *lv, struct lv_segment *seg,
|
|||||||
seg_error("sets cleaner_policy");
|
seg_error("sets cleaner_policy");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lv_is_cache(lv) && seg->pool_lv && lv_is_cache_vol(seg->pool_lv)) {
|
if (seg->pool_lv && lv_is_cache(lv) && lv_is_cache_vol(seg->pool_lv)) {
|
||||||
cache_setting_seg = seg;
|
cache_setting_seg = seg;
|
||||||
no_metadata_format = 1;
|
no_metadata_format = 1;
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ int lv_is_origin(const struct logical_volume *lv)
|
|||||||
int lv_is_cow(const struct logical_volume *lv)
|
int lv_is_cow(const struct logical_volume *lv)
|
||||||
{
|
{
|
||||||
/* Make sure a merging thin origin isn't confused as a cow LV */
|
/* Make sure a merging thin origin isn't confused as a cow LV */
|
||||||
return (!lv_is_thin_volume(lv) && !lv_is_origin(lv) && lv->snapshot) ? 1 : 0;
|
return (lv->snapshot && !lv_is_thin_volume(lv) && !lv_is_origin(lv)) ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct logical_volume *find_cow(const struct logical_volume *snap)
|
struct logical_volume *find_cow(const struct logical_volume *snap)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user