[lvm-devel] [PATCH 03/29] Remove printing of LCK_CACHE

Petr Rockai prockai at redhat.com
Thu Nov 25 17:26:03 UTC 2010


Zdenek Kabelac <zkabelac at redhat.com> writes:

> LCK_CACHE is defined as 0x100 so it cannot be passed through
> unsigned char parameter - remove it from the sprintf code.

> If LCK_CLUSTER would be desirable to be printed here - lot of code
> would neet to be reworked.

Okey. It doesn't make me extremely happy to go this way, but I see how
it could be confusing as it is, and complicated to fix it properly. It
would be however desirable, at least, to add a comment to
decode_locking_cmd explaining the situation.

>
> Signed-off-by: Zdenek Kabelac <zkabelac at redhat.com>
> ---
>  daemons/clvmd/lvm-functions.c |    5 ++---
>  1 files changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/daemons/clvmd/lvm-functions.c b/daemons/clvmd/lvm-functions.c
> index 20b25a6..51a4cdb 100644
> --- a/daemons/clvmd/lvm-functions.c
> +++ b/daemons/clvmd/lvm-functions.c
> @@ -109,12 +109,11 @@ static const char *decode_locking_cmd(unsigned char cmdl)
>  		break;
>  	}
>  
> -	sprintf(buf, "0x%x %s (%s|%s%s%s%s%s%s)", cmdl, command, type, scope,
> +	sprintf(buf, "0x%x %s (%s|%s%s%s%s%s)", cmdl, command, type, scope,
>  		cmdl & LCK_NONBLOCK   ? "|NONBLOCK" : "",
>  		cmdl & LCK_HOLD       ? "|HOLD" : "",
>  		cmdl & LCK_LOCAL      ? "|LOCAL" : "",
> -		cmdl & LCK_CLUSTER_VG ? "|CLUSTER_VG" : "",
> -		cmdl & LCK_CACHE      ? "|CACHE" : "");
> +		cmdl & LCK_CLUSTER_VG ? "|CLUSTER_VG" : "");
>  
>  	return buf;
>  }




More information about the lvm-devel mailing list