[linux-lvm] FW: LVM on Linux

Ralph Jennings ralph at oro.net
Tue Jul 17 19:23:18 UTC 2001


On Tue, Jul 17, 2001 at 05:40:08PM +0100, Joe Thornber wrote:
[snip]
>    Here there's one % that we can't get rid of (we could also do chunk = 
>    sector - (pe_size * index)), for the simple fact that the number of
>    stripes is not a power of 2, so we can't replace with shifts and masks.
> 
>    I just had a chat with one of the EVMS guys, EVMS *does* have this
>    exact same problem.
> 
>    Should we restrict stripes sets to powers of 2 ?
[snip]

Why not just make a mod function?

Preceeding code not tested, but should work?
It's been a while since I wrote C code.

BTW, what is a u64 (unsigned 64bit integer) in C called?
Is there any uniform cross platform way to say it (like
u64 perhaps)?

u64 mod_64(u64 number, u64 modNum) {
    while (number > modNum) {
        number -= modNum;
    }
    return number;
}



More information about the linux-lvm mailing list