All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Jan Glauber <jglauber@redhat.com>,
	ext4 development <linux-ext4@vger.kernel.org>,
	"Josef 'Jeff' Sipek" <jeffpc@josefsipek.net>
Subject: [PATCH] s390: fix ext2_find_next_bit
Date: Thu, 21 Aug 2008 01:15:54 -0500	[thread overview]
Message-ID: <48AD081A.6060200@redhat.com> (raw)

The following changes get ext4 on s390 up and running for me.

the switch from ffs to __ffs changes where we start counting
(if the first bit is set, is that "0" or "1?"  ext2 wants to 
start counting with "0") and the rest is, honestly, just lifted 
from the stock find_next_bit() implementation.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
--

Index: linux-2.6/arch/s390/include/asm/bitops.h
===================================================================
--- linux-2.6.orig/arch/s390/include/asm/bitops.h	2008-08-11 16:23:58.000000000 -0500
+++ linux-2.6/arch/s390/include/asm/bitops.h	2008-08-21 00:49:40.950176518 -0500
@@ -862,10 +862,10 @@ static inline int ext2_find_next_bit(voi
 	p = addr + offset / __BITOPS_WORDSIZE;
 	if (bit) {
 		/*
-		 * s390 version of ffz returns __BITOPS_WORDSIZE
-		 * if no zero bit is present in the word.
+		 * s390 version of ffs returns __BITOPS_WORDSIZE
+		 * if no set bit is present in the word.
 		 */
-		set = ffs(__load_ulong_le(p, 0) >> bit) + bit;
+		set = __ffs(__load_ulong_le(p, 0) & (~0UL << bit));
 		if (set >= size)
 			return size + offset;
 		if (set < __BITOPS_WORDSIZE)


             reply	other threads:[~2008-08-21  6:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-21  6:15 Eric Sandeen [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-08-21  6:18 [PATCH] s390: fix ext2_find_next_bit Eric Sandeen

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=48AD081A.6060200@redhat.com \
    --to=sandeen@redhat.com \
    --cc=jeffpc@josefsipek.net \
    --cc=jglauber@redhat.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=schwidefsky@de.ibm.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.