mirror of
git://sourceware.org/git/lvm2.git
synced 2025-02-24 17:57:48 +03:00
For consistency, rename local variable: s/newname/new_name/g.
This commit is contained in:
parent
ee80c0f0e3
commit
e5e120a502
@ -563,7 +563,7 @@ int dev_manager_mirror_percent(struct dev_manager *dm,
|
||||
/* Rename? */
|
||||
if ((suffix = strrchr(dl->dlid + sizeof(UUID_PREFIX) - 1, '-')))
|
||||
suffix++;
|
||||
newname = build_dm_name(dm->mem, dm->vg_name, dl->lv->name,
|
||||
new_name = build_dm_name(dm->mem, dm->vg_name, dl->lv->name,
|
||||
suffix);
|
||||
|
||||
static int _belong_to_vg(const char *vgname, const char *name)
|
||||
|
@ -939,7 +939,7 @@ static int _vg_commit_file(struct format_instance *fid, struct volume_group *vg,
|
||||
{
|
||||
struct text_context *tc = (struct text_context *) mda->metadata_locn;
|
||||
char *slash;
|
||||
char newname[PATH_MAX];
|
||||
char new_name[PATH_MAX];
|
||||
size_t len;
|
||||
|
||||
if (!_vg_commit_file_backup(fid, vg, mda))
|
||||
@ -953,17 +953,17 @@ static int _vg_commit_file(struct format_instance *fid, struct volume_group *vg,
|
||||
|
||||
if (strcmp(slash, vg->name)) {
|
||||
len = slash - tc->path_live;
|
||||
strncpy(newname, tc->path_live, len);
|
||||
strcpy(newname + len, vg->name);
|
||||
log_debug("Renaming %s to %s", tc->path_live, newname);
|
||||
strncpy(new_name, tc->path_live, len);
|
||||
strcpy(new_name + len, vg->name);
|
||||
log_debug("Renaming %s to %s", tc->path_live, new_name);
|
||||
if (test_mode())
|
||||
log_verbose("Test mode: Skipping rename");
|
||||
else {
|
||||
if (rename(tc->path_live, newname)) {
|
||||
if (rename(tc->path_live, new_name)) {
|
||||
log_error("%s: rename to %s failed: %s",
|
||||
tc->path_live, newname,
|
||||
tc->path_live, new_name,
|
||||
strerror(errno));
|
||||
sync_dir(newname);
|
||||
sync_dir(new_name);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -1466,13 +1466,13 @@ int lv_extend(struct logical_volume *lv,
|
||||
* Returns 0 on failure, 1 on success.
|
||||
*/
|
||||
int lv_rename(struct cmd_context *cmd, struct logical_volume *lv,
|
||||
const char *newname)
|
||||
const char *new_name)
|
||||
{
|
||||
struct volume_group *vg = lv->vg;
|
||||
|
||||
if (find_lv_in_vg(vg, newname)) {
|
||||
if (find_lv_in_vg(vg, new_name)) {
|
||||
log_error("Logical volume \"%s\" already exists in "
|
||||
"volume group \"%s\"", newname, vg->name);
|
||||
"volume group \"%s\"", new_name, vg->name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1492,7 +1492,7 @@ int lv_rename(struct cmd_context *cmd, struct logical_volume *lv,
|
||||
if (!archive(vg))
|
||||
return_0;
|
||||
|
||||
if (!(lv->name = dm_pool_strdup(cmd->mem, newname))) {
|
||||
if (!(lv->name = dm_pool_strdup(cmd->mem, new_name))) {
|
||||
log_error("Failed to allocate space for new name");
|
||||
return 0;
|
||||
}
|
||||
|
@ -357,7 +357,7 @@ int lv_extend(struct logical_volume *lv,
|
||||
int lv_remove(struct logical_volume *lv);
|
||||
|
||||
int lv_rename(struct cmd_context *cmd, struct logical_volume *lv,
|
||||
const char *newname);
|
||||
const char *new_name);
|
||||
|
||||
/* Find a PV within a given VG */
|
||||
struct pv_list *find_pv_in_vg(struct volume_group *vg, const char *pv_name);
|
||||
|
Loading…
x
Reference in New Issue
Block a user