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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]