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

toollib: Remove unused functions from header file.

This commit is contained in:
Alasdair G Kergon 2014-10-06 15:22:01 +01:00
parent fa517221a1
commit 1115a9ea51
2 changed files with 28 additions and 37 deletions

View File

@ -540,35 +540,10 @@ static const char *_extract_vgname(struct cmd_context *cmd, const char *lv_name,
return vg_name;
}
/*
* Determine volume group name from a logical volume name
*/
const char *extract_vgname(struct cmd_context *cmd, const char *lv_name)
{
const char *vg_name = lv_name;
/* Path supplied? */
if (vg_name && strchr(vg_name, '/')) {
if (!(vg_name = _extract_vgname(cmd, lv_name, NULL)))
return_NULL;
return vg_name;
}
if (!(vg_name = default_vgname(cmd))) {
if (lv_name)
log_error("Path required for Logical Volume \"%s\"",
lv_name);
return NULL;
}
return vg_name;
}
/*
* Extract default volume group name from environment
*/
char *default_vgname(struct cmd_context *cmd)
static const char *_default_vgname(struct cmd_context *cmd)
{
const char *vg_path;
@ -588,6 +563,31 @@ char *default_vgname(struct cmd_context *cmd)
return dm_pool_strdup(cmd->mem, vg_path);
}
/*
* Determine volume group name from a logical volume name
*/
const char *extract_vgname(struct cmd_context *cmd, const char *lv_name)
{
const char *vg_name = lv_name;
/* Path supplied? */
if (vg_name && strchr(vg_name, '/')) {
if (!(vg_name = _extract_vgname(cmd, lv_name, NULL)))
return_NULL;
return vg_name;
}
if (!(vg_name = _default_vgname(cmd))) {
if (lv_name)
log_error("Path required for Logical Volume \"%s\"",
lv_name);
return NULL;
}
return vg_name;
}
/*
* Process physical extent range specifiers
*/
@ -1907,7 +1907,7 @@ static int _get_arg_lvnames(struct cmd_context *cmd,
const char *vgname;
const char *lv_name;
const char *tmp_lv_name;
char *vgname_def;
const char *vgname_def;
unsigned dev_dir_found;
log_verbose("Using logical volume(s) on command line");
@ -1956,7 +1956,7 @@ static int _get_arg_lvnames(struct cmd_context *cmd,
continue;
}
} else if (!dev_dir_found &&
(vgname_def = default_vgname(cmd)))
(vgname_def = _default_vgname(cmd)))
vgname = vgname_def;
else
lv_name = NULL;

View File

@ -20,16 +20,8 @@
int become_daemon(struct cmd_context *cmd, int skip_lvm);
int autobackup_set(void);
int autobackup_init(const char *backup_dir, int keep_days, int keep_number,
int autobackup);
int autobackup(struct volume_group *vg);
int ignore_vg(struct volume_group *vg, const char *vg_name, int allow_inconsistent, int *ret);
struct volume_group *recover_vg(struct cmd_context *cmd, const char *vgname,
uint32_t lock_type);
typedef int (*process_single_vg_fn_t) (struct cmd_context * cmd,
const char *vg_name,
struct volume_group * vg,
@ -91,7 +83,6 @@ int process_each_lv_in_vg(struct cmd_context *cmd,
void *handle,
process_single_lv_fn_t process_single_lv);
char *default_vgname(struct cmd_context *cmd);
const char *extract_vgname(struct cmd_context *cmd, const char *lv_name);
const char *skip_dev_dir(struct cmd_context *cmd, const char *vg_name,
unsigned *dev_dir_found);