All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oystein Viggen <oysteivi@tihlde.org>
To: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] Add supported kernel version check to mkfs.btrfs
Date: Thu, 23 Jul 2009 19:50:48 +0200	[thread overview]
Message-ID: <038wif2sqv.fsf@msgid.viggen.net> (raw)
In-Reply-To: D102393B-AFF2-4771-822E-71D3762A1B45@karlsbakk.net

* [Roy Sigurd Karlsbakk]=20

> On 23. juli. 2009, at 04.09, Chris Samuel wrote:
>
>> +	if ( kern_major > min_major )
>> +		return( 0 );
>> +	if ( kern_major < min_major )
>> +		return( -1 );
>> +	if ( kern_medium > min_medium )
>> +		return( 0 );
>> +	if ( kern_medium < min_medium )
>> +		return( -1 );
>> +	if ( kern_minor < min_minor )
>> +		return( -1 );
>> +
>> +	return( 0 );
>
>
> Why not simply this?
>
> if (kern_major < min_major || kern_medium < min_medium || kern_minor =
< =20
> min_minor)
>          return -1;
>
> return 0;

Doesn't look equivalent.  I think your shorter code would return -1 for
any kernel version a.b.c where any of a, b, or c is less than the
minimum.  Say, 2.8.10 (minor) or 3.0.40 (medium).

Either way, I guess the RHEL developers could tell people a thing or tw=
o
about the cleverness of assuming a kernel version equals a specific set
of features and/or bugs.  WIBNI the btrfs kernel driver could export
some kind of "btrfs_version" property that btrfs-tools could check
instead?

Then again, the need for shenanigans like this should pass quickly as
the file system matures.

=D8ystein
--=20
"Windows is too dangerous to be left to Windows admins."
                 -- James Riden in the monastery

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" =
in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2009-07-23 17:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-23  2:09 [PATCH] Add supported kernel version check to mkfs.btrfs Chris Samuel
2009-07-23 13:50 ` Roy Sigurd Karlsbakk
2009-07-23 17:50   ` Oystein Viggen [this message]
2009-07-24  0:33     ` Chris Samuel

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=038wif2sqv.fsf@msgid.viggen.net \
    --to=oysteivi@tihlde.org \
    --cc=linux-btrfs@vger.kernel.org \
    /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.