Cluster-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Whitehouse <swhiteho@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 2/3] GFS2: Fix bug in block allocation
Date: Thu, 23 Apr 2009 10:16:55 +0100	[thread overview]
Message-ID: <1240478216-2594-3-git-send-email-swhiteho@redhat.com> (raw)
In-Reply-To: <1240478216-2594-2-git-send-email-swhiteho@redhat.com>

The new bitfit algorithm was counting from the wrong end of
64 bit words in the bitfield. This fixes it by using __ffs64
instead of fls64

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>

diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index f03d024..c9786a4 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -212,8 +212,7 @@ static u32 gfs2_bitfit(const u8 *buf, const unsigned int len,
 	if (tmp == 0)
 		return BFITNOENT;
 	ptr--;
-	bit = fls64(tmp);
-	bit--;		/* fls64 always adds one to the bit count */
+	bit = __ffs64(tmp);
 	bit /= 2;	/* two bits per entry in the bitmap */
 	return (((const unsigned char *)ptr - buf) * GFS2_NBBY) + bit;
 }
-- 
1.6.0.6



  reply	other threads:[~2009-04-23  9:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-23  9:16 [Cluster-devel] GFS2: Block alloc fixes Steven Whitehouse
2009-04-23  9:16 ` [Cluster-devel] [PATCH 1/3] bitops: Add __ffs64 bitop Steven Whitehouse
2009-04-23  9:16   ` Steven Whitehouse [this message]
2009-04-23  9:16     ` [Cluster-devel] [PATCH 3/3] GFS2: Ensure that the inode goal block settings are updated Steven Whitehouse
     [not found]   ` <52615.1240839635@turing-police.cc.vt.edu>
2009-04-27 15:41     ` [Cluster-devel] Re: [PATCH 1/3] bitops: Add __ffs64 bitop Steven Whitehouse

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=1240478216-2594-3-git-send-email-swhiteho@redhat.com \
    --to=swhiteho@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