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

remove vg_read_error

Once converted results to error numbers but is now just a null check.
This commit is contained in:
David Teigland 2020-04-24 11:14:29 -05:00
parent 4047a32128
commit d945b53ff7
4 changed files with 2 additions and 18 deletions

View File

@ -744,9 +744,6 @@ struct volume_group *vg_read_for_update(struct cmd_context *cmd, const char *vg_
const char *vgid, uint32_t read_flags, uint32_t lockd_state);
struct volume_group *vg_read_orphans(struct cmd_context *cmd, const char *orphan_vgname);
/* this is historical and being removed, don't use */
uint32_t vg_read_error(struct volume_group *vg_handle);
/* pe_start and pe_end relate to any existing data so that new metadata
* areas can avoid overlap */
struct physical_volume *pv_create(const struct cmd_context *cmd,

View File

@ -4010,17 +4010,6 @@ static int _access_vg_exported(struct cmd_context *cmd, struct volume_group *vg)
return 0;
}
/*
* Test the validity of a VG handle returned by vg_read() or vg_read_for_update().
*/
uint32_t vg_read_error(struct volume_group *vg_handle)
{
if (!vg_handle)
return FAILED_ALLOCATION;
return SUCCESS;
}
struct format_instance *alloc_fid(const struct format_type *fmt,
const struct format_instance_ctx *fic)
{

View File

@ -21,10 +21,8 @@ static struct volume_group *_vgmerge_vg_read(struct cmd_context *cmd,
struct volume_group *vg;
log_verbose("Checking for volume group \"%s\"", vg_name);
vg = vg_read_for_update(cmd, vg_name, NULL, 0, 0);
if (vg_read_error(vg)) {
release_vg(vg);
if (!vg)
return NULL;
}
if (vg_is_shared(vg)) {
log_error("vgmerge not allowed for lock_type %s", vg->lock_type);

View File

@ -691,7 +691,7 @@ int vgsplit(struct cmd_context *cmd, int argc, char **argv)
vg_to = vg_read_for_update(cmd, vg_name_to, NULL, 0, 0);
if (vg_read_error(vg_to)) {
if (!vg_to) {
log_error("Volume group \"%s\" became inconsistent: "
"please fix manually", vg_name_to);
goto bad;