public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: "Theodore Ts'o" <tytso@MIT.EDU>,
	linux-kernel@vger.kernel.org, alex@clusterfs.com,
	adilger@clusterfs.com, sandeen@redhat.com,
	"linux-ext4@vger.kernel.org" <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH 41/49] ext4: Add multi block allocator for ext4
Date: Thu, 24 Jan 2008 20:23:00 +0530	[thread overview]
Message-ID: <20080124145300.GD14348@skywalker> (raw)
In-Reply-To: <20080124075614.GA14348@skywalker>

On Thu, Jan 24, 2008 at 01:26:14PM +0530, Aneesh Kumar K.V wrote:
> 
> > 
> > > +/* find most significant bit */
> > > +static int fmsb(unsigned short word)
> > > +{
> > > +	int order;
> > > +
> > > +	if (word > 255) {
> > > +		order = 7;
> > > +		word >>= 8;
> > > +	} else {
> > > +		order = -1;
> > > +	}
> > > +
> > > +	do {
> > > +		order++;
> > > +		word >>= 1;
> > > +	} while (word != 0);
> > > +
> > > +	return order;
> > > +}
> > 
> > Did we just reinvent fls()?
> 
> replaced by fls.
> 
> > 

That should be fls() - 1;

The full patch is at

http://www.radian.org/~kvaneesh/ext4/jan-24-2008/mballoc-core.patch

The patch is too big to inline.

