dm-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
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: [PATCH 1.5/2] dm-stripe: optimize sector division
Date: Wed, 28 Jul 2010 09:53:33 -0400	[thread overview]
Message-ID: <20100728135332.GA31387@redhat.com> (raw)
In-Reply-To: <Pine.LNX.4.64.1007271811220.21698@hs20-bc2-1.build.redhat.com>

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);
>  }

  parent reply	other threads:[~2010-07-28 13:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-27 21:38 [PATCH 1/2] dm-stripe: move sector translation to a function Mikulas Patocka
2010-07-27 21:42 ` [PATCH 2/2] dm-stripe: discard support Mikulas Patocka
2010-07-27 22:12   ` [PATCH 1.5/2] dm-stripe: optimize sector division Mikulas Patocka
2010-07-27 23:10     ` Mike Snitzer
2010-07-28 13:53     ` Mike Snitzer [this message]
2010-07-28 14:43       ` Mikulas Patocka
2010-07-28 15:21         ` [PATCH 1.5/2 v2] dm stripe: " Mike Snitzer
2010-07-27 22:39   ` [PATCH 2/2] dm-stripe: discard support Mike Snitzer
2010-07-28  0:03   ` [PATCH 2/2 v2] dm stripe: enable " Mike Snitzer
2010-07-28  0:06     ` Mike Snitzer
2010-07-28 17:09 ` [PATCH 1/2 v2] dm stripe: move sector translation to a function Mike Snitzer

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=20100728135332.GA31387@redhat.com \
    --to=snitzer@redhat.com \
    --cc=agk@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=mpatocka@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).