All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Thornber <thornber@btconnect.com>
To: linux-lvm@sistina.com
Subject: Re: [linux-lvm] FW: LVM on Linux
Date: Wed, 18 Jul 2001 09:16:39 +0100	[thread overview]
Message-ID: <20010718091639.B382@btconnect.com> (raw)
In-Reply-To: <20010717122318.A20564@d3.front>; from ralph@oro.net on Tue, Jul 17, 2001 at 12:23:18PM -0700

On Tue, Jul 17, 2001 at 12:23:18PM -0700, Ralph Jennings wrote:
> 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)?

long long ?

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

I'd like to see the flames if I put this into the driver :) The map
function is called on every io block to an LVM device, it needs to be
quick !  Since we know modNum is smallish, certainly less than 2^32,
and 'number' is 64 bit we could be running around your loop a few
times :)

On a more serious note this function should be provided by the
compiler, since it supports the 64 bit type.  I guess it is normally
implemented in a function that gets linked automatically - it would still
be good to get rid of it.

- Joe

  reply	other threads:[~2001-07-18  8:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-16 20:42 [linux-lvm] FW: LVM on Linux Gonyou, Austin
2001-07-16 21:10 ` Ragnar Kjørstad
2001-07-17 16:40 ` Joe Thornber
2001-07-17 18:10   ` Ragnar Kjørstad
2001-07-17 19:23   ` Ralph Jennings
2001-07-18  8:16     ` Joe Thornber [this message]
2001-07-18 15:01       ` Heinz J. Mauelshagen
2001-07-18 16:58       ` Steven Lembark
  -- strict thread matches above, loose matches on Subject: below --
2001-07-16 23:26 Gonyou, Austin
2001-07-16 23:58 ` Ragnar Kjørstad
2001-07-16 20:35 Gonyou, Austin
2001-07-17 11:27 ` Heinz J. Mauelshagen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010718091639.B382@btconnect.com \
    --to=thornber@btconnect.com \
    --cc=linux-lvm@sistina.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.