[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: [dm-devel] [PATCH 1.5/2] dm-stripe: optimize sector division
- From: Mike Snitzer <snitzer redhat com>
- To: Mikulas Patocka <mpatocka redhat com>
- Cc: dm-devel redhat com, Alasdair G Kergon <agk redhat com>
- Subject: Re: [dm-devel] [PATCH 1.5/2] dm-stripe: optimize sector division
- Date: Wed, 28 Jul 2010 09:53:33 -0400
Looking closer I'm seeing something odd:
On Tue, Jul 27 2010 at 6:12pm -0400,
Mikulas Patocka <mpatocka redhat com> wrote:
> @@ -212,7 +217,11 @@ static void stripe_map_sector(struct str
> {
> sector_t offset = sector - sc->ti->begin;
> sector_t chunk = offset >> sc->chunk_shift;
> - *stripe = sector_div(chunk, sc->stripes);
> + if (likely(sc->stripes_shift >= 0))
> + *stripe = chunk & ((1 << sc->stripes_shift) - 1),
> + chunk >>= sc->stripes_shift;
What's going on here with the comma? Shouldn't it be a semi-colon? And
if so we need curly-braces around the if (likely...).
> + else
> + *stripe = sector_div(chunk, sc->stripes);
> *result = (chunk << sc->chunk_shift) | (offset & sc->chunk_mask);
> }
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]