From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Wed, 18 Jul 2001 17:01:16 +0200 From: "Heinz J. Mauelshagen" Subject: Re: [linux-lvm] FW: LVM on Linux Message-ID: <20010718170116.C24438@sistina.com> References: <85063BBE668FD411944400D0B744267A643418@AUSMAIL> <20010717174008.A1000@btconnect.com> <20010717122318.A20564@d3.front> <20010718091639.B382@btconnect.com> Mime-Version: 1.0 In-Reply-To: <20010718091639.B382@btconnect.com>; from thornber@btconnect.com on Wed, Jul 18, 2001 at 09:16:39AM +0100 Sender: linux-lvm-admin@sistina.com Errors-To: linux-lvm-admin@sistina.com Reply-To: linux-lvm@sistina.com List-Help: List-Post: List-Subscribe: , List-Unsubscribe: , List-Archive: List-Id: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-lvm@sistina.com On Wed, Jul 18, 2001 at 09:16:39AM +0100, Joe Thornber wrote: > 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 = unsigned 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 :) Yep. > > 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. True. > > - Joe > _______________________________________________ > linux-lvm mailing list > linux-lvm@sistina.com > http://lists.sistina.com/mailman/listinfo/linux-lvm > read the LVM HOW-TO at http://www.sistina.com/lvm/Pages/howto.html -- Regards, Heinz -- The LVM Guy -- *** Software bugs are stupid. Nevertheless it needs not so stupid people to solve them *** =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Heinz Mauelshagen Sistina Software Inc. Senior Consultant/Developer Am Sonnenhang 11 56242 Marienrachdorf Germany Mauelshagen@Sistina.com +49 2626 141200 FAX 924446 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-