-aneesh

  parent reply	other threads:[~2008-01-24 14:53 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1200970948-17903-1-git-send-email-tytso@mit.edu>
     [not found] ` <1200970948-17903-2-git-send-email-tytso@mit.edu>
     [not found]   ` <1200970948-17903-3-git-send-email-tytso@mit.edu>
     [not found]     ` <1200970948-17903-4-git-send-email-tytso@mit.edu>
     [not found]       ` <1200970948-17903-5-git-send-email-tytso@mit.edu>
     [not found]         ` <1200970948-17903-6-git-send-email-tytso@mit.edu>
     [not found]           ` <1200970948-17903-7-git-send-email-tytso@mit.edu>
     [not found]             ` <1200970948-17903-8-git-send-email-tytso@mit.edu>
     [not found]               ` <1200970948-17903-9-git-send-email-tytso@mit.edu>
     [not found]                 ` <1200970948-17903-10-git-send-email-tytso@mit.edu>
     [not found]                   ` <1200970948-17903-11-git-send-email-tytso@mit.edu>
     [not found]                     ` <1200970948-17903-12-git-send-email-tytso@mit.edu>
     [not found]                       ` <1200970948-17903-13-git-send-email-tytso@mit.edu>
     [not found]                         ` <1200970948-17903-14-git-send-email-tytso@mit.edu>
     [not found]                           ` <1200970948-17903-15-git-send-email-tytso@mit.edu>
     [not found]                             ` <1200970948-17903-16-git-send-email-tytso@mit.edu>
     [not found]                               ` <1200970948-17903-17-git-send-email-tytso@mit.edu>
     [not found]                                 ` <1200970948-17903-18-git-send-email-tytso@mit.edu>
     [not found]                                   ` <1200970948-17903-19-git-send-email-tytso@mit.edu>
     [not found]                                     ` <1200970948-17903-20-git-send-email-tytso@mit.edu>
     [not found]                                       ` <1200970948-17903-21-git-send-email-tytso@mit.edu>
     [not found]                                         ` <1200970948-17903-22-git-send-email-tytso@mit.edu>
     [not found]                                           ` <1200970948-17903-23-git-send-email-tytso@mit.edu>
     [not found]                                             ` <1200970948-17903-24-git-send-email-tytso@mit.edu>
2008-01-23 22:06                                               ` [PATCH 23/49] Add buffer head related helper functions Andrew Morton
2008-01-24  5:22                                                 ` Aneesh Kumar K.V
2008-01-24  8:53                                                   ` Andrew Morton
     [not found]                                               ` <1200970948-17903-25-git-send-email-tytso@mit.edu>
     [not found]                                                 ` <1200970948-17903-26-git-send-email-tytso@mit.edu>
2008-01-22  3:02                                                   ` [PATCH 26/49] jbd2: Fix assertion failure in fs/jbd2/checkpoint.c Theodore Ts'o
     [not found]                                                     ` <1200970948-17903-28-git-send-email-tytso@mit.edu>
     [not found]                                                       ` <1200970948-17903-29-git-send-email-tytso@mit.edu>
     [not found]                                                         ` <1200970948-17903-30-git-send-email-tytso@mit.edu>
     [not found]                                                           ` <1200970948-17903-31-git-send-email-tytso@mit.edu>
2008-01-23 22:06                                                             ` [PATCH 30/49] ext4: Convert truncate_mutex to read write semaphore Andrew Morton
2008-01-24  5:29                                                               ` Aneesh Kumar K.V
2008-01-24 13:00                                                               ` Andy Whitcroft
     [not found]                                                             ` <1200970948-17903-32-git-send-email-tytso@mit.edu>
     [not found]                                                               ` <1200970948-17903-33-git-send-email-tytso@mit.edu>
     [not found]                                                                 ` <1200970948-17903-34-git-send-email-tytso@mit.edu>
2008-01-23 22:07                                                                   ` [PATCH 33/49] ext4: Add the journal checksum feature Andrew Morton
2008-01-23 22:40                                                                     ` Andreas Dilger
2008-01-24 21:24                                                                     ` Mingming Cao
2008-02-01 20:50                                                                       ` Girish Shilamkar
     [not found]                                                                   ` <1200970948-17903-35-git-send-email-tytso@mit.edu>
     [not found]                                                                     ` <1200970948-17903-36-git-send-email-tytso@mit.edu>
     [not found]                                                                       ` <1200970948-17903-37-git-send-email-tytso@mit.edu>
     [not found]                                                                         ` <1200970948-17903-38-git-send-email-tytso@mit.edu>
     [not found]                                                                           ` <1200970948-17903-39-git-send-email-tytso@mit.edu>
2008-01-22  3:02                                                                             ` [PATCH 39/49] ext4: Add ext4_find_next_bit() Theodore Ts'o
     [not found]                                                                               ` <1200970948-17903-41-git-send-email-tytso@mit.edu>
     [not found]                                                                                 ` <1200970948-17903-42-git-send-email-tytso@mit.edu>
2008-01-23 22:07                                                                                   ` [PATCH 41/49] ext4: Add multi block allocator for ext4 Andrew Morton
2008-01-23 23:20                                                                                     ` Andreas Dilger
2008-01-24  7:56                                                                                     ` Aneesh Kumar K.V
2008-01-24  9:04                                                                                       ` Aneesh Kumar K.V
2008-01-24 14:53                                                                                       ` Aneesh Kumar K.V [this message]
2008-01-23 22:07                                                                         ` [PATCH 36/49] ext4: Add EXT4_IOC_MIGRATE ioctl Andrew Morton
2008-01-24  5:55                                                                           ` Aneesh Kumar K.V
2008-01-26  4:15                                                                             ` Theodore Tso
2008-01-26  8:42                                                                               ` Aneesh Kumar K.V
2008-01-23 22:06                                                 ` [PATCH 24/49] ext4: add block bitmap validation Andrew Morton
2008-01-26 13:26                                                   ` Theodore Tso

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=20080124145300.GD14348@skywalker \
    --to=aneesh.kumar@linux.vnet.ibm.com \
    --cc=adilger@clusterfs.com \
    --cc=akpm@linux-foundation.org \
    --cc=alex@clusterfs.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sandeen@redhat.com \
    --cc=tytso@MIT.EDU \
    /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