Distributed Replicated Block Device (DRBD) development
 help / color / mirror / Atom feed
From: Lars Marowsky-Bree <lmb@suse.de>
To: drbd-dev@lists.linbit.com
Subject: [Drbd-dev] [patch] avoid long long division in _hash_fn
Date: Mon, 21 Feb 2005 18:11:10 +0100	[thread overview]
Message-ID: <20050221171110.GN7016@marowsky-bree.de> (raw)

sector_t might be 64 bit, but long long divisions aren't supported in
kernel space in i386. This patch adds a straightforward cast to avoid an
unresolved symbol for __umoddi3.

Index: drbd/drbd_main.c
===================================================================
--- drbd/drbd_main.c    (revision 1763)
+++ drbd/drbd_main.c    (working copy)
@@ -164,7 +164,7 @@
 
 STATIC unsigned int tl_hash_fn(drbd_dev *mdev, sector_t sector)
 {
-       return (sector>>HT_SHIFT) % mdev->tl_hash_s;
+       return (unsigned int)(sector>>HT_SHIFT) % mdev->tl_hash_s;
 }
 
 
@@ -367,7 +367,7 @@
 
 STATIC unsigned int ee_hash_fn(drbd_dev *mdev, sector_t sector)
 {
-       return (sector>>HT_SHIFT) % mdev->ee_hash_s;
+       return (unsigned int)(sector>>HT_SHIFT) % mdev->ee_hash_s;
 }
 
 STATIC int overlaps(sector_t s1, int l1, sector_t s2, int l2)


Sincerely,
    Lars Marowsky-Brée <lmb@suse.de>

-- 
High Availability & Clustering
SUSE Labs, Research and Development
SUSE LINUX Products GmbH - A Novell Business


             reply	other threads:[~2005-02-21 17:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-21 17:11 Lars Marowsky-Bree [this message]
2005-02-22 10:38 ` [Drbd-dev] [patch] avoid long long division in _hash_fn Philipp Reisner

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=20050221171110.GN7016@marowsky-bree.de \
    --to=lmb@suse.de \
    --cc=drbd-dev@lists.linbit.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