From: Akinobu Mita <mita@miraclelinux.com>
To: akpm@osdl.org
Cc: linux-kernel@vger.kernel.org,
Akinobu Mita <mita@miraclelinux.com>,
Geert Uytterhoeven <geert@linux-m68k.org>,
Roman Zippel <zippel@linux-m68k.org>
Subject: [-mm patch 7/8] m68k: fix undefined reference to generic_find_next_zero_le_bit
Date: Tue, 21 Feb 2006 12:46:35 +0900 [thread overview]
Message-ID: <20060221034750.534566000@localhost.localdomain> (raw)
In-Reply-To: <20060221034628.799606000@localhost.localdomain>
[-- Attachment #1: m68k-fix.patch --]
[-- Type: text/plain, Size: 2270 bytes --]
This patch reverts ext2 bitmap functions.
Signed-off-by: Akinobu Mita <mita@miraclelinux.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
include/asm-m68k/bitops.h | 54 ++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 52 insertions(+), 2 deletions(-)
Index: 2.6-mm/include/asm-m68k/bitops.h
===================================================================
--- 2.6-mm.orig/include/asm-m68k/bitops.h
+++ 2.6-mm/include/asm-m68k/bitops.h
@@ -351,11 +351,61 @@ static inline int minix_test_bit(int nr,
/* Bitmap functions for the ext2 filesystem. */
-#include <asm-generic/bitops/ext2-non-atomic.h>
-
+#define ext2_set_bit(nr, addr) __test_and_set_bit((nr) ^ 24, (unsigned long *)(addr))
#define ext2_set_bit_atomic(lock, nr, addr) test_and_set_bit((nr) ^ 24, (unsigned long *)(addr))
+#define ext2_clear_bit(nr, addr) __test_and_clear_bit((nr) ^ 24, (unsigned long *)(addr))
#define ext2_clear_bit_atomic(lock, nr, addr) test_and_clear_bit((nr) ^ 24, (unsigned long *)(addr))
+static inline int ext2_test_bit(int nr, const void *vaddr)
+{
+ const unsigned char *p = vaddr;
+ return (p[nr >> 3] & (1U << (nr & 7))) != 0;
+}
+
+static inline int ext2_find_first_zero_bit(const void *vaddr, unsigned size)
+{
+ const unsigned long *p = vaddr, *addr = vaddr;
+ int res;
+
+ if (!size)
+ return 0;
+
+ size = (size >> 5) + ((size & 31) > 0);
+ while (*p++ == ~0UL)
+ {
+ if (--size == 0)
+ return (p - addr) << 5;
+ }
+
+ --p;
+ for (res = 0; res < 32; res++)
+ if (!ext2_test_bit (res, p))
+ break;
+ return (p - addr) * 32 + res;
+}
+
+static inline int ext2_find_next_zero_bit(const void *vaddr, unsigned size,
+ unsigned offset)
+{
+ const unsigned long *addr = vaddr;
+ const unsigned long *p = addr + (offset >> 5);
+ int bit = offset & 31UL, res;
+
+ if (offset >= size)
+ return size;
+
+ if (bit) {
+ /* Look for zero in first longword */
+ for (res = bit; res < 32; res++)
+ if (!ext2_test_bit (res, p))
+ return (p - addr) * 32 + res;
+ p++;
+ }
+ /* No zero yet, search remaining full bytes for a zero */
+ res = ext2_find_first_zero_bit (p, size - 32 * (p - addr));
+ return (p - addr) * 32 + res;
+}
+
#endif /* __KERNEL__ */
#endif /* _M68K_BITOPS_H */
--
next prev parent reply other threads:[~2006-02-21 3:48 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-21 3:46 [-mm patch 0/8] fix build errors by bitops code consolidation Akinobu Mita
2006-02-21 3:46 ` [-mm patch 1/8] s/fucn/func/ typo fix Akinobu Mita
2006-02-21 3:46 ` [-mm patch 2/8] more s/fucn/func/ typo fixes Akinobu Mita
2006-02-21 3:46 ` [-mm patch 3/8] frv: remove unnesesary "&" Akinobu Mita
2006-02-21 3:46 ` [-mm patch 4/8] fix error: __u32 undeclared Akinobu Mita
2006-02-21 3:46 ` [-mm patch 5/8] um: fix undefined reference to hweight32 Akinobu Mita
2006-02-21 21:28 ` Jeff Dike
2006-02-21 3:46 ` [-mm patch 6/8] arm: fix undefined reference to generic_fls Akinobu Mita
2006-02-21 3:46 ` Akinobu Mita [this message]
2006-02-21 3:46 ` [-mm patch 8/8] ppc: fix undefined reference to hweight32 Akinobu Mita
2006-02-21 10:51 ` [-mm patch 3/8] frv: remove unnesesary "&" David Howells
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=20060221034750.534566000@localhost.localdomain \
--to=mita@miraclelinux.com \
--cc=akpm@osdl.org \
--cc=geert@linux-m68k.org \
--cc=linux-kernel@vger.kernel.org \
--cc=zippel@linux-m68k.org \
/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
Powered by JetHome