public inbox for linux-next@vger.kernel.org 
 help / color / mirror / Atom feed
From: Mikulas Patocka <mpatocka@redhat•com>
To: Alasdair G Kergon <agk@redhat•com>
Cc: Thomas Meyer <thomas@m3y3r•de>,
	Linux Kernel <linux-kernel@vger•kernel.org>,
	Adrian Bunk <bunk@kernel•org>,
	linux-next@vger•kernel.org
Subject: [PATCHES] Re: next-20080723: build fails for dm-snapshot.ko
Date: Wed, 23 Jul 2008 17:16:02 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0807231710360.11001@devserv.devel.redhat.com> (raw)
In-Reply-To: <20080723205102.GC5991@cs181140183.pp.htv.fi>

Hi

Here is the patch for the problem.

Mikulas

---

Use sector_div to properly handle 64-bit modulo on 32-bit machines.

Signed-off-by: Mikulas Patocka <mpatocka@redhat•com>

---
 drivers/md/dm-exception-store.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Index: linux-2.6.26-fast/drivers/md/dm-exception-store.c
===================================================================
--- linux-2.6.26-fast.orig/drivers/md/dm-exception-store.c	2008-07-23 21:21:50.000000000 +0200
+++ linux-2.6.26-fast/drivers/md/dm-exception-store.c	2008-07-23 22:34:54.000000000 +0200
@@ -520,6 +520,7 @@ static int persistent_prepare(struct exc
 {
 	struct pstore *ps = get_info(store);
 	uint32_t stride;
+	chunk_t next_free;
 	sector_t size = get_dev_size(store->snap->cow->bdev);
 
 	/* Is there enough room ? */
@@ -533,7 +534,8 @@ static int persistent_prepare(struct exc
 	 * into account the location of the metadata chunks.
 	 */
 	stride = (ps->exceptions_per_area + 1);
-	if ((++ps->next_free % stride) == 1)
+	next_free = ++ps->next_free;
+	if (sector_div(next_free, stride) == 1)
 		ps->next_free++;
 
 	atomic_inc(&ps->pending_count);

      reply	other threads:[~2008-07-23 21:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-23 17:58 next-20080723: build fails for dm-snapshot.ko Thomas Meyer
2008-07-23 18:28 ` Adrian Bunk
2008-07-23 18:33   ` Mikulas Patocka
2008-07-23 18:43   ` Thomas Meyer
2008-07-23 20:51 ` Adrian Bunk
2008-07-23 21:16   ` Mikulas Patocka [this message]

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=Pine.LNX.4.64.0807231710360.11001@devserv.devel.redhat.com \
    --to=mpatocka@redhat$(echo .)com \
    --cc=agk@redhat$(echo .)com \
    --cc=bunk@kernel$(echo .)org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-next@vger$(echo .)kernel.org \
    --cc=thomas@m3y3r$(echo .)de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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