Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754059AbYAXOxT (ORCPT ); Thu, 24 Jan 2008 09:53:19 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752202AbYAXOxJ (ORCPT ); Thu, 24 Jan 2008 09:53:09 -0500 Received: from e28smtp01.in.ibm.com ([59.145.155.1]:57175 "EHLO e28smtp01.in.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752132AbYAXOxG (ORCPT ); Thu, 24 Jan 2008 09:53:06 -0500 Date: Thu, 24 Jan 2008 20:23:00 +0530 From: "Aneesh Kumar K.V" To: Andrew Morton Cc: "Theodore Ts'o" , linux-kernel@vger.kernel.org, alex@clusterfs.com, adilger@clusterfs.com, sandeen@redhat.com, "linux-ext4@vger.kernel.org" Subject: Re: [PATCH 41/49] ext4: Add multi block allocator for ext4 Message-ID: <20080124145300.GD14348@skywalker> References: <1200970948-17903-35-git-send-email-tytso@mit.edu> <1200970948-17903-36-git-send-email-tytso@mit.edu> <1200970948-17903-37-git-send-email-tytso@mit.edu> <1200970948-17903-38-git-send-email-tytso@mit.edu> <1200970948-17903-39-git-send-email-tytso@mit.edu> <1200970948-17903-40-git-send-email-tytso@mit.edu> <1200970948-17903-41-git-send-email-tytso@mit.edu> <1200970948-17903-42-git-send-email-tytso@mit.edu> <20080123140727.f47e9c9d.akpm@linux-foundation.org> <20080124075614.GA14348@skywalker> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080124075614.GA14348@skywalker> User-Agent: Mutt/1.5.17 (2007-12-11) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 908 Lines: 43 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/