mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-11 20:58:50 +03:00
cleanup: dont hide pv_dev declaration from pv
Just skip using local vars here...
This commit is contained in:
parent
b836525d9c
commit
9810f8aac7
@ -1778,12 +1778,9 @@ struct pv_list *find_pv_in_vg(const struct volume_group *vg,
|
|||||||
const char *pv_name)
|
const char *pv_name)
|
||||||
{
|
{
|
||||||
struct pv_list *pvl;
|
struct pv_list *pvl;
|
||||||
struct device *pv_dev, *cached_dev;
|
|
||||||
|
|
||||||
dm_list_iterate_items(pvl, &vg->pvs) {
|
dm_list_iterate_items(pvl, &vg->pvs) {
|
||||||
pv_dev = pvl->pv->dev;
|
if (!pvl->pv->dev) {
|
||||||
cached_dev = dev_cache_get(pv_name, vg->cmd->filter);
|
|
||||||
if (!pv_dev) {
|
|
||||||
/*
|
/*
|
||||||
* pv_dev can't be NULL here!
|
* pv_dev can't be NULL here!
|
||||||
* We have to catch this situation earlier in the
|
* We have to catch this situation earlier in the
|
||||||
@ -1800,10 +1797,10 @@ struct pv_list *find_pv_in_vg(const struct volume_group *vg,
|
|||||||
* handled earlier in the code in that case.
|
* handled earlier in the code in that case.
|
||||||
*/
|
*/
|
||||||
log_error(INTERNAL_ERROR "find_pv_in_vg: PV that is not "
|
log_error(INTERNAL_ERROR "find_pv_in_vg: PV that is not "
|
||||||
"bound to any existing device found");
|
"bound to any existing device found.");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (pv_dev == cached_dev)
|
if (pvl->pv->dev == dev_cache_get(pv_name, vg->cmd->filter))
|
||||||
return pvl;
|
return pvl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user