Re: [PATCH/RFC] minix filesystem update to V3 diffed to 2.6.17-rc3

From: Al Viro
Date: Sat May 06 2006 - 12:43:18 EST


On Sat, May 06, 2006 at 05:29:56PM +0100, Al Viro wrote:
> Ouch... So you want
> 1024 => 0
> 2048 => 1
> 4096 => 2
> 8192 => 3
> 16384 => 4
> anything else => junk?
>
> IOW, you are creating cascade of ifs and shifts instead of
> ffs(sb->s_blocksize) - 11
> (ffs(1<<n) == n + 1). ffs() is far more efficient and readable...

Or, better yet, sb->s_blocksize_bits - 10. End of story.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/