All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Snitzer <snitzer@redhat.com>
To: dm-devel@redhat.com
Cc: ejt@redhat.com, agk@redhat.com
Subject: [PATCH 1/2] dm: update max_io_len to support a split_io that is not a power of 2
Date: Sat, 28 Apr 2012 00:44:28 -0400	[thread overview]
Message-ID: <1335588269-807-1-git-send-email-snitzer@redhat.com> (raw)

Required to support a target's use of a non power of 2 blocksize.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
---
 drivers/md/dm.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index e24143c..fe57285 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -973,10 +973,10 @@ static sector_t max_io_len(sector_t sector, struct dm_target *ti)
 	 * Does the target need to split even further ?
 	 */
 	if (ti->split_io) {
-		sector_t boundary;
 		sector_t offset = dm_target_offset(ti, sector);
-		boundary = ((offset + ti->split_io) & ~(ti->split_io - 1))
-			   - offset;
+		sector_t boundary, tmp = offset + ti->split_io;
+
+		boundary = ti->split_io - do_div(tmp, ti->split_io);
 		if (len > boundary)
 			len = boundary;
 	}
-- 
1.7.1

             reply	other threads:[~2012-04-28  4:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-28  4:44 Mike Snitzer [this message]
2012-04-28  4:44 ` [PATCH 2/2] dm thin: support for non power of 2 pool blocksize Mike Snitzer
2012-04-28  4:51   ` [PATCH] thinp-test-suite: " Mike Snitzer
2012-04-28 15:32     ` Mike Snitzer
2012-04-30 10:15     ` [PATCH] " Joe Thornber
2012-04-30  9:55   ` [PATCH 2/2] dm thin: " Joe Thornber
2012-04-30 17:33     ` Mike Snitzer
2012-05-01  9:41       ` Joe Thornber
2012-04-30 16:10 ` [PATCH 1/2] dm: update max_io_len to support a split_io that is not a power of 2 Alasdair G Kergon
2012-04-30 17:24   ` Mike Snitzer
2012-04-30 18:36     ` Alasdair G Kergon
2012-04-30 18:59       ` Mike Snitzer
2012-05-01 15:42         ` Brassow Jonathan

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=1335588269-807-1-git-send-email-snitzer@redhat.com \
    --to=snitzer@redhat.com \
    --cc=agk@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=ejt@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 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.