1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-24 14:50:34 +03:00

cleanup: use logical_volume* directly

This commit is contained in:
Zdenek Kabelac 2014-10-31 10:15:00 +01:00
parent fdc252ec35
commit 0ba5571bab

View File

@ -1,6 +1,6 @@
/*
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
* Copyright (C) 2004-2013 Red Hat, Inc. All rights reserved.
* Copyright (C) 2004-2014 Red Hat, Inc. All rights reserved.
*
* This file is part of LVM2.
*
@ -168,7 +168,7 @@ int lvresize(struct cmd_context *cmd, int argc, char **argv)
struct lvresize_params lp = { 0 };
struct volume_group *vg;
struct dm_list *pvh = NULL;
struct lv_list *lvl;
struct logical_volume *lv;
int r = ECMD_FAILED;
if (!_lvresize_params(cmd, argc, argv, &lp))
@ -181,23 +181,23 @@ int lvresize(struct cmd_context *cmd, int argc, char **argv)
return_ECMD_FAILED;
}
/* Does LV exist? */
if (!(lvl = find_lv_in_vg(vg, lp.lv_name))) {
log_error("Logical volume %s not found in volume group %s",
lp.lv_name, lp.vg_name);
/* Does LV exist? */
if (!(lv = find_lv(vg, lp.lv_name))) {
log_error("Logical volume %s not found in volume group %s",
lp.lv_name, lp.vg_name);
goto out;
}
}
if (!(pvh = lp.argc ? create_pv_list(cmd->mem, vg, lp.argc,
lp.argv, 1) : &vg->pvs))
goto_out;
if (!lv_resize_prepare(cmd, lvl->lv, &lp, pvh)) {
if (!lv_resize_prepare(cmd, lv, &lp, pvh)) {
r = EINVALID_CMD_LINE;
goto_out;
}
if (!lv_resize(cmd, lvl->lv, &lp, pvh))
if (!lv_resize(cmd, lv, &lp, pvh))
goto_out;
r = ECMD_PROCESSED;