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-ext4" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html