1
0
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:
Jim Meyering 2007-08-06 14:57:48 +00:00
parent ee80c0f0e3
commit e5e120a502
4 changed files with 13 additions and 13 deletions

View File

@ -563,7 +563,7 @@ int dev_manager_mirror_percent(struct dev_manager *dm,
/* Rename? */ /* Rename? */
if ((suffix = strrchr(dl->dlid + sizeof(UUID_PREFIX) - 1, '-'))) if ((suffix = strrchr(dl->dlid + sizeof(UUID_PREFIX) - 1, '-')))
suffix++; 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); suffix);
static int _belong_to_vg(const char *vgname, const char *name) static int _belong_to_vg(const char *vgname, const char *name)

View File

@ -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; struct text_context *tc = (struct text_context *) mda->metadata_locn;
char *slash; char *slash;
char newname[PATH_MAX]; char new_name[PATH_MAX];
size_t len; size_t len;
if (!_vg_commit_file_backup(fid, vg, mda)) 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)) { if (strcmp(slash, vg->name)) {
len = slash - tc->path_live; len = slash - tc->path_live;
strncpy(newname, tc->path_live, len); strncpy(new_name, tc->path_live, len);
strcpy(newname + len, vg->name); strcpy(new_name + len, vg->name);
log_debug("Renaming %s to %s", tc->path_live, newname); log_debug("Renaming %s to %s", tc->path_live, new_name);
if (test_mode()) if (test_mode())
log_verbose("Test mode: Skipping rename"); log_verbose("Test mode: Skipping rename");
else { else {
if (rename(tc->path_live, newname)) { if (rename(tc->path_live, new_name)) {
log_error("%s: rename to %s failed: %s", log_error("%s: rename to %s failed: %s",
tc->path_live, newname, tc->path_live, new_name,
strerror(errno)); strerror(errno));
sync_dir(newname); sync_dir(new_name);
return 0; return 0;
} }
} }

View File

@ -1466,13 +1466,13 @@ int lv_extend(struct logical_volume *lv,
* Returns 0 on failure, 1 on success. * Returns 0 on failure, 1 on success.
*/ */
int lv_rename(struct cmd_context *cmd, struct logical_volume *lv, int lv_rename(struct cmd_context *cmd, struct logical_volume *lv,
const char *newname) const char *new_name)
{ {
struct volume_group *vg = lv->vg; 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 " log_error("Logical volume \"%s\" already exists in "
"volume group \"%s\"", newname, vg->name); "volume group \"%s\"", new_name, vg->name);
return 0; return 0;
} }
@ -1492,7 +1492,7 @@ int lv_rename(struct cmd_context *cmd, struct logical_volume *lv,
if (!archive(vg)) if (!archive(vg))
return_0; 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"); log_error("Failed to allocate space for new name");
return 0; return 0;
} }

View File

@ -357,7 +357,7 @@ int lv_extend(struct logical_volume *lv,
int lv_remove(struct logical_volume *lv); int lv_remove(struct logical_volume *lv);
int lv_rename(struct cmd_context *cmd, 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 */ /* Find a PV within a given VG */
struct pv_list *find_pv_in_vg(struct volume_group *vg, const char *pv_name); struct pv_list *find_pv_in_vg(struct volume_group *vg, const char *pv_name);