Skip to content

Commit

Permalink
lvmlockd: remove unused paramater
Browse files Browse the repository at this point in the history
start_init option has never been used
  • Loading branch information
teigland committed Jun 27, 2024
1 parent 4d8fb10 commit 9ea5ff3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 15 deletions.
18 changes: 7 additions & 11 deletions lib/locking/lvmlockd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1310,13 +1310,9 @@ void lockd_free_vg_final(struct cmd_context *cmd, struct volume_group *vg)
* for starting the lockspace. To use the vg after starting
* the lockspace, follow the standard method which is:
* lock the vg, read/use/write the vg, unlock the vg.
*
* start_init is 1 when the VG is being started after the
* command has done lockd_init_vg(). This tells lvmlockd
* that the VG lockspace being started is new.
*/

int lockd_start_vg(struct cmd_context *cmd, struct volume_group *vg, int start_init, int *exists)
int lockd_start_vg(struct cmd_context *cmd, struct volume_group *vg, int *exists)
{
char uuid[64] __attribute__((aligned(8)));
daemon_reply reply;
Expand All @@ -1340,8 +1336,8 @@ int lockd_start_vg(struct cmd_context *cmd, struct volume_group *vg, int start_i
return 0;
}

log_debug("lockd start VG %s lock_type %s init %d",
vg->name, vg->lock_type ? vg->lock_type : "empty", start_init);
log_debug("lockd start VG %s lock_type %s",
vg->name, vg->lock_type ? vg->lock_type : "empty");

if (!id_write_format(&vg->id, uuid, sizeof(uuid)))
return_0;
Expand Down Expand Up @@ -1376,7 +1372,7 @@ int lockd_start_vg(struct cmd_context *cmd, struct volume_group *vg, int start_i
"vg_uuid = %s", uuid[0] ? uuid : "none",
"version = " FMTd64, (int64_t) vg->seqno,
"host_id = " FMTd64, (int64_t) host_id,
"opts = %s", start_init ? "start_init" : "none",
"opts = %s", "none",
NULL);
_lockd_free_pv_list(&lock_pvs);
} else {
Expand All @@ -1389,7 +1385,7 @@ int lockd_start_vg(struct cmd_context *cmd, struct volume_group *vg, int start_i
"vg_uuid = %s", uuid[0] ? uuid : "none",
"version = " FMTd64, (int64_t) vg->seqno,
"host_id = " FMTd64, (int64_t) host_id,
"opts = %s", start_init ? "start_init" : "none",
"opts = %s", "none",
NULL);
}

Expand Down Expand Up @@ -3260,7 +3256,7 @@ int lockd_rename_vg_final(struct cmd_context *cmd, struct volume_group *vg, int
* Depending on the problem that caused the rename to
* fail, it may make sense to not restart the VG here.
*/
if (!lockd_start_vg(cmd, vg, 0, NULL))
if (!lockd_start_vg(cmd, vg, NULL))
log_error("Failed to restart VG %s lockspace.", vg->name);
return 1;
}
Expand Down Expand Up @@ -3300,7 +3296,7 @@ int lockd_rename_vg_final(struct cmd_context *cmd, struct volume_group *vg, int
}
}

if (!lockd_start_vg(cmd, vg, 1, NULL))
if (!lockd_start_vg(cmd, vg, NULL))
log_error("Failed to start VG %s lockspace.", vg->name);

return 1;
Expand Down
4 changes: 2 additions & 2 deletions lib/locking/lvmlockd.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ int lockd_rename_vg_final(struct cmd_context *cmd, struct volume_group *vg, int

/* start and stop the lockspace for a vg */

int lockd_start_vg(struct cmd_context *cmd, struct volume_group *vg, int start_init, int *exists);
int lockd_start_vg(struct cmd_context *cmd, struct volume_group *vg, int *exists);
int lockd_stop_vg(struct cmd_context *cmd, struct volume_group *vg);
int lockd_start_wait(struct cmd_context *cmd);

Expand Down Expand Up @@ -157,7 +157,7 @@ static inline int lockd_rename_vg_final(struct cmd_context *cmd, struct volume_g
return 1;
}

static inline int lockd_start_vg(struct cmd_context *cmd, struct volume_group *vg, int start_init, int *exists)
static inline int lockd_start_vg(struct cmd_context *cmd, struct volume_group *vg, int *exists)
{
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion tools/vgchange.c
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ static int _vgchange_lock_start(struct cmd_context *cmd, struct volume_group *vg
}

do_start:
r = lockd_start_vg(cmd, vg, 0, &exists);
r = lockd_start_vg(cmd, vg, &exists);

if (r)
vp->lock_start_count++;
Expand Down
2 changes: 1 addition & 1 deletion tools/vgcreate.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ int vgcreate(struct cmd_context *cmd, int argc, char **argv)
if (vg_is_shared(vg)) {
const char *start_opt = arg_str_value(cmd, lockopt_ARG, NULL);

if (!lockd_start_vg(cmd, vg, 1, NULL)) {
if (!lockd_start_vg(cmd, vg, NULL)) {
log_error("Failed to start locking");
goto out;
}
Expand Down

0 comments on commit 9ea5ff3

Please sign in to comment.