1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-20 18:09:23 +03:00

cleanup: drop cmd and constify lv for lv_refresh_suspend_resume()

Like with most other lv_manip* functions take just LV arg and get cmd
from embeded pointer when needed.
This commit is contained in:
Zdenek Kabelac 2016-05-20 10:55:05 +02:00
parent cb49ceeaba
commit 98b41db324
5 changed files with 8 additions and 6 deletions

View File

@ -391,7 +391,7 @@ static int _extend_sanlock_lv(struct cmd_context *cmd, struct volume_group *vg,
static int _refresh_sanlock_lv(struct cmd_context *cmd, struct volume_group *vg)
{
if (!lv_refresh_suspend_resume(cmd, vg->sanlock_lv)) {
if (!lv_refresh_suspend_resume(vg->sanlock_lv)) {
log_error("Failed to refresh %s.", vg->sanlock_lv->name);
return 0;
}

View File

@ -379,7 +379,7 @@ int lv_cache_wait_for_clean(struct logical_volume *cache_lv, int *is_clean)
* ATM this is workaround for missing cache sync when cache gets clean
*/
if (1) {
if (!lv_refresh_suspend_resume(lock_lv->vg->cmd, lock_lv))
if (!lv_refresh_suspend_resume(lock_lv))
return_0;
}

View File

@ -1373,8 +1373,10 @@ int replace_lv_with_error_segment(struct logical_volume *lv)
return 1;
}
int lv_refresh_suspend_resume(struct cmd_context *cmd, struct logical_volume *lv)
int lv_refresh_suspend_resume(const struct logical_volume *lv)
{
struct cmd_context *cmd = lv->vg->cmd;
if (!cmd->partial_activation && lv_is_partial(lv)) {
log_error("Refusing refresh of partial LV %s."
" Use '--activationmode partial' to override.",

View File

@ -1,6 +1,6 @@
/*
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
* Copyright (C) 2004-2014 Red Hat, Inc. All rights reserved.
* Copyright (C) 2004-2016 Red Hat, Inc. All rights reserved.
*
* This file is part of LVM2.
*
@ -801,7 +801,7 @@ int lv_empty(struct logical_volume *lv);
/* Empty an LV and add error segment */
int replace_lv_with_error_segment(struct logical_volume *lv);
int lv_refresh_suspend_resume(struct cmd_context *cmd, struct logical_volume *lv);
int lv_refresh_suspend_resume(const struct logical_volume *lv);
/* Entry point for all LV extent allocations */
int lv_extend(struct logical_volume *lv,

View File

@ -1099,7 +1099,7 @@ int lv_refresh(struct cmd_context *cmd, struct logical_volume *lv)
display_lvname(lv), display_lvname(snapshot_lv));
}
if (!lv_refresh_suspend_resume(cmd, lv))
if (!lv_refresh_suspend_resume(lv))
return_0;
/*