public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <ak@suse.de>
To: David Chinner <dgc@sgi.com>
Cc: xfs@oss.sgi.com, cattelan@thebarn.com
Subject: Re: [PATCH] Replace XFS bit functions with Linux functions
Date: Tue, 2 Oct 2007 15:35:14 +0200	[thread overview]
Message-ID: <200710021535.14973.ak@suse.de> (raw)
In-Reply-To: <20071002125923.GH995458@sgi.com>


> One thing that is notable here is that the XFS code returns
> -1 if no bits are set. fls/fls64 return 0 in the same case, so
> the magic "- 1" will make them behave the same. however, it
> appears that find_first_bit() will return the number of bits
> searched. That might leave us with som nasty, non-obvious error
> cases....

See the changelog:

The semantics of the Linux functions differ a little, but i checked
all call sites that they can deal with that.

> 
> Also, I don't really like the fact it requires sprinkling magic "-
> 1" adjustments to the return value of the replacement functions.  If
> that is the way the functions work and relate to the XFS bitmaps,

Not all callers use them as bitmap indexes, some also use them as true log2s.
I also eliminated some + 1s.

Whatever you do it's not the same for all.

-Andi

  reply	other threads:[~2007-10-02 13:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-02  8:10 [PATCH] Replace XFS bit functions with Linux functions Andi Kleen
2007-10-02  9:55 ` Christoph Hellwig
2007-10-02 10:11   ` Andi Kleen
2007-10-02 12:59 ` David Chinner
2007-10-02 13:35   ` Andi Kleen [this message]
2007-10-02 16:37 ` Russell Cattelan
2007-10-03 17:58   ` Andi Kleen
2007-10-03 18:20     ` Russell Cattelan

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=200710021535.14973.ak@suse.de \
    --to=ak@suse.de \
    --cc=cattelan@thebarn.com \
    --cc=dgc@sgi.com \
    --cc=xfs@oss.sgi.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox