[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



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]