All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zdenek Kabelac <zkabelac@redhat.com>
To: lvm-devel@redhat.com
Subject: master - cleanup: move verbose message to lv_activation_skip
Date: Wed, 19 Feb 2014 11:53:57 +0100	[thread overview]
Message-ID: <53048D45.60709@redhat.com> (raw)
In-Reply-To: <53045542.8060108@redhat.com>

Dne 19.2.2014 07:54, Marian Csontos napsal(a):
> On 02/18/2014 09:28 PM, Zdenek Kabelac wrote:
>> Gitweb:
>> http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=fb519c35bbfae24a26346faf2b90d2a4189e8562
>>
>> Commit:        fb519c35bbfae24a26346faf2b90d2a4189e8562
>> Parent:        fdcd95a3b3dd92ed219571467fdc235e1a6cb0b6
>> Author:        Zdenek Kabelac <zkabelac@redhat.com>
>> AuthorDate:    Tue Feb 18 20:49:32 2014 +0100
>> Committer:     Zdenek Kabelac <zkabelac@redhat.com>
>> CommitterDate: Tue Feb 18 20:49:32 2014 +0100
>>
>> cleanup: move verbose message to lv_activation_skip
>>
>> Simplify code and put verbose message into a single place.
>> ---
>>   lib/metadata/lv_manip.c |   12 ++++++------
>>   tools/lvchange.c        |    5 +----
>>   tools/vgchange.c        |    5 +----
>>   3 files changed, 8 insertions(+), 14 deletions(-)
>>
>> diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
>> index 6b4c9a8..c2cc590 100644
>> --- a/lib/metadata/lv_manip.c
>> +++ b/lib/metadata/lv_manip.c
>> @@ -5675,14 +5675,14 @@ void lv_set_activation_skip(struct logical_volume
>> *lv, int override_default,
>>   int lv_activation_skip(struct logical_volume *lv, activation_change_t
>> activate,
>>                 int override_lv_skip_flag, int skip)
>>   {
>> -    /* Do not skip deactivation! */
>> -    if ((activate == CHANGE_AN) || (activate == CHANGE_ALN))
>> +    if (!(lv->status & LV_ACTIVATION_SKIP) ||
>> +        !is_change_activating(activate) || /* Do not skip deactivation */
>> +        (override_lv_skip_flag && !skip))
>>           return 0;
>>
>> -    if (override_lv_skip_flag)
>> -        return skip;
>> -
>> -    return (lv->status & LV_ACTIVATION_SKIP) ? 1 : 0;
>> +    log_verbose("ACTIVATON_SKIP flag set for LV %s/%s, skipping activation.",
>> +            lv->vg->name, lv->name);
>> +    return 1;
>
> I am not convinced this is pure "cleanup".
> When `!(lv->status & LV_ACTIVATION_SKIP)` this returns 0 and ignores
> `override_lv_skip_flag == 1 && skip == 1`.

Yep - however we never call this function with  'skip == 1' - I've committed
second patch which takes this argument away so it now should end with better
readable code.

Zdenek






      reply	other threads:[~2014-02-19 10:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-18 20:28 master - cleanup: move verbose message to lv_activation_skip Zdenek Kabelac
2014-02-19  6:54 ` Marian Csontos
2014-02-19 10:53   ` Zdenek Kabelac [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53048D45.60709@redhat.com \
    --to=zkabelac@redhat.com \
    --cc=lvm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.