* [PATCH 00/22] Introduce little endian bitops
@ 2010-10-15 9:45 Akinobu Mita
2010-10-15 9:45 ` Akinobu Mita
` (23 more replies)
0 siblings, 24 replies; 75+ messages in thread
From: Akinobu Mita @ 2010-10-15 9:45 UTC (permalink / raw)
To: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig,
Andrew Morton
Cc: Akinobu Mita
This patch series introduces little endian bit operations in asm/bitops.h
for all architectures and converts ext2 non-atomic and minix bit operation
to them. it enables to remove ext2 non-atomic and minix bit operations
from asm/bitops.h. The reason they should be removed from asm/bitops.h
is as follows:
For ext2 non-atomic bit operations, they are used for little endian byte order
bitmap access by some filesystems and modules. But using ext2_*() functions on
a module other than ext2 filesystem makes someone feel strange.
For minix bit operations, they are only used by minix filesystem and useless
by other modules. Because byte order of inode and block bitmap is defferent
on each architectures.
Akinobu Mita (22):
bitops: merge little and big endian definisions in
asm-generic/bitops/le.h
bitops: rename generic le bitops functions
s390: introduce little endian bitops
arm: introduce little endian bitops
m68k: introduce le bitops
m68knommu: introduce little endian bitops
bitops: introduce little endian bitops for most architectures
rds: stop including asm-generic/bitops/le.h
kvm: stop including asm-generic/bitops/le.h
asm-generic: use little endian bitops
ext3: use little endian bitops
ext4: use little endian bitops
ocfs2: use little endian bitops
nilfs2: use little endian bitops
reiserfs: use little endian bitops
udf: use little endian bitops
ufs: use little endian bitops
md: use little endian bit operations
dm: use little endian bit operations
bitops: remove ext2 non-atomic bitops from asm/bitops.h
m68k: convert minix bitops to use little endian bitops
bitops: remove minix bitops from asm/bitops.h
arch/Kconfig | 6 ++
arch/alpha/Kconfig | 1 +
arch/alpha/include/asm/bitops.h | 4 +-
arch/arm/Kconfig | 1 +
arch/arm/include/asm/bitops.h | 50 ++++++--------
arch/avr32/Kconfig | 1 +
arch/avr32/include/asm/bitops.h | 3 +-
arch/avr32/kernel/avr32_ksyms.c | 4 +-
arch/avr32/lib/findbit.S | 4 +-
arch/blackfin/Kconfig | 1 +
arch/blackfin/include/asm/bitops.h | 3 +-
arch/cris/Kconfig | 1 +
arch/cris/include/asm/bitops.h | 3 +-
arch/frv/Kconfig | 1 +
arch/frv/include/asm/bitops.h | 4 +-
arch/h8300/Kconfig | 1 +
arch/h8300/include/asm/bitops.h | 3 +-
arch/ia64/Kconfig | 1 +
arch/ia64/include/asm/bitops.h | 3 +-
arch/m32r/Kconfig | 1 +
arch/m32r/include/asm/bitops.h | 3 +-
arch/m68k/Kconfig | 1 +
arch/m68k/include/asm/bitops_mm.h | 89 ++++++++++----------------
arch/m68k/include/asm/bitops_no.h | 28 +++++----
arch/m68knommu/Kconfig | 1 +
arch/microblaze/Kconfig | 1 +
arch/mips/Kconfig | 1 +
arch/mips/include/asm/bitops.h | 3 +-
arch/mn10300/Kconfig | 1 +
arch/mn10300/include/asm/bitops.h | 3 +-
arch/parisc/Kconfig | 1 +
arch/parisc/include/asm/bitops.h | 4 +-
arch/powerpc/Kconfig | 1 +
arch/powerpc/include/asm/bitops.h | 35 +---------
arch/s390/Kconfig | 1 +
arch/s390/include/asm/bitops.h | 45 ++++++++------
arch/score/Kconfig | 3 +
arch/sh/Kconfig | 1 +
arch/sh/include/asm/bitops.h | 3 +-
arch/sparc/Kconfig | 1 +
arch/sparc/include/asm/bitops_32.h | 3 +-
arch/sparc/include/asm/bitops_64.h | 4 +-
arch/tile/Kconfig | 1 +
arch/tile/include/asm/bitops.h | 3 +-
arch/x86/Kconfig | 1 +
arch/x86/include/asm/bitops.h | 4 +-
arch/xtensa/Kconfig | 1 +
arch/xtensa/include/asm/bitops.h | 3 +-
drivers/md/bitmap.c | 6 +-
drivers/md/dm-log.c | 8 +-
fs/ext4/ext4.h | 18 ++++--
fs/minix/minix.h | 37 +++++++++++
fs/nilfs2/alloc.h | 3 +-
fs/ocfs2/ocfs2.h | 13 ++--
fs/udf/balloc.c | 11 ++-
fs/ufs/util.h | 2 +-
include/asm-generic/bitops.h | 3 +-
include/asm-generic/bitops/ext2-atomic.h | 4 +-
include/asm-generic/bitops/ext2-non-atomic.h | 20 ------
include/asm-generic/bitops/le.h | 56 +++++++---------
include/asm-generic/bitops/minix-le.h | 17 -----
include/asm-generic/bitops/minix.h | 15 ----
include/linux/ext2_fs.h | 12 ++++
include/linux/ext3_fs.h | 15 +++--
include/linux/reiserfs_fs.h | 34 ++++++----
lib/find_next_bit.c | 9 +--
net/rds/cong.c | 8 +--
virt/kvm/kvm_main.c | 3 +-
68 files changed, 304 insertions(+), 332 deletions(-)
delete mode 100644 include/asm-generic/bitops/ext2-non-atomic.h
delete mode 100644 include/asm-generic/bitops/minix-le.h
delete mode 100644 include/asm-generic/bitops/minix.h
^ permalink raw reply [flat|nested] 75+ messages in thread
* [PATCH 00/22] Introduce little endian bitops
2010-10-15 9:45 [PATCH 00/22] Introduce little endian bitops Akinobu Mita
@ 2010-10-15 9:45 ` Akinobu Mita
2010-10-15 9:46 ` [PATCH 01/22] bitops: merge little and big endian definisions in asm-generic/bitops/le.h Akinobu Mita
` (22 subsequent siblings)
23 siblings, 0 replies; 75+ messages in thread
From: Akinobu Mita @ 2010-10-15 9:45 UTC (permalink / raw)
To: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig,
Andrew Morton
Cc: Akinobu Mita
This patch series introduces little endian bit operations in asm/bitops.h
for all architectures and converts ext2 non-atomic and minix bit operation
to them. it enables to remove ext2 non-atomic and minix bit operations
from asm/bitops.h. The reason they should be removed from asm/bitops.h
is as follows:
For ext2 non-atomic bit operations, they are used for little endian byte order
bitmap access by some filesystems and modules. But using ext2_*() functions on
a module other than ext2 filesystem makes someone feel strange.
For minix bit operations, they are only used by minix filesystem and useless
by other modules. Because byte order of inode and block bitmap is defferent
on each architectures.
Akinobu Mita (22):
bitops: merge little and big endian definisions in
asm-generic/bitops/le.h
bitops: rename generic le bitops functions
s390: introduce little endian bitops
arm: introduce little endian bitops
m68k: introduce le bitops
m68knommu: introduce little endian bitops
bitops: introduce little endian bitops for most architectures
rds: stop including asm-generic/bitops/le.h
kvm: stop including asm-generic/bitops/le.h
asm-generic: use little endian bitops
ext3: use little endian bitops
ext4: use little endian bitops
ocfs2: use little endian bitops
nilfs2: use little endian bitops
reiserfs: use little endian bitops
udf: use little endian bitops
ufs: use little endian bitops
md: use little endian bit operations
dm: use little endian bit operations
bitops: remove ext2 non-atomic bitops from asm/bitops.h
m68k: convert minix bitops to use little endian bitops
bitops: remove minix bitops from asm/bitops.h
arch/Kconfig | 6 ++
arch/alpha/Kconfig | 1 +
arch/alpha/include/asm/bitops.h | 4 +-
arch/arm/Kconfig | 1 +
arch/arm/include/asm/bitops.h | 50 ++++++--------
arch/avr32/Kconfig | 1 +
arch/avr32/include/asm/bitops.h | 3 +-
arch/avr32/kernel/avr32_ksyms.c | 4 +-
arch/avr32/lib/findbit.S | 4 +-
arch/blackfin/Kconfig | 1 +
arch/blackfin/include/asm/bitops.h | 3 +-
arch/cris/Kconfig | 1 +
arch/cris/include/asm/bitops.h | 3 +-
arch/frv/Kconfig | 1 +
arch/frv/include/asm/bitops.h | 4 +-
arch/h8300/Kconfig | 1 +
arch/h8300/include/asm/bitops.h | 3 +-
arch/ia64/Kconfig | 1 +
arch/ia64/include/asm/bitops.h | 3 +-
arch/m32r/Kconfig | 1 +
arch/m32r/include/asm/bitops.h | 3 +-
arch/m68k/Kconfig | 1 +
arch/m68k/include/asm/bitops_mm.h | 89 ++++++++++----------------
arch/m68k/include/asm/bitops_no.h | 28 +++++----
arch/m68knommu/Kconfig | 1 +
arch/microblaze/Kconfig | 1 +
arch/mips/Kconfig | 1 +
arch/mips/include/asm/bitops.h | 3 +-
arch/mn10300/Kconfig | 1 +
arch/mn10300/include/asm/bitops.h | 3 +-
arch/parisc/Kconfig | 1 +
arch/parisc/include/asm/bitops.h | 4 +-
arch/powerpc/Kconfig | 1 +
arch/powerpc/include/asm/bitops.h | 35 +---------
arch/s390/Kconfig | 1 +
arch/s390/include/asm/bitops.h | 45 ++++++++------
arch/score/Kconfig | 3 +
arch/sh/Kconfig | 1 +
arch/sh/include/asm/bitops.h | 3 +-
arch/sparc/Kconfig | 1 +
arch/sparc/include/asm/bitops_32.h | 3 +-
arch/sparc/include/asm/bitops_64.h | 4 +-
arch/tile/Kconfig | 1 +
arch/tile/include/asm/bitops.h | 3 +-
arch/x86/Kconfig | 1 +
arch/x86/include/asm/bitops.h | 4 +-
arch/xtensa/Kconfig | 1 +
arch/xtensa/include/asm/bitops.h | 3 +-
drivers/md/bitmap.c | 6 +-
drivers/md/dm-log.c | 8 +-
fs/ext4/ext4.h | 18 ++++--
fs/minix/minix.h | 37 +++++++++++
fs/nilfs2/alloc.h | 3 +-
fs/ocfs2/ocfs2.h | 13 ++--
fs/udf/balloc.c | 11 ++-
fs/ufs/util.h | 2 +-
include/asm-generic/bitops.h | 3 +-
include/asm-generic/bitops/ext2-atomic.h | 4 +-
include/asm-generic/bitops/ext2-non-atomic.h | 20 ------
include/asm-generic/bitops/le.h | 56 +++++++---------
include/asm-generic/bitops/minix-le.h | 17 -----
include/asm-generic/bitops/minix.h | 15 ----
include/linux/ext2_fs.h | 12 ++++
include/linux/ext3_fs.h | 15 +++--
include/linux/reiserfs_fs.h | 34 ++++++----
lib/find_next_bit.c | 9 +--
net/rds/cong.c | 8 +--
virt/kvm/kvm_main.c | 3 +-
68 files changed, 304 insertions(+), 332 deletions(-)
delete mode 100644 include/asm-generic/bitops/ext2-non-atomic.h
delete mode 100644 include/asm-generic/bitops/minix-le.h
delete mode 100644 include/asm-generic/bitops/minix.h
^ permalink raw reply [flat|nested] 75+ messages in thread
* [PATCH 01/22] bitops: merge little and big endian definisions in asm-generic/bitops/le.h
2010-10-15 9:45 [PATCH 00/22] Introduce little endian bitops Akinobu Mita
2010-10-15 9:45 ` Akinobu Mita
@ 2010-10-15 9:46 ` Akinobu Mita
2010-10-15 9:46 ` [PATCH 02/22] bitops: rename generic le bitops functions Akinobu Mita
` (21 subsequent siblings)
23 siblings, 0 replies; 75+ messages in thread
From: Akinobu Mita @ 2010-10-15 9:46 UTC (permalink / raw)
To: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig,
Andrew Morton
Cc: Akinobu Mita
In order to make the forthcoming changes smaller, this merges
macro definisions in asm-generic/bitops/le.h for big endian and
little endian as much as possible.
This also removes unused BITOP_WORD macro.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
---
include/asm-generic/bitops/le.h | 38 +++++++++++++++-----------------------
1 files changed, 15 insertions(+), 23 deletions(-)
diff --git a/include/asm-generic/bitops/le.h b/include/asm-generic/bitops/le.h
index 80e3bf1..db2be81 100644
--- a/include/asm-generic/bitops/le.h
+++ b/include/asm-generic/bitops/le.h
@@ -4,27 +4,28 @@
#include <asm/types.h>
#include <asm/byteorder.h>
-#define BITOP_WORD(nr) ((nr) / BITS_PER_LONG)
-#define BITOP_LE_SWIZZLE ((BITS_PER_LONG-1) & ~0x7)
-
#if defined(__LITTLE_ENDIAN)
-#define generic_test_le_bit(nr, addr) test_bit(nr, addr)
-#define generic___set_le_bit(nr, addr) __set_bit(nr, addr)
-#define generic___clear_le_bit(nr, addr) __clear_bit(nr, addr)
-
-#define generic_test_and_set_le_bit(nr, addr) test_and_set_bit(nr, addr)
-#define generic_test_and_clear_le_bit(nr, addr) test_and_clear_bit(nr, addr)
+#define BITOP_LE_SWIZZLE 0
-#define generic___test_and_set_le_bit(nr, addr) __test_and_set_bit(nr, addr)
-#define generic___test_and_clear_le_bit(nr, addr) __test_and_clear_bit(nr, addr)
-
-#define generic_find_next_zero_le_bit(addr, size, offset) find_next_zero_bit(addr, size, offset)
+#define generic_find_next_zero_le_bit(addr, size, offset) \
+ find_next_zero_bit(addr, size, offset)
#define generic_find_next_le_bit(addr, size, offset) \
- find_next_bit(addr, size, offset)
+ find_next_bit(addr, size, offset)
#elif defined(__BIG_ENDIAN)
+#define BITOP_LE_SWIZZLE ((BITS_PER_LONG-1) & ~0x7)
+
+extern unsigned long generic_find_next_zero_le_bit(const unsigned long *addr,
+ unsigned long size, unsigned long offset);
+extern unsigned long generic_find_next_le_bit(const unsigned long *addr,
+ unsigned long size, unsigned long offset);
+
+#else
+#error "Please fix <asm/byteorder.h>"
+#endif
+
#define generic_test_le_bit(nr, addr) \
test_bit((nr) ^ BITOP_LE_SWIZZLE, (addr))
#define generic___set_le_bit(nr, addr) \
@@ -42,15 +43,6 @@
#define generic___test_and_clear_le_bit(nr, addr) \
__test_and_clear_bit((nr) ^ BITOP_LE_SWIZZLE, (addr))
-extern unsigned long generic_find_next_zero_le_bit(const unsigned long *addr,
- unsigned long size, unsigned long offset);
-extern unsigned long generic_find_next_le_bit(const unsigned long *addr,
- unsigned long size, unsigned long offset);
-
-#else
-#error "Please fix <asm/byteorder.h>"
-#endif
-
#define generic_find_first_zero_le_bit(addr, size) \
generic_find_next_zero_le_bit((addr), (size), 0)
--
1.7.1.231.gd0b16
^ permalink raw reply related [flat|nested] 75+ messages in thread
* [PATCH 02/22] bitops: rename generic le bitops functions
2010-10-15 9:45 [PATCH 00/22] Introduce little endian bitops Akinobu Mita
2010-10-15 9:45 ` Akinobu Mita
2010-10-15 9:46 ` [PATCH 01/22] bitops: merge little and big endian definisions in asm-generic/bitops/le.h Akinobu Mita
@ 2010-10-15 9:46 ` Akinobu Mita
2010-10-15 9:46 ` Akinobu Mita
2010-10-15 9:46 ` [PATCH 03/22] s390: introduce little endian bitops Akinobu Mita
` (20 subsequent siblings)
23 siblings, 1 reply; 75+ messages in thread
From: Akinobu Mita @ 2010-10-15 9:46 UTC (permalink / raw)
To: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig,
Andrew Morton
Cc: Akinobu Mita
As a preparation for providing little endian bitops for all architectures,
This removes generic_ prefix from little endian bitops function names
in asm-generic/bitops/le.h.
s/generic_find_next_le_bit/find_next_le_bit/
s/generic_find_next_zero_le_bit/find_next_zero_le_bit/
s/generic_find_first_zero_le_bit/find_first_zero_le_bit/
s/generic___test_and_set_le_bit/__test_and_set_le_bit/
s/generic___test_and_clear_le_bit/__test_and_clear_le_bit/
s/generic_test_le_bit/test_le_bit/
s/generic___set_le_bit/__set_le_bit/
s/generic___clear_le_bit/__clear_le_bit/
s/generic_test_and_set_le_bit/test_and_set_le_bit/
s/generic_test_and_clear_le_bit/test_and_clear_le_bit/
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
---
arch/avr32/kernel/avr32_ksyms.c | 4 ++--
arch/avr32/lib/findbit.S | 4 ++--
arch/m68k/include/asm/bitops_mm.h | 8 ++++----
arch/m68k/include/asm/bitops_no.h | 2 +-
arch/powerpc/include/asm/bitops.h | 11 ++++++-----
include/asm-generic/bitops/ext2-non-atomic.h | 12 ++++++------
include/asm-generic/bitops/le.h | 26 +++++++++++++-------------
include/asm-generic/bitops/minix-le.h | 10 +++++-----
lib/find_next_bit.c | 9 ++++-----
net/rds/cong.c | 6 +++---
virt/kvm/kvm_main.c | 2 +-
11 files changed, 47 insertions(+), 47 deletions(-)
diff --git a/arch/avr32/kernel/avr32_ksyms.c b/arch/avr32/kernel/avr32_ksyms.c
index 11e310c..c63b943 100644
--- a/arch/avr32/kernel/avr32_ksyms.c
+++ b/arch/avr32/kernel/avr32_ksyms.c
@@ -58,8 +58,8 @@ EXPORT_SYMBOL(find_first_zero_bit);
EXPORT_SYMBOL(find_next_zero_bit);
EXPORT_SYMBOL(find_first_bit);
EXPORT_SYMBOL(find_next_bit);
-EXPORT_SYMBOL(generic_find_next_le_bit);
-EXPORT_SYMBOL(generic_find_next_zero_le_bit);
+EXPORT_SYMBOL(find_next_le_bit);
+EXPORT_SYMBOL(find_next_zero_le_bit);
/* I/O primitives (lib/io-*.S) */
EXPORT_SYMBOL(__raw_readsb);
diff --git a/arch/avr32/lib/findbit.S b/arch/avr32/lib/findbit.S
index 997b33b..6880d85 100644
--- a/arch/avr32/lib/findbit.S
+++ b/arch/avr32/lib/findbit.S
@@ -123,7 +123,7 @@ ENTRY(find_next_bit)
brgt 1b
retal r11
-ENTRY(generic_find_next_le_bit)
+ENTRY(find_next_le_bit)
lsr r8, r10, 5
sub r9, r11, r10
retle r11
@@ -153,7 +153,7 @@ ENTRY(generic_find_next_le_bit)
brgt 1b
retal r11
-ENTRY(generic_find_next_zero_le_bit)
+ENTRY(find_next_zero_le_bit)
lsr r8, r10, 5
sub r9, r11, r10
retle r11
diff --git a/arch/m68k/include/asm/bitops_mm.h b/arch/m68k/include/asm/bitops_mm.h
index b4ecdaa..f1010ab 100644
--- a/arch/m68k/include/asm/bitops_mm.h
+++ b/arch/m68k/include/asm/bitops_mm.h
@@ -366,9 +366,9 @@ static inline int minix_test_bit(int nr, const void *vaddr)
#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))
#define ext2_find_next_zero_bit(addr, size, offset) \
- generic_find_next_zero_le_bit((unsigned long *)addr, size, offset)
+ find_next_zero_le_bit((unsigned long *)addr, size, offset)
#define ext2_find_next_bit(addr, size, offset) \
- generic_find_next_le_bit((unsigned long *)addr, size, offset)
+ find_next_le_bit((unsigned long *)addr, size, offset)
static inline int ext2_test_bit(int nr, const void *vaddr)
{
@@ -398,7 +398,7 @@ static inline int ext2_find_first_zero_bit(const void *vaddr, unsigned size)
return (p - addr) * 32 + res;
}
-static inline unsigned long generic_find_next_zero_le_bit(const unsigned long *addr,
+static inline unsigned long find_next_zero_le_bit(const unsigned long *addr,
unsigned long size, unsigned long offset)
{
const unsigned long *p = addr + (offset >> 5);
@@ -440,7 +440,7 @@ static inline int ext2_find_first_bit(const void *vaddr, unsigned size)
return (p - addr) * 32 + res;
}
-static inline unsigned long generic_find_next_le_bit(const unsigned long *addr,
+static inline unsigned long find_next_le_bit(const unsigned long *addr,
unsigned long size, unsigned long offset)
{
const unsigned long *p = addr + (offset >> 5);
diff --git a/arch/m68k/include/asm/bitops_no.h b/arch/m68k/include/asm/bitops_no.h
index 9d3cbe5..292e1ce 100644
--- a/arch/m68k/include/asm/bitops_no.h
+++ b/arch/m68k/include/asm/bitops_no.h
@@ -325,7 +325,7 @@ found_middle:
}
#define ext2_find_next_bit(addr, size, off) \
- generic_find_next_le_bit((unsigned long *)(addr), (size), (off))
+ find_next_le_bit((unsigned long *)(addr), (size), (off))
#include <asm-generic/bitops/minix.h>
#endif /* __KERNEL__ */
diff --git a/arch/powerpc/include/asm/bitops.h b/arch/powerpc/include/asm/bitops.h
index 30964ae..b4f3f84 100644
--- a/arch/powerpc/include/asm/bitops.h
+++ b/arch/powerpc/include/asm/bitops.h
@@ -294,11 +294,12 @@ static __inline__ int test_le_bit(unsigned long nr,
#define __test_and_clear_le_bit(nr, addr) \
__test_and_clear_bit((nr) ^ BITOP_LE_SWIZZLE, (addr))
-#define find_first_zero_le_bit(addr, size) generic_find_next_zero_le_bit((addr), (size), 0)
-unsigned long generic_find_next_zero_le_bit(const unsigned long *addr,
+#define find_first_zero_le_bit(addr, size) \
+ find_next_zero_le_bit((addr), (size), 0)
+unsigned long find_next_zero_le_bit(const unsigned long *addr,
unsigned long size, unsigned long offset);
-unsigned long generic_find_next_le_bit(const unsigned long *addr,
+unsigned long find_next_le_bit(const unsigned long *addr,
unsigned long size, unsigned long offset);
/* Bitmap functions for the ext2 filesystem */
@@ -317,10 +318,10 @@ unsigned long generic_find_next_le_bit(const unsigned long *addr,
#define ext2_find_first_zero_bit(addr, size) \
find_first_zero_le_bit((unsigned long*)addr, size)
#define ext2_find_next_zero_bit(addr, size, off) \
- generic_find_next_zero_le_bit((unsigned long*)addr, size, off)
+ find_next_zero_le_bit((unsigned long *)addr, size, off)
#define ext2_find_next_bit(addr, size, off) \
- generic_find_next_le_bit((unsigned long *)addr, size, off)
+ find_next_le_bit((unsigned long *)addr, size, off)
/* Bitmap functions for the minix filesystem. */
#define minix_test_and_set_bit(nr,addr) \
diff --git a/include/asm-generic/bitops/ext2-non-atomic.h b/include/asm-generic/bitops/ext2-non-atomic.h
index 63cf822..9c7bb9a 100644
--- a/include/asm-generic/bitops/ext2-non-atomic.h
+++ b/include/asm-generic/bitops/ext2-non-atomic.h
@@ -4,17 +4,17 @@
#include <asm-generic/bitops/le.h>
#define ext2_set_bit(nr,addr) \
- generic___test_and_set_le_bit((nr),(unsigned long *)(addr))
+ __test_and_set_le_bit((nr), (unsigned long *)(addr))
#define ext2_clear_bit(nr,addr) \
- generic___test_and_clear_le_bit((nr),(unsigned long *)(addr))
+ __test_and_clear_le_bit((nr), (unsigned long *)(addr))
#define ext2_test_bit(nr,addr) \
- generic_test_le_bit((nr),(unsigned long *)(addr))
+ test_le_bit((nr), (unsigned long *)(addr))
#define ext2_find_first_zero_bit(addr, size) \
- generic_find_first_zero_le_bit((unsigned long *)(addr), (size))
+ find_first_zero_le_bit((unsigned long *)(addr), (size))
#define ext2_find_next_zero_bit(addr, size, off) \
- generic_find_next_zero_le_bit((unsigned long *)(addr), (size), (off))
+ find_next_zero_le_bit((unsigned long *)(addr), (size), (off))
#define ext2_find_next_bit(addr, size, off) \
- generic_find_next_le_bit((unsigned long *)(addr), (size), (off))
+ find_next_le_bit((unsigned long *)(addr), (size), (off))
#endif /* _ASM_GENERIC_BITOPS_EXT2_NON_ATOMIC_H_ */
diff --git a/include/asm-generic/bitops/le.h b/include/asm-generic/bitops/le.h
index db2be81..6ad46ce 100644
--- a/include/asm-generic/bitops/le.h
+++ b/include/asm-generic/bitops/le.h
@@ -8,42 +8,42 @@
#define BITOP_LE_SWIZZLE 0
-#define generic_find_next_zero_le_bit(addr, size, offset) \
+#define find_next_zero_le_bit(addr, size, offset) \
find_next_zero_bit(addr, size, offset)
-#define generic_find_next_le_bit(addr, size, offset) \
+#define find_next_le_bit(addr, size, offset) \
find_next_bit(addr, size, offset)
#elif defined(__BIG_ENDIAN)
#define BITOP_LE_SWIZZLE ((BITS_PER_LONG-1) & ~0x7)
-extern unsigned long generic_find_next_zero_le_bit(const unsigned long *addr,
+extern unsigned long find_next_zero_le_bit(const unsigned long *addr,
unsigned long size, unsigned long offset);
-extern unsigned long generic_find_next_le_bit(const unsigned long *addr,
+extern unsigned long find_next_le_bit(const unsigned long *addr,
unsigned long size, unsigned long offset);
#else
#error "Please fix <asm/byteorder.h>"
#endif
-#define generic_test_le_bit(nr, addr) \
+#define test_le_bit(nr, addr) \
test_bit((nr) ^ BITOP_LE_SWIZZLE, (addr))
-#define generic___set_le_bit(nr, addr) \
+#define __set_le_bit(nr, addr) \
__set_bit((nr) ^ BITOP_LE_SWIZZLE, (addr))
-#define generic___clear_le_bit(nr, addr) \
+#define __clear_le_bit(nr, addr) \
__clear_bit((nr) ^ BITOP_LE_SWIZZLE, (addr))
-#define generic_test_and_set_le_bit(nr, addr) \
+#define test_and_set_le_bit(nr, addr) \
test_and_set_bit((nr) ^ BITOP_LE_SWIZZLE, (addr))
-#define generic_test_and_clear_le_bit(nr, addr) \
+#define test_and_clear_le_bit(nr, addr) \
test_and_clear_bit((nr) ^ BITOP_LE_SWIZZLE, (addr))
-#define generic___test_and_set_le_bit(nr, addr) \
+#define __test_and_set_le_bit(nr, addr) \
__test_and_set_bit((nr) ^ BITOP_LE_SWIZZLE, (addr))
-#define generic___test_and_clear_le_bit(nr, addr) \
+#define __test_and_clear_le_bit(nr, addr) \
__test_and_clear_bit((nr) ^ BITOP_LE_SWIZZLE, (addr))
-#define generic_find_first_zero_le_bit(addr, size) \
- generic_find_next_zero_le_bit((addr), (size), 0)
+#define find_first_zero_le_bit(addr, size) \
+ find_next_zero_le_bit((addr), (size), 0)
#endif /* _ASM_GENERIC_BITOPS_LE_H_ */
diff --git a/include/asm-generic/bitops/minix-le.h b/include/asm-generic/bitops/minix-le.h
index 4a981c1..ed0ae09 100644
--- a/include/asm-generic/bitops/minix-le.h
+++ b/include/asm-generic/bitops/minix-le.h
@@ -4,14 +4,14 @@
#include <asm-generic/bitops/le.h>
#define minix_test_and_set_bit(nr,addr) \
- generic___test_and_set_le_bit((nr),(unsigned long *)(addr))
+ __test_and_set_le_bit((nr), (unsigned long *)(addr))
#define minix_set_bit(nr,addr) \
- generic___set_le_bit((nr),(unsigned long *)(addr))
+ __set_le_bit((nr), (unsigned long *)(addr))
#define minix_test_and_clear_bit(nr,addr) \
- generic___test_and_clear_le_bit((nr),(unsigned long *)(addr))
+ __test_and_clear_le_bit((nr), (unsigned long *)(addr))
#define minix_test_bit(nr,addr) \
- generic_test_le_bit((nr),(unsigned long *)(addr))
+ test_le_bit((nr), (unsigned long *)(addr))
#define minix_find_first_zero_bit(addr,size) \
- generic_find_first_zero_le_bit((unsigned long *)(addr),(size))
+ find_first_zero_le_bit((unsigned long *)(addr), (size))
#endif /* _ASM_GENERIC_BITOPS_MINIX_LE_H_ */
diff --git a/lib/find_next_bit.c b/lib/find_next_bit.c
index 24c59de..eb8934b 100644
--- a/lib/find_next_bit.c
+++ b/lib/find_next_bit.c
@@ -185,7 +185,7 @@ static inline unsigned long ext2_swab(const unsigned long y)
#endif
}
-unsigned long generic_find_next_zero_le_bit(const unsigned long *addr, unsigned
+unsigned long find_next_zero_le_bit(const unsigned long *addr, unsigned
long size, unsigned long offset)
{
const unsigned long *p = addr + BITOP_WORD(offset);
@@ -226,10 +226,9 @@ found_middle:
found_middle_swap:
return result + ffz(ext2_swab(tmp));
}
+EXPORT_SYMBOL(find_next_zero_le_bit);
-EXPORT_SYMBOL(generic_find_next_zero_le_bit);
-
-unsigned long generic_find_next_le_bit(const unsigned long *addr, unsigned
+unsigned long find_next_le_bit(const unsigned long *addr, unsigned
long size, unsigned long offset)
{
const unsigned long *p = addr + BITOP_WORD(offset);
@@ -271,5 +270,5 @@ found_middle:
found_middle_swap:
return result + __ffs(ext2_swab(tmp));
}
-EXPORT_SYMBOL(generic_find_next_le_bit);
+EXPORT_SYMBOL(find_next_le_bit);
#endif /* __BIG_ENDIAN */
diff --git a/net/rds/cong.c b/net/rds/cong.c
index 0871a29..c6784d5 100644
--- a/net/rds/cong.c
+++ b/net/rds/cong.c
@@ -285,7 +285,7 @@ void rds_cong_set_bit(struct rds_cong_map *map, __be16 port)
i = be16_to_cpu(port) / RDS_CONG_MAP_PAGE_BITS;
off = be16_to_cpu(port) % RDS_CONG_MAP_PAGE_BITS;
- generic___set_le_bit(off, (void *)map->m_page_addrs[i]);
+ __set_le_bit(off, (void *)map->m_page_addrs[i]);
}
void rds_cong_clear_bit(struct rds_cong_map *map, __be16 port)
@@ -299,7 +299,7 @@ void rds_cong_clear_bit(struct rds_cong_map *map, __be16 port)
i = be16_to_cpu(port) / RDS_CONG_MAP_PAGE_BITS;
off = be16_to_cpu(port) % RDS_CONG_MAP_PAGE_BITS;
- generic___clear_le_bit(off, (void *)map->m_page_addrs[i]);
+ __clear_le_bit(off, (void *)map->m_page_addrs[i]);
}
static int rds_cong_test_bit(struct rds_cong_map *map, __be16 port)
@@ -310,7 +310,7 @@ static int rds_cong_test_bit(struct rds_cong_map *map, __be16 port)
i = be16_to_cpu(port) / RDS_CONG_MAP_PAGE_BITS;
off = be16_to_cpu(port) % RDS_CONG_MAP_PAGE_BITS;
- return generic_test_le_bit(off, (void *)map->m_page_addrs[i]);
+ return test_le_bit(off, (void *)map->m_page_addrs[i]);
}
void rds_cong_add_socket(struct rds_sock *rs)
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 5186e72..2d9927c 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -1208,7 +1208,7 @@ void mark_page_dirty(struct kvm *kvm, gfn_t gfn)
if (memslot && memslot->dirty_bitmap) {
unsigned long rel_gfn = gfn - memslot->base_gfn;
- generic___set_le_bit(rel_gfn, memslot->dirty_bitmap);
+ __set_le_bit(rel_gfn, memslot->dirty_bitmap);
}
}
--
1.7.1.231.gd0b16
^ permalink raw reply related [flat|nested] 75+ messages in thread
* [PATCH 02/22] bitops: rename generic le bitops functions
2010-10-15 9:46 ` [PATCH 02/22] bitops: rename generic le bitops functions Akinobu Mita
@ 2010-10-15 9:46 ` Akinobu Mita
0 siblings, 0 replies; 75+ messages in thread
From: Akinobu Mita @ 2010-10-15 9:46 UTC (permalink / raw)
To: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig,
Andrew Morton
Cc: Akinobu Mita
As a preparation for providing little endian bitops for all architectures,
This removes generic_ prefix from little endian bitops function names
in asm-generic/bitops/le.h.
s/generic_find_next_le_bit/find_next_le_bit/
s/generic_find_next_zero_le_bit/find_next_zero_le_bit/
s/generic_find_first_zero_le_bit/find_first_zero_le_bit/
s/generic___test_and_set_le_bit/__test_and_set_le_bit/
s/generic___test_and_clear_le_bit/__test_and_clear_le_bit/
s/generic_test_le_bit/test_le_bit/
s/generic___set_le_bit/__set_le_bit/
s/generic___clear_le_bit/__clear_le_bit/
s/generic_test_and_set_le_bit/test_and_set_le_bit/
s/generic_test_and_clear_le_bit/test_and_clear_le_bit/
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
---
arch/avr32/kernel/avr32_ksyms.c | 4 ++--
arch/avr32/lib/findbit.S | 4 ++--
arch/m68k/include/asm/bitops_mm.h | 8 ++++----
arch/m68k/include/asm/bitops_no.h | 2 +-
arch/powerpc/include/asm/bitops.h | 11 ++++++-----
include/asm-generic/bitops/ext2-non-atomic.h | 12 ++++++------
include/asm-generic/bitops/le.h | 26 +++++++++++++-------------
include/asm-generic/bitops/minix-le.h | 10 +++++-----
lib/find_next_bit.c | 9 ++++-----
net/rds/cong.c | 6 +++---
virt/kvm/kvm_main.c | 2 +-
11 files changed, 47 insertions(+), 47 deletions(-)
diff --git a/arch/avr32/kernel/avr32_ksyms.c b/arch/avr32/kernel/avr32_ksyms.c
index 11e310c..c63b943 100644
--- a/arch/avr32/kernel/avr32_ksyms.c
+++ b/arch/avr32/kernel/avr32_ksyms.c
@@ -58,8 +58,8 @@ EXPORT_SYMBOL(find_first_zero_bit);
EXPORT_SYMBOL(find_next_zero_bit);
EXPORT_SYMBOL(find_first_bit);
EXPORT_SYMBOL(find_next_bit);
-EXPORT_SYMBOL(generic_find_next_le_bit);
-EXPORT_SYMBOL(generic_find_next_zero_le_bit);
+EXPORT_SYMBOL(find_next_le_bit);
+EXPORT_SYMBOL(find_next_zero_le_bit);
/* I/O primitives (lib/io-*.S) */
EXPORT_SYMBOL(__raw_readsb);
diff --git a/arch/avr32/lib/findbit.S b/arch/avr32/lib/findbit.S
index 997b33b..6880d85 100644
--- a/arch/avr32/lib/findbit.S
+++ b/arch/avr32/lib/findbit.S
@@ -123,7 +123,7 @@ ENTRY(find_next_bit)
brgt 1b
retal r11
-ENTRY(generic_find_next_le_bit)
+ENTRY(find_next_le_bit)
lsr r8, r10, 5
sub r9, r11, r10
retle r11
@@ -153,7 +153,7 @@ ENTRY(generic_find_next_le_bit)
brgt 1b
retal r11
-ENTRY(generic_find_next_zero_le_bit)
+ENTRY(find_next_zero_le_bit)
lsr r8, r10, 5
sub r9, r11, r10
retle r11
diff --git a/arch/m68k/include/asm/bitops_mm.h b/arch/m68k/include/asm/bitops_mm.h
index b4ecdaa..f1010ab 100644
--- a/arch/m68k/include/asm/bitops_mm.h
+++ b/arch/m68k/include/asm/bitops_mm.h
@@ -366,9 +366,9 @@ static inline int minix_test_bit(int nr, const void *vaddr)
#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))
#define ext2_find_next_zero_bit(addr, size, offset) \
- generic_find_next_zero_le_bit((unsigned long *)addr, size, offset)
+ find_next_zero_le_bit((unsigned long *)addr, size, offset)
#define ext2_find_next_bit(addr, size, offset) \
- generic_find_next_le_bit((unsigned long *)addr, size, offset)
+ find_next_le_bit((unsigned long *)addr, size, offset)
static inline int ext2_test_bit(int nr, const void *vaddr)
{
@@ -398,7 +398,7 @@ static inline int ext2_find_first_zero_bit(const void *vaddr, unsigned size)
return (p - addr) * 32 + res;
}
-static inline unsigned long generic_find_next_zero_le_bit(const unsigned long *addr,
+static inline unsigned long find_next_zero_le_bit(const unsigned long *addr,
unsigned long size, unsigned long offset)
{
const unsigned long *p = addr + (offset >> 5);
@@ -440,7 +440,7 @@ static inline int ext2_find_first_bit(const void *vaddr, unsigned size)
return (p - addr) * 32 + res;
}
-static inline unsigned long generic_find_next_le_bit(const unsigned long *addr,
+static inline unsigned long find_next_le_bit(const unsigned long *addr,
unsigned long size, unsigned long offset)
{
const unsigned long *p = addr + (offset >> 5);
diff --git a/arch/m68k/include/asm/bitops_no.h b/arch/m68k/include/asm/bitops_no.h
index 9d3cbe5..292e1ce 100644
--- a/arch/m68k/include/asm/bitops_no.h
+++ b/arch/m68k/include/asm/bitops_no.h
@@ -325,7 +325,7 @@ found_middle:
}
#define ext2_find_next_bit(addr, size, off) \
- generic_find_next_le_bit((unsigned long *)(addr), (size), (off))
+ find_next_le_bit((unsigned long *)(addr), (size), (off))
#include <asm-generic/bitops/minix.h>
#endif /* __KERNEL__ */
diff --git a/arch/powerpc/include/asm/bitops.h b/arch/powerpc/include/asm/bitops.h
index 30964ae..b4f3f84 100644
--- a/arch/powerpc/include/asm/bitops.h
+++ b/arch/powerpc/include/asm/bitops.h
@@ -294,11 +294,12 @@ static __inline__ int test_le_bit(unsigned long nr,
#define __test_and_clear_le_bit(nr, addr) \
__test_and_clear_bit((nr) ^ BITOP_LE_SWIZZLE, (addr))
-#define find_first_zero_le_bit(addr, size) generic_find_next_zero_le_bit((addr), (size), 0)
-unsigned long generic_find_next_zero_le_bit(const unsigned long *addr,
+#define find_first_zero_le_bit(addr, size) \
+ find_next_zero_le_bit((addr), (size), 0)
+unsigned long find_next_zero_le_bit(const unsigned long *addr,
unsigned long size, unsigned long offset);
-unsigned long generic_find_next_le_bit(const unsigned long *addr,
+unsigned long find_next_le_bit(const unsigned long *addr,
unsigned long size, unsigned long offset);
/* Bitmap functions for the ext2 filesystem */
@@ -317,10 +318,10 @@ unsigned long generic_find_next_le_bit(const unsigned long *addr,
#define ext2_find_first_zero_bit(addr, size) \
find_first_zero_le_bit((unsigned long*)addr, size)
#define ext2_find_next_zero_bit(addr, size, off) \
- generic_find_next_zero_le_bit((unsigned long*)addr, size, off)
+ find_next_zero_le_bit((unsigned long *)addr, size, off)
#define ext2_find_next_bit(addr, size, off) \
- generic_find_next_le_bit((unsigned long *)addr, size, off)
+ find_next_le_bit((unsigned long *)addr, size, off)
/* Bitmap functions for the minix filesystem. */
#define minix_test_and_set_bit(nr,addr) \
diff --git a/include/asm-generic/bitops/ext2-non-atomic.h b/include/asm-generic/bitops/ext2-non-atomic.h
index 63cf822..9c7bb9a 100644
--- a/include/asm-generic/bitops/ext2-non-atomic.h
+++ b/include/asm-generic/bitops/ext2-non-atomic.h
@@ -4,17 +4,17 @@
#include <asm-generic/bitops/le.h>
#define ext2_set_bit(nr,addr) \
- generic___test_and_set_le_bit((nr),(unsigned long *)(addr))
+ __test_and_set_le_bit((nr), (unsigned long *)(addr))
#define ext2_clear_bit(nr,addr) \
- generic___test_and_clear_le_bit((nr),(unsigned long *)(addr))
+ __test_and_clear_le_bit((nr), (unsigned long *)(addr))
#define ext2_test_bit(nr,addr) \
- generic_test_le_bit((nr),(unsigned long *)(addr))
+ test_le_bit((nr), (unsigned long *)(addr))
#define ext2_find_first_zero_bit(addr, size) \
- generic_find_first_zero_le_bit((unsigned long *)(addr), (size))
+ find_first_zero_le_bit((unsigned long *)(addr), (size))
#define ext2_find_next_zero_bit(addr, size, off) \
- generic_find_next_zero_le_bit((unsigned long *)(addr), (size), (off))
+ find_next_zero_le_bit((unsigned long *)(addr), (size), (off))
#define ext2_find_next_bit(addr, size, off) \
- generic_find_next_le_bit((unsigned long *)(addr), (size), (off))
+ find_next_le_bit((unsigned long *)(addr), (size), (off))
#endif /* _ASM_GENERIC_BITOPS_EXT2_NON_ATOMIC_H_ */
diff --git a/include/asm-generic/bitops/le.h b/include/asm-generic/bitops/le.h
index db2be81..6ad46ce 100644
--- a/include/asm-generic/bitops/le.h
+++ b/include/asm-generic/bitops/le.h
@@ -8,42 +8,42 @@
#define BITOP_LE_SWIZZLE 0
-#define generic_find_next_zero_le_bit(addr, size, offset) \
+#define find_next_zero_le_bit(addr, size, offset) \
find_next_zero_bit(addr, size, offset)
-#define generic_find_next_le_bit(addr, size, offset) \
+#define find_next_le_bit(addr, size, offset) \
find_next_bit(addr, size, offset)
#elif defined(__BIG_ENDIAN)
#define BITOP_LE_SWIZZLE ((BITS_PER_LONG-1) & ~0x7)
-extern unsigned long generic_find_next_zero_le_bit(const unsigned long *addr,
+extern unsigned long find_next_zero_le_bit(const unsigned long *addr,
unsigned long size, unsigned long offset);
-extern unsigned long generic_find_next_le_bit(const unsigned long *addr,
+extern unsigned long find_next_le_bit(const unsigned long *addr,
unsigned long size, unsigned long offset);
#else
#error "Please fix <asm/byteorder.h>"
#endif
-#define generic_test_le_bit(nr, addr) \
+#define test_le_bit(nr, addr) \
test_bit((nr) ^ BITOP_LE_SWIZZLE, (addr))
-#define generic___set_le_bit(nr, addr) \
+#define __set_le_bit(nr, addr) \
__set_bit((nr) ^ BITOP_LE_SWIZZLE, (addr))
-#define generic___clear_le_bit(nr, addr) \
+#define __clear_le_bit(nr, addr) \
__clear_bit((nr) ^ BITOP_LE_SWIZZLE, (addr))
-#define generic_test_and_set_le_bit(nr, addr) \
+#define test_and_set_le_bit(nr, addr) \
test_and_set_bit((nr) ^ BITOP_LE_SWIZZLE, (addr))
-#define generic_test_and_clear_le_bit(nr, addr) \
+#define test_and_clear_le_bit(nr, addr) \
test_and_clear_bit((nr) ^ BITOP_LE_SWIZZLE, (addr))
-#define generic___test_and_set_le_bit(nr, addr) \
+#define __test_and_set_le_bit(nr, addr) \
__test_and_set_bit((nr) ^ BITOP_LE_SWIZZLE, (addr))
-#define generic___test_and_clear_le_bit(nr, addr) \
+#define __test_and_clear_le_bit(nr, addr) \
__test_and_clear_bit((nr) ^ BITOP_LE_SWIZZLE, (addr))
-#define generic_find_first_zero_le_bit(addr, size) \
- generic_find_next_zero_le_bit((addr), (size), 0)
+#define find_first_zero_le_bit(addr, size) \
+ find_next_zero_le_bit((addr), (size), 0)
#endif /* _ASM_GENERIC_BITOPS_LE_H_ */
diff --git a/include/asm-generic/bitops/minix-le.h b/include/asm-generic/bitops/minix-le.h
index 4a981c1..ed0ae09 100644
--- a/include/asm-generic/bitops/minix-le.h
+++ b/include/asm-generic/bitops/minix-le.h
@@ -4,14 +4,14 @@
#include <asm-generic/bitops/le.h>
#define minix_test_and_set_bit(nr,addr) \
- generic___test_and_set_le_bit((nr),(unsigned long *)(addr))
+ __test_and_set_le_bit((nr), (unsigned long *)(addr))
#define minix_set_bit(nr,addr) \
- generic___set_le_bit((nr),(unsigned long *)(addr))
+ __set_le_bit((nr), (unsigned long *)(addr))
#define minix_test_and_clear_bit(nr,addr) \
- generic___test_and_clear_le_bit((nr),(unsigned long *)(addr))
+ __test_and_clear_le_bit((nr), (unsigned long *)(addr))
#define minix_test_bit(nr,addr) \
- generic_test_le_bit((nr),(unsigned long *)(addr))
+ test_le_bit((nr), (unsigned long *)(addr))
#define minix_find_first_zero_bit(addr,size) \
- generic_find_first_zero_le_bit((unsigned long *)(addr),(size))
+ find_first_zero_le_bit((unsigned long *)(addr), (size))
#endif /* _ASM_GENERIC_BITOPS_MINIX_LE_H_ */
diff --git a/lib/find_next_bit.c b/lib/find_next_bit.c
index 24c59de..eb8934b 100644
--- a/lib/find_next_bit.c
+++ b/lib/find_next_bit.c
@@ -185,7 +185,7 @@ static inline unsigned long ext2_swab(const unsigned long y)
#endif
}
-unsigned long generic_find_next_zero_le_bit(const unsigned long *addr, unsigned
+unsigned long find_next_zero_le_bit(const unsigned long *addr, unsigned
long size, unsigned long offset)
{
const unsigned long *p = addr + BITOP_WORD(offset);
@@ -226,10 +226,9 @@ found_middle:
found_middle_swap:
return result + ffz(ext2_swab(tmp));
}
+EXPORT_SYMBOL(find_next_zero_le_bit);
-EXPORT_SYMBOL(generic_find_next_zero_le_bit);
-
-unsigned long generic_find_next_le_bit(const unsigned long *addr, unsigned
+unsigned long find_next_le_bit(const unsigned long *addr, unsigned
long size, unsigned long offset)
{
const unsigned long *p = addr + BITOP_WORD(offset);
@@ -271,5 +270,5 @@ found_middle:
found_middle_swap:
return result + __ffs(ext2_swab(tmp));
}
-EXPORT_SYMBOL(generic_find_next_le_bit);
+EXPORT_SYMBOL(find_next_le_bit);
#endif /* __BIG_ENDIAN */
diff --git a/net/rds/cong.c b/net/rds/cong.c
index 0871a29..c6784d5 100644
--- a/net/rds/cong.c
+++ b/net/rds/cong.c
@@ -285,7 +285,7 @@ void rds_cong_set_bit(struct rds_cong_map *map, __be16 port)
i = be16_to_cpu(port) / RDS_CONG_MAP_PAGE_BITS;
off = be16_to_cpu(port) % RDS_CONG_MAP_PAGE_BITS;
- generic___set_le_bit(off, (void *)map->m_page_addrs[i]);
+ __set_le_bit(off, (void *)map->m_page_addrs[i]);
}
void rds_cong_clear_bit(struct rds_cong_map *map, __be16 port)
@@ -299,7 +299,7 @@ void rds_cong_clear_bit(struct rds_cong_map *map, __be16 port)
i = be16_to_cpu(port) / RDS_CONG_MAP_PAGE_BITS;
off = be16_to_cpu(port) % RDS_CONG_MAP_PAGE_BITS;
- generic___clear_le_bit(off, (void *)map->m_page_addrs[i]);
+ __clear_le_bit(off, (void *)map->m_page_addrs[i]);
}
static int rds_cong_test_bit(struct rds_cong_map *map, __be16 port)
@@ -310,7 +310,7 @@ static int rds_cong_test_bit(struct rds_cong_map *map, __be16 port)
i = be16_to_cpu(port) / RDS_CONG_MAP_PAGE_BITS;
off = be16_to_cpu(port) % RDS_CONG_MAP_PAGE_BITS;
- return generic_test_le_bit(off, (void *)map->m_page_addrs[i]);
+ return test_le_bit(off, (void *)map->m_page_addrs[i]);
}
void rds_cong_add_socket(struct rds_sock *rs)
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 5186e72..2d9927c 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -1208,7 +1208,7 @@ void mark_page_dirty(struct kvm *kvm, gfn_t gfn)
if (memslot && memslot->dirty_bitmap) {
unsigned long rel_gfn = gfn - memslot->base_gfn;
- generic___set_le_bit(rel_gfn, memslot->dirty_bitmap);
+ __set_le_bit(rel_gfn, memslot->dirty_bitmap);
}
}
--
1.7.1.231.gd0b16
^ permalink raw reply related [flat|nested] 75+ messages in thread
* [PATCH 03/22] s390: introduce little endian bitops
2010-10-15 9:45 [PATCH 00/22] Introduce little endian bitops Akinobu Mita
` (2 preceding siblings ...)
2010-10-15 9:46 ` [PATCH 02/22] bitops: rename generic le bitops functions Akinobu Mita
@ 2010-10-15 9:46 ` Akinobu Mita
2010-10-15 9:46 ` Akinobu Mita
2010-10-15 11:12 ` Arnd Bergmann
2010-10-15 9:46 ` [PATCH 04/22] arm: " Akinobu Mita
` (19 subsequent siblings)
23 siblings, 2 replies; 75+ messages in thread
From: Akinobu Mita @ 2010-10-15 9:46 UTC (permalink / raw)
To: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig,
Andrew Morton
Cc: Akinobu Mita, Martin Schwidefsky, Heiko Carstens, linux390,
linux-s390
Introduce little endian bit operations by renaming native ext2 bit
operations. The ext2 bit operations are kept by using little endian
bit operations until the conversions are finished.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: linux390@de.ibm.com
Cc: linux-s390@vger.kernel.org
---
arch/s390/include/asm/bitops.h | 59 +++++++++++++++++++++++++++------------
1 files changed, 41 insertions(+), 18 deletions(-)
diff --git a/arch/s390/include/asm/bitops.h b/arch/s390/include/asm/bitops.h
index 2e05972..5d14515 100644
--- a/arch/s390/include/asm/bitops.h
+++ b/arch/s390/include/asm/bitops.h
@@ -742,18 +742,22 @@ static inline int sched_find_first_bit(unsigned long *b)
* 23 22 21 20 19 18 17 16 31 30 29 28 27 26 25 24
*/
-#define ext2_set_bit(nr, addr) \
- __test_and_set_bit((nr)^(__BITOPS_WORDSIZE - 8), (unsigned long *)addr)
-#define ext2_set_bit_atomic(lock, nr, addr) \
- test_and_set_bit((nr)^(__BITOPS_WORDSIZE - 8), (unsigned long *)addr)
-#define ext2_clear_bit(nr, addr) \
- __test_and_clear_bit((nr)^(__BITOPS_WORDSIZE - 8), (unsigned long *)addr)
-#define ext2_clear_bit_atomic(lock, nr, addr) \
- test_and_clear_bit((nr)^(__BITOPS_WORDSIZE - 8), (unsigned long *)addr)
-#define ext2_test_bit(nr, addr) \
- test_bit((nr)^(__BITOPS_WORDSIZE - 8), (unsigned long *)addr)
-
-static inline int ext2_find_first_zero_bit(void *vaddr, unsigned int size)
+#define __set_le_bit(nr, addr) \
+ __set_bit((nr)^(__BITOPS_WORDSIZE - 8), (addr))
+#define __clear_le_bit(nr, addr) \
+ __clear_bit((nr)^(__BITOPS_WORDSIZE - 8), (addr))
+#define __test_and_set_le_bit(nr, addr) \
+ __test_and_set_bit((nr)^(__BITOPS_WORDSIZE - 8), (addr))
+#define test_and_set_le_bit(lock, nr, addr) \
+ test_and_set_bit((nr)^(__BITOPS_WORDSIZE - 8), (addr))
+#define __test_and_clear_le_bit(nr, addr) \
+ __test_and_clear_bit((nr)^(__BITOPS_WORDSIZE - 8), (addr))
+#define test_and_clear_le_bit(lock, nr, addr) \
+ test_and_clear_bit((nr)^(__BITOPS_WORDSIZE - 8), (addr))
+#define test_le_bit(nr, addr) \
+ test_bit((nr)^(__BITOPS_WORDSIZE - 8), (addr))
+
+static inline int find_first_zero_le_bit(void *vaddr, unsigned int size)
{
unsigned long bytes, bits;
@@ -764,7 +768,7 @@ static inline int ext2_find_first_zero_bit(void *vaddr, unsigned int size)
return (bits < size) ? bits : size;
}
-static inline int ext2_find_next_zero_bit(void *vaddr, unsigned long size,
+static inline int find_next_zero_le_bit(void *vaddr, unsigned long size,
unsigned long offset)
{
unsigned long *addr = vaddr, *p;
@@ -790,11 +794,10 @@ static inline int ext2_find_next_zero_bit(void *vaddr, unsigned long size,
size -= __BITOPS_WORDSIZE;
p++;
}
- return offset + ext2_find_first_zero_bit(p, size);
+ return offset + find_first_zero_le_bit(p, size);
}
-static inline unsigned long ext2_find_first_bit(void *vaddr,
- unsigned long size)
+static inline unsigned long find_first_le_bit(void *vaddr, unsigned long size)
{
unsigned long bytes, bits;
@@ -805,7 +808,7 @@ static inline unsigned long ext2_find_first_bit(void *vaddr,
return (bits < size) ? bits : size;
}
-static inline int ext2_find_next_bit(void *vaddr, unsigned long size,
+static inline int find_next_le_bit(void *vaddr, unsigned long size,
unsigned long offset)
{
unsigned long *addr = vaddr, *p;
@@ -831,9 +834,29 @@ static inline int ext2_find_next_bit(void *vaddr, unsigned long size,
size -= __BITOPS_WORDSIZE;
p++;
}
- return offset + ext2_find_first_bit(p, size);
+ return offset + find_first_le_bit(p, size);
}
+#define ext2_set_bit(nr, addr) \
+ __test_and_set_le_bit((nr), (unsigned long *)(addr))
+#define ext2_set_bit_atomic(lock, nr, addr) \
+ test_and_set_le_bit((nr), (unsigned long *)(addr))
+#define ext2_clear_bit(nr, addr) \
+ __test_and_clear_le_bit((nr), (unsigned long *)(addr))
+#define ext2_clear_bit_atomic(lock, nr, addr) \
+ test_and_clear_le_bit((nr), (unsigned long *)(addr))
+#define ext2_test_bit(nr, addr) \
+ test_le_bit((nr), (unsigned long *)(addr))
+
+#define ext2_find_first_zero_bit(vaddr, size) \
+ find_first_zero_le_bit((unsigned long *)(vaddr), (size))
+#define ext2_find_next_zero_bit(vaddr, size, offset) \
+ find_next_zero_le_bit((unsigned long *)(vaddr), (size), (offset))
+#define ext2_find_first_bit(vaddr, size) \
+ find_first_le_bit((unsigned long *)(vaddr), (size))
+#define ext2_find_next_bit(vaddr, size, offset) \
+ find_next_le_bit((unsigned long *)(vaddr), (size), (offset))
+
#include <asm-generic/bitops/minix.h>
#endif /* __KERNEL__ */
--
1.7.1.231.gd0b16
^ permalink raw reply related [flat|nested] 75+ messages in thread
* [PATCH 03/22] s390: introduce little endian bitops
2010-10-15 9:46 ` [PATCH 03/22] s390: introduce little endian bitops Akinobu Mita
@ 2010-10-15 9:46 ` Akinobu Mita
2010-10-15 11:12 ` Arnd Bergmann
1 sibling, 0 replies; 75+ messages in thread
From: Akinobu Mita @ 2010-10-15 9:46 UTC (permalink / raw)
To: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig,
Andrew Morton
Cc: Akinobu Mita, Martin Schwidefsky, Heiko Carstens, linux390,
linux-s390
Introduce little endian bit operations by renaming native ext2 bit
operations. The ext2 bit operations are kept by using little endian
bit operations until the conversions are finished.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: linux390@de.ibm.com
Cc: linux-s390@vger.kernel.org
---
arch/s390/include/asm/bitops.h | 59 +++++++++++++++++++++++++++------------
1 files changed, 41 insertions(+), 18 deletions(-)
diff --git a/arch/s390/include/asm/bitops.h b/arch/s390/include/asm/bitops.h
index 2e05972..5d14515 100644
--- a/arch/s390/include/asm/bitops.h
+++ b/arch/s390/include/asm/bitops.h
@@ -742,18 +742,22 @@ static inline int sched_find_first_bit(unsigned long *b)
* 23 22 21 20 19 18 17 16 31 30 29 28 27 26 25 24
*/
-#define ext2_set_bit(nr, addr) \
- __test_and_set_bit((nr)^(__BITOPS_WORDSIZE - 8), (unsigned long *)addr)
-#define ext2_set_bit_atomic(lock, nr, addr) \
- test_and_set_bit((nr)^(__BITOPS_WORDSIZE - 8), (unsigned long *)addr)
-#define ext2_clear_bit(nr, addr) \
- __test_and_clear_bit((nr)^(__BITOPS_WORDSIZE - 8), (unsigned long *)addr)
-#define ext2_clear_bit_atomic(lock, nr, addr) \
- test_and_clear_bit((nr)^(__BITOPS_WORDSIZE - 8), (unsigned long *)addr)
-#define ext2_test_bit(nr, addr) \
- test_bit((nr)^(__BITOPS_WORDSIZE - 8), (unsigned long *)addr)
-
-static inline int ext2_find_first_zero_bit(void *vaddr, unsigned int size)
+#define __set_le_bit(nr, addr) \
+ __set_bit((nr)^(__BITOPS_WORDSIZE - 8), (addr))
+#define __clear_le_bit(nr, addr) \
+ __clear_bit((nr)^(__BITOPS_WORDSIZE - 8), (addr))
+#define __test_and_set_le_bit(nr, addr) \
+ __test_and_set_bit((nr)^(__BITOPS_WORDSIZE - 8), (addr))
+#define test_and_set_le_bit(lock, nr, addr) \
+ test_and_set_bit((nr)^(__BITOPS_WORDSIZE - 8), (addr))
+#define __test_and_clear_le_bit(nr, addr) \
+ __test_and_clear_bit((nr)^(__BITOPS_WORDSIZE - 8), (addr))
+#define test_and_clear_le_bit(lock, nr, addr) \
+ test_and_clear_bit((nr)^(__BITOPS_WORDSIZE - 8), (addr))
+#define test_le_bit(nr, addr) \
+ test_bit((nr)^(__BITOPS_WORDSIZE - 8), (addr))
+
+static inline int find_first_zero_le_bit(void *vaddr, unsigned int size)
{
unsigned long bytes, bits;
@@ -764,7 +768,7 @@ static inline int ext2_find_first_zero_bit(void *vaddr, unsigned int size)
return (bits < size) ? bits : size;
}
-static inline int ext2_find_next_zero_bit(void *vaddr, unsigned long size,
+static inline int find_next_zero_le_bit(void *vaddr, unsigned long size,
unsigned long offset)
{
unsigned long *addr = vaddr, *p;
@@ -790,11 +794,10 @@ static inline int ext2_find_next_zero_bit(void *vaddr, unsigned long size,
size -= __BITOPS_WORDSIZE;
p++;
}
- return offset + ext2_find_first_zero_bit(p, size);
+ return offset + find_first_zero_le_bit(p, size);
}
-static inline unsigned long ext2_find_first_bit(void *vaddr,
- unsigned long size)
+static inline unsigned long find_first_le_bit(void *vaddr, unsigned long size)
{
unsigned long bytes, bits;
@@ -805,7 +808,7 @@ static inline unsigned long ext2_find_first_bit(void *vaddr,
return (bits < size) ? bits : size;
}
-static inline int ext2_find_next_bit(void *vaddr, unsigned long size,
+static inline int find_next_le_bit(void *vaddr, unsigned long size,
unsigned long offset)
{
unsigned long *addr = vaddr, *p;
@@ -831,9 +834,29 @@ static inline int ext2_find_next_bit(void *vaddr, unsigned long size,
size -= __BITOPS_WORDSIZE;
p++;
}
- return offset + ext2_find_first_bit(p, size);
+ return offset + find_first_le_bit(p, size);
}
+#define ext2_set_bit(nr, addr) \
+ __test_and_set_le_bit((nr), (unsigned long *)(addr))
+#define ext2_set_bit_atomic(lock, nr, addr) \
+ test_and_set_le_bit((nr), (unsigned long *)(addr))
+#define ext2_clear_bit(nr, addr) \
+ __test_and_clear_le_bit((nr), (unsigned long *)(addr))
+#define ext2_clear_bit_atomic(lock, nr, addr) \
+ test_and_clear_le_bit((nr), (unsigned long *)(addr))
+#define ext2_test_bit(nr, addr) \
+ test_le_bit((nr), (unsigned long *)(addr))
+
+#define ext2_find_first_zero_bit(vaddr, size) \
+ find_first_zero_le_bit((unsigned long *)(vaddr), (size))
+#define ext2_find_next_zero_bit(vaddr, size, offset) \
+ find_next_zero_le_bit((unsigned long *)(vaddr), (size), (offset))
+#define ext2_find_first_bit(vaddr, size) \
+ find_first_le_bit((unsigned long *)(vaddr), (size))
+#define ext2_find_next_bit(vaddr, size, offset) \
+ find_next_le_bit((unsigned long *)(vaddr), (size), (offset))
+
#include <asm-generic/bitops/minix.h>
#endif /* __KERNEL__ */
--
1.7.1.231.gd0b16
^ permalink raw reply related [flat|nested] 75+ messages in thread
* [PATCH 04/22] arm: introduce little endian bitops
2010-10-15 9:45 [PATCH 00/22] Introduce little endian bitops Akinobu Mita
` (3 preceding siblings ...)
2010-10-15 9:46 ` [PATCH 03/22] s390: introduce little endian bitops Akinobu Mita
@ 2010-10-15 9:46 ` Akinobu Mita
2010-10-18 9:26 ` Russell King - ARM Linux
2010-10-15 9:46 ` [PATCH 05/22] m68k: introduce le bitops Akinobu Mita
` (18 subsequent siblings)
23 siblings, 1 reply; 75+ messages in thread
From: Akinobu Mita @ 2010-10-15 9:46 UTC (permalink / raw)
To: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig,
Andrew Morton
Cc: Akinobu Mita, Russell King, linux-arm-kernel
Introduce little endian bit operations by renaming native ext2 bit
operations. The ext2 bit operations are kept by using little endian
bit operations until the conversions are finished.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: linux-arm-kernel@lists.infradead.org
---
arch/arm/include/asm/bitops.h | 46 +++++++++++++++++++++++++++++-----------
1 files changed, 33 insertions(+), 13 deletions(-)
diff --git a/arch/arm/include/asm/bitops.h b/arch/arm/include/asm/bitops.h
index 338ff19..d8af4af 100644
--- a/arch/arm/include/asm/bitops.h
+++ b/arch/arm/include/asm/bitops.h
@@ -303,41 +303,61 @@ static inline int fls(int x)
#include <asm-generic/bitops/hweight.h>
#include <asm-generic/bitops/lock.h>
+#define __set_le_bit(nr, p) \
+ __set_bit(WORD_BITOFF_TO_LE(nr), (p))
+#define __clear_le_bit(nr, p) \
+ __clear_bit(WORD_BITOFF_TO_LE(nr), (p))
+#define __test_and_set_le_bit(nr, p) \
+ __test_and_set_bit(WORD_BITOFF_TO_LE(nr), (p))
+#define test_and_set_le_bit(lock, nr, p) \
+ test_and_set_bit(WORD_BITOFF_TO_LE(nr), (p))
+#define __test_and_clear_le_bit(nr, p) \
+ __test_and_clear_bit(WORD_BITOFF_TO_LE(nr), (p))
+#define test_and_clear_le_bit(lock, nr, p) \
+ test_and_clear_bit(WORD_BITOFF_TO_LE(nr), (p))
+#define test_le_bit(nr, p) \
+ test_bit(WORD_BITOFF_TO_LE(nr), (p))
+#define find_first_zero_le_bit(p, sz) \
+ _find_first_zero_bit_le(p, sz)
+#define find_next_zero_le_bit(p, sz, off) \
+ _find_next_zero_bit_le(p, sz, off)
+#define find_next_le_bit(p, sz, off) \
+ _find_next_bit_le(p, sz, off)
/*
* Ext2 is defined to use little-endian byte ordering.
* These do not need to be atomic.
*/
#define ext2_set_bit(nr,p) \
- __test_and_set_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
+ __test_and_set_le_bit(nr, (unsigned long *)(p))
#define ext2_set_bit_atomic(lock,nr,p) \
- test_and_set_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
+ test_and_set_le_bit(nr, (unsigned long *)(p))
#define ext2_clear_bit(nr,p) \
- __test_and_clear_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
+ __test_and_clear_le_bit(nr, (unsigned long *)(p))
#define ext2_clear_bit_atomic(lock,nr,p) \
- test_and_clear_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
+ test_and_clear_le_bit(nr, (unsigned long *)(p))
#define ext2_test_bit(nr,p) \
- test_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
+ test_le_bit(nr, (unsigned long *)(p))
#define ext2_find_first_zero_bit(p,sz) \
- _find_first_zero_bit_le(p,sz)
+ find_first_zero_le_bit((unsigned long *)(p), sz)
#define ext2_find_next_zero_bit(p,sz,off) \
- _find_next_zero_bit_le(p,sz,off)
+ find_next_zero_le_bit((unsigned long *)(p), sz, off)
#define ext2_find_next_bit(p, sz, off) \
- _find_next_bit_le(p, sz, off)
+ find_next_le_bit((unsigned long *)(p), sz, off)
/*
* Minix is defined to use little-endian byte ordering.
* These do not need to be atomic.
*/
#define minix_set_bit(nr,p) \
- __set_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
+ __set_le_bit(nr, (unsigned long *)(p))
#define minix_test_bit(nr,p) \
- test_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
+ test_le_bit(nr, (unsigned long *)(p))
#define minix_test_and_set_bit(nr,p) \
- __test_and_set_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
+ __test_and_set_le_bit(nr, (unsigned long *)(p))
#define minix_test_and_clear_bit(nr,p) \
- __test_and_clear_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
+ __test_and_clear_le_bit(nr, (unsigned long *)(p))
#define minix_find_first_zero_bit(p,sz) \
- _find_first_zero_bit_le(p,sz)
+ find_first_zero_le_bit((unsigned long *)(p), sz)
#endif /* __KERNEL__ */
--
1.7.1.231.gd0b16
^ permalink raw reply related [flat|nested] 75+ messages in thread
* [PATCH 05/22] m68k: introduce le bitops
2010-10-15 9:45 [PATCH 00/22] Introduce little endian bitops Akinobu Mita
` (4 preceding siblings ...)
2010-10-15 9:46 ` [PATCH 04/22] arm: " Akinobu Mita
@ 2010-10-15 9:46 ` Akinobu Mita
2010-10-15 9:46 ` Akinobu Mita
2010-10-15 9:46 ` [PATCH 06/22] m68knommu: introduce little endian bitops Akinobu Mita
` (17 subsequent siblings)
23 siblings, 1 reply; 75+ messages in thread
From: Akinobu Mita @ 2010-10-15 9:46 UTC (permalink / raw)
To: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig,
Andrew Morton
Cc: Akinobu Mita, Geert Uytterhoeven, Roman Zippel, linux-m68k
Introduce little endian bit operations by renaming native ext2 bit
operations. The ext2 bit operations are kept by using little endian
bit operations until the conversions are finished.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: linux-m68k@lists.linux-m68k.org
---
arch/m68k/include/asm/bitops_mm.h | 64 +++++++++++++++++++++++++-----------
1 files changed, 44 insertions(+), 20 deletions(-)
diff --git a/arch/m68k/include/asm/bitops_mm.h b/arch/m68k/include/asm/bitops_mm.h
index f1010ab..8b3059d 100644
--- a/arch/m68k/include/asm/bitops_mm.h
+++ b/arch/m68k/include/asm/bitops_mm.h
@@ -359,24 +359,28 @@ static inline int minix_test_bit(int nr, const void *vaddr)
return (p[nr >> 4] & (1U << (nr & 15))) != 0;
}
-/* Bitmap functions for the ext2 filesystem. */
-
-#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))
-#define ext2_find_next_zero_bit(addr, size, offset) \
- find_next_zero_le_bit((unsigned long *)addr, size, offset)
-#define ext2_find_next_bit(addr, size, offset) \
- find_next_le_bit((unsigned long *)addr, size, offset)
-
-static inline int ext2_test_bit(int nr, const void *vaddr)
+/* Bitmap functions for little endian. */
+
+#define __set_le_bit(nr, addr) \
+ __set_bit((nr) ^ 24, (addr))
+#define __clear_le_bit(nr, addr) \
+ __clear_bit((nr) ^ 24, (addr))
+#define __test_and_set_le_bit(nr, addr) \
+ __test_and_set_bit((nr) ^ 24, (addr))
+#define test_and_set_le_bit(lock, nr, addr) \
+ test_and_set_bit((nr) ^ 24, (addr))
+#define __test_and_clear_le_bit(nr, addr) \
+ __test_and_clear_bit((nr) ^ 24, (addr))
+#define test_and_clear_le_bit(lock, nr, addr) \
+ test_and_clear_bit((nr) ^ 24, (addr))
+
+static inline int test_le_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)
+static inline int find_first_zero_le_bit(const void *vaddr, unsigned size)
{
const unsigned long *p = vaddr, *addr = vaddr;
int res;
@@ -393,7 +397,7 @@ static inline int ext2_find_first_zero_bit(const void *vaddr, unsigned size)
--p;
for (res = 0; res < 32; res++)
- if (!ext2_test_bit (res, p))
+ if (!test_le_bit(res, p))
break;
return (p - addr) * 32 + res;
}
@@ -410,16 +414,16 @@ static inline unsigned long find_next_zero_le_bit(const unsigned long *addr,
if (bit) {
/* Look for zero in first longword */
for (res = bit; res < 32; res++)
- if (!ext2_test_bit (res, p))
+ if (!test_le_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));
+ res = find_first_zero_le_bit(p, size - 32 * (p - addr));
return (p - addr) * 32 + res;
}
-static inline int ext2_find_first_bit(const void *vaddr, unsigned size)
+static inline int find_first_le_bit(const void *vaddr, unsigned size)
{
const unsigned long *p = vaddr, *addr = vaddr;
int res;
@@ -435,7 +439,7 @@ static inline int ext2_find_first_bit(const void *vaddr, unsigned size)
--p;
for (res = 0; res < 32; res++)
- if (ext2_test_bit(res, p))
+ if (test_le_bit(res, p))
break;
return (p - addr) * 32 + res;
}
@@ -452,15 +456,35 @@ static inline unsigned long find_next_le_bit(const unsigned long *addr,
if (bit) {
/* Look for one in first longword */
for (res = bit; res < 32; res++)
- if (ext2_test_bit(res, p))
+ if (test_le_bit(res, p))
return (p - addr) * 32 + res;
p++;
}
/* No set bit yet, search remaining full bytes for a set bit */
- res = ext2_find_first_bit(p, size - 32 * (p - addr));
+ res = find_first_le_bit(p, size - 32 * (p - addr));
return (p - addr) * 32 + res;
}
+/* Bitmap functions for the ext2 filesystem. */
+
+#define ext2_set_bit(nr, addr) \
+ __test_and_set_le_bit(nr, (unsigned long *)(addr))
+#define ext2_set_bit_atomic(lock, nr, addr) \
+ test_and_set_le_bit(nr, (unsigned long *)(addr))
+#define ext2_clear_bit(nr, addr) \
+ __test_and_clear_le_bit(nr, (unsigned long *)(addr))
+#define ext2_clear_bit_atomic(lock, nr, addr) \
+ test_and_clear_le_bit(nr, (unsigned long *)(addr))
+#define ext2_find_next_zero_bit(addr, size, offset) \
+ find_next_zero_le_bit((unsigned long *)(addr), size, offset)
+#define ext2_find_next_bit(addr, size, offset) \
+ find_next_le_bit((unsigned long *)(addr), size, offset)
+#define ext2_test_bit(nr, vaddr) test_le_bit(nr, vaddr)
+#define ext2_find_first_zero_bit(vaddr, size) \
+ find_first_zero_le_bit((unsigned long *)(vaddr), size)
+#define ext2_find_first_bit(vaddr, size) \
+ find_first_le_bit((unsigned long *)(vaddr), size)
+
#endif /* __KERNEL__ */
#endif /* _M68K_BITOPS_H */
--
1.7.1.231.gd0b16
^ permalink raw reply related [flat|nested] 75+ messages in thread
* [PATCH 05/22] m68k: introduce le bitops
2010-10-15 9:46 ` [PATCH 05/22] m68k: introduce le bitops Akinobu Mita
@ 2010-10-15 9:46 ` Akinobu Mita
0 siblings, 0 replies; 75+ messages in thread
From: Akinobu Mita @ 2010-10-15 9:46 UTC (permalink / raw)
To: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig,
Andrew Morton
Cc: Akinobu Mita, Geert Uytterhoeven, Roman Zippel, linux-m68k
Introduce little endian bit operations by renaming native ext2 bit
operations. The ext2 bit operations are kept by using little endian
bit operations until the conversions are finished.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: linux-m68k@lists.linux-m68k.org
---
arch/m68k/include/asm/bitops_mm.h | 64 +++++++++++++++++++++++++-----------
1 files changed, 44 insertions(+), 20 deletions(-)
diff --git a/arch/m68k/include/asm/bitops_mm.h b/arch/m68k/include/asm/bitops_mm.h
index f1010ab..8b3059d 100644
--- a/arch/m68k/include/asm/bitops_mm.h
+++ b/arch/m68k/include/asm/bitops_mm.h
@@ -359,24 +359,28 @@ static inline int minix_test_bit(int nr, const void *vaddr)
return (p[nr >> 4] & (1U << (nr & 15))) != 0;
}
-/* Bitmap functions for the ext2 filesystem. */
-
-#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))
-#define ext2_find_next_zero_bit(addr, size, offset) \
- find_next_zero_le_bit((unsigned long *)addr, size, offset)
-#define ext2_find_next_bit(addr, size, offset) \
- find_next_le_bit((unsigned long *)addr, size, offset)
-
-static inline int ext2_test_bit(int nr, const void *vaddr)
+/* Bitmap functions for little endian. */
+
+#define __set_le_bit(nr, addr) \
+ __set_bit((nr) ^ 24, (addr))
+#define __clear_le_bit(nr, addr) \
+ __clear_bit((nr) ^ 24, (addr))
+#define __test_and_set_le_bit(nr, addr) \
+ __test_and_set_bit((nr) ^ 24, (addr))
+#define test_and_set_le_bit(lock, nr, addr) \
+ test_and_set_bit((nr) ^ 24, (addr))
+#define __test_and_clear_le_bit(nr, addr) \
+ __test_and_clear_bit((nr) ^ 24, (addr))
+#define test_and_clear_le_bit(lock, nr, addr) \
+ test_and_clear_bit((nr) ^ 24, (addr))
+
+static inline int test_le_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)
+static inline int find_first_zero_le_bit(const void *vaddr, unsigned size)
{
const unsigned long *p = vaddr, *addr = vaddr;
int res;
@@ -393,7 +397,7 @@ static inline int ext2_find_first_zero_bit(const void *vaddr, unsigned size)
--p;
for (res = 0; res < 32; res++)
- if (!ext2_test_bit (res, p))
+ if (!test_le_bit(res, p))
break;
return (p - addr) * 32 + res;
}
@@ -410,16 +414,16 @@ static inline unsigned long find_next_zero_le_bit(const unsigned long *addr,
if (bit) {
/* Look for zero in first longword */
for (res = bit; res < 32; res++)
- if (!ext2_test_bit (res, p))
+ if (!test_le_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));
+ res = find_first_zero_le_bit(p, size - 32 * (p - addr));
return (p - addr) * 32 + res;
}
-static inline int ext2_find_first_bit(const void *vaddr, unsigned size)
+static inline int find_first_le_bit(const void *vaddr, unsigned size)
{
const unsigned long *p = vaddr, *addr = vaddr;
int res;
@@ -435,7 +439,7 @@ static inline int ext2_find_first_bit(const void *vaddr, unsigned size)
--p;
for (res = 0; res < 32; res++)
- if (ext2_test_bit(res, p))
+ if (test_le_bit(res, p))
break;
return (p - addr) * 32 + res;
}
@@ -452,15 +456,35 @@ static inline unsigned long find_next_le_bit(const unsigned long *addr,
if (bit) {
/* Look for one in first longword */
for (res = bit; res < 32; res++)
- if (ext2_test_bit(res, p))
+ if (test_le_bit(res, p))
return (p - addr) * 32 + res;
p++;
}
/* No set bit yet, search remaining full bytes for a set bit */
- res = ext2_find_first_bit(p, size - 32 * (p - addr));
+ res = find_first_le_bit(p, size - 32 * (p - addr));
return (p - addr) * 32 + res;
}
+/* Bitmap functions for the ext2 filesystem. */
+
+#define ext2_set_bit(nr, addr) \
+ __test_and_set_le_bit(nr, (unsigned long *)(addr))
+#define ext2_set_bit_atomic(lock, nr, addr) \
+ test_and_set_le_bit(nr, (unsigned long *)(addr))
+#define ext2_clear_bit(nr, addr) \
+ __test_and_clear_le_bit(nr, (unsigned long *)(addr))
+#define ext2_clear_bit_atomic(lock, nr, addr) \
+ test_and_clear_le_bit(nr, (unsigned long *)(addr))
+#define ext2_find_next_zero_bit(addr, size, offset) \
+ find_next_zero_le_bit((unsigned long *)(addr), size, offset)
+#define ext2_find_next_bit(addr, size, offset) \
+ find_next_le_bit((unsigned long *)(addr), size, offset)
+#define ext2_test_bit(nr, vaddr) test_le_bit(nr, vaddr)
+#define ext2_find_first_zero_bit(vaddr, size) \
+ find_first_zero_le_bit((unsigned long *)(vaddr), size)
+#define ext2_find_first_bit(vaddr, size) \
+ find_first_le_bit((unsigned long *)(vaddr), size)
+
#endif /* __KERNEL__ */
#endif /* _M68K_BITOPS_H */
--
1.7.1.231.gd0b16
^ permalink raw reply related [flat|nested] 75+ messages in thread
* [PATCH 06/22] m68knommu: introduce little endian bitops
2010-10-15 9:45 [PATCH 00/22] Introduce little endian bitops Akinobu Mita
` (5 preceding siblings ...)
2010-10-15 9:46 ` [PATCH 05/22] m68k: introduce le bitops Akinobu Mita
@ 2010-10-15 9:46 ` Akinobu Mita
2010-10-15 9:46 ` Akinobu Mita
2010-10-15 9:46 ` [PATCH 07/22] bitops: introduce little endian bitops for most architectures Akinobu Mita
` (16 subsequent siblings)
23 siblings, 1 reply; 75+ messages in thread
From: Akinobu Mita @ 2010-10-15 9:46 UTC (permalink / raw)
To: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig,
Andrew Morton
Cc: Akinobu Mita, Greg Ungerer, Geert Uytterhoeven, Roman Zippel,
linux-m68k
Introduce little endian bit operations by renaming native ext2 bit
operations. The ext2 bit operations are kept by using little endian
bit operations until the conversions are finished.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Greg Ungerer <gerg@uclinux.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: linux-m68k@lists.linux-m68k.org
---
arch/m68k/include/asm/bitops_no.h | 40 +++++++++++++++++++++++++++++-------
1 files changed, 32 insertions(+), 8 deletions(-)
diff --git a/arch/m68k/include/asm/bitops_no.h b/arch/m68k/include/asm/bitops_no.h
index 292e1ce..9f5eb02 100644
--- a/arch/m68k/include/asm/bitops_no.h
+++ b/arch/m68k/include/asm/bitops_no.h
@@ -196,7 +196,15 @@ static __inline__ int __test_bit(int nr, const volatile unsigned long * addr)
#include <asm-generic/bitops/hweight.h>
#include <asm-generic/bitops/lock.h>
-static __inline__ int ext2_set_bit(int nr, volatile void * addr)
+#define BITOP_LE_SWIZZLE ((BITS_PER_LONG-1) & ~0x7)
+
+#define __set_le_bit(nr, addr) \
+ __set_bit((nr) ^ BITOP_LE_SWIZZLE, (addr))
+
+#define __clear_le_bit(nr, addr) \
+ __clear_bit((nr) ^ BITOP_LE_SWIZZLE, (addr))
+
+static inline int __test_and_set_le_bit(int nr, volatile void *addr)
{
char retval;
@@ -215,7 +223,7 @@ static __inline__ int ext2_set_bit(int nr, volatile void * addr)
return retval;
}
-static __inline__ int ext2_clear_bit(int nr, volatile void * addr)
+static inline int __test_and_clear_le_bit(int nr, volatile void *addr)
{
char retval;
@@ -238,7 +246,7 @@ static __inline__ int ext2_clear_bit(int nr, volatile void * addr)
({ \
int ret; \
spin_lock(lock); \
- ret = ext2_set_bit((nr), (addr)); \
+ ret = __test_and_set_le_bit((nr), (addr)); \
spin_unlock(lock); \
ret; \
})
@@ -247,12 +255,12 @@ static __inline__ int ext2_clear_bit(int nr, volatile void * addr)
({ \
int ret; \
spin_lock(lock); \
- ret = ext2_clear_bit((nr), (addr)); \
+ ret = __test_and_clear_le_bit((nr), (addr)); \
spin_unlock(lock); \
ret; \
})
-static __inline__ int ext2_test_bit(int nr, const volatile void * addr)
+static inline int test_le_bit(int nr, const volatile void *addr)
{
char retval;
@@ -271,10 +279,10 @@ static __inline__ int ext2_test_bit(int nr, const volatile void * addr)
return retval;
}
-#define ext2_find_first_zero_bit(addr, size) \
- ext2_find_next_zero_bit((addr), (size), 0)
+#define find_first_zero_le_bit(addr, size) \
+ find_next_zero_le_bit((addr), (size), 0)
-static __inline__ unsigned long ext2_find_next_zero_bit(void *addr, unsigned long size, unsigned long offset)
+static inline unsigned long find_next_zero_le_bit(void *addr, unsigned long size, unsigned long offset)
{
unsigned long *p = ((unsigned long *) addr) + (offset >> 5);
unsigned long result = offset & ~31UL;
@@ -324,8 +332,24 @@ found_middle:
return result + ffz(__swab32(tmp));
}
+#define ext2_set_bit(nr, addr) \
+ __test_and_set_le_bit(nr, addr)
+
+#define ext2_clear_bit(nr, addr) \
+ test_and_clear_le_bit(nr, addr)
+
+#define ext2_test_bit(nr, addr) \
+ test_le_bit(nr, addr)
+
+#define ext2_find_first_zero_bit(addr, size) \
+ find_first_zero_le_bit(addr, size)
+
+#define ext2_find_next_zero_bit(addr, size, offset) \
+ find_next_zero_le_bit(addr, size, offset)
+
#define ext2_find_next_bit(addr, size, off) \
find_next_le_bit((unsigned long *)(addr), (size), (off))
+
#include <asm-generic/bitops/minix.h>
#endif /* __KERNEL__ */
--
1.7.1.231.gd0b16
^ permalink raw reply related [flat|nested] 75+ messages in thread
* [PATCH 06/22] m68knommu: introduce little endian bitops
2010-10-15 9:46 ` [PATCH 06/22] m68knommu: introduce little endian bitops Akinobu Mita
@ 2010-10-15 9:46 ` Akinobu Mita
0 siblings, 0 replies; 75+ messages in thread
From: Akinobu Mita @ 2010-10-15 9:46 UTC (permalink / raw)
To: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig,
Andrew Morton
Cc: Akinobu Mita, Greg Ungerer, Geert Uytterhoeven, Roman Zippel,
linux-m68k
Introduce little endian bit operations by renaming native ext2 bit
operations. The ext2 bit operations are kept by using little endian
bit operations until the conversions are finished.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Greg Ungerer <gerg@uclinux.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: linux-m68k@lists.linux-m68k.org
---
arch/m68k/include/asm/bitops_no.h | 40 +++++++++++++++++++++++++++++-------
1 files changed, 32 insertions(+), 8 deletions(-)
diff --git a/arch/m68k/include/asm/bitops_no.h b/arch/m68k/include/asm/bitops_no.h
index 292e1ce..9f5eb02 100644
--- a/arch/m68k/include/asm/bitops_no.h
+++ b/arch/m68k/include/asm/bitops_no.h
@@ -196,7 +196,15 @@ static __inline__ int __test_bit(int nr, const volatile unsigned long * addr)
#include <asm-generic/bitops/hweight.h>
#include <asm-generic/bitops/lock.h>
-static __inline__ int ext2_set_bit(int nr, volatile void * addr)
+#define BITOP_LE_SWIZZLE ((BITS_PER_LONG-1) & ~0x7)
+
+#define __set_le_bit(nr, addr) \
+ __set_bit((nr) ^ BITOP_LE_SWIZZLE, (addr))
+
+#define __clear_le_bit(nr, addr) \
+ __clear_bit((nr) ^ BITOP_LE_SWIZZLE, (addr))
+
+static inline int __test_and_set_le_bit(int nr, volatile void *addr)
{
char retval;
@@ -215,7 +223,7 @@ static __inline__ int ext2_set_bit(int nr, volatile void * addr)
return retval;
}
-static __inline__ int ext2_clear_bit(int nr, volatile void * addr)
+static inline int __test_and_clear_le_bit(int nr, volatile void *addr)
{
char retval;
@@ -238,7 +246,7 @@ static __inline__ int ext2_clear_bit(int nr, volatile void * addr)
({ \
int ret; \
spin_lock(lock); \
- ret = ext2_set_bit((nr), (addr)); \
+ ret = __test_and_set_le_bit((nr), (addr)); \
spin_unlock(lock); \
ret; \
})
@@ -247,12 +255,12 @@ static __inline__ int ext2_clear_bit(int nr, volatile void * addr)
({ \
int ret; \
spin_lock(lock); \
- ret = ext2_clear_bit((nr), (addr)); \
+ ret = __test_and_clear_le_bit((nr), (addr)); \
spin_unlock(lock); \
ret; \
})
-static __inline__ int ext2_test_bit(int nr, const volatile void * addr)
+static inline int test_le_bit(int nr, const volatile void *addr)
{
char retval;
@@ -271,10 +279,10 @@ static __inline__ int ext2_test_bit(int nr, const volatile void * addr)
return retval;
}
-#define ext2_find_first_zero_bit(addr, size) \
- ext2_find_next_zero_bit((addr), (size), 0)
+#define find_first_zero_le_bit(addr, size) \
+ find_next_zero_le_bit((addr), (size), 0)
-static __inline__ unsigned long ext2_find_next_zero_bit(void *addr, unsigned long size, unsigned long offset)
+static inline unsigned long find_next_zero_le_bit(void *addr, unsigned long size, unsigned long offset)
{
unsigned long *p = ((unsigned long *) addr) + (offset >> 5);
unsigned long result = offset & ~31UL;
@@ -324,8 +332,24 @@ found_middle:
return result + ffz(__swab32(tmp));
}
+#define ext2_set_bit(nr, addr) \
+ __test_and_set_le_bit(nr, addr)
+
+#define ext2_clear_bit(nr, addr) \
+ test_and_clear_le_bit(nr, addr)
+
+#define ext2_test_bit(nr, addr) \
+ test_le_bit(nr, addr)
+
+#define ext2_find_first_zero_bit(addr, size) \
+ find_first_zero_le_bit(addr, size)
+
+#define ext2_find_next_zero_bit(addr, size, offset) \
+ find_next_zero_le_bit(addr, size, offset)
+
#define ext2_find_next_bit(addr, size, off) \
find_next_le_bit((unsigned long *)(addr), (size), (off))
+
#include <asm-generic/bitops/minix.h>
#endif /* __KERNEL__ */
--
1.7.1.231.gd0b16
^ permalink raw reply related [flat|nested] 75+ messages in thread
* [PATCH 07/22] bitops: introduce little endian bitops for most architectures
2010-10-15 9:45 [PATCH 00/22] Introduce little endian bitops Akinobu Mita
` (6 preceding siblings ...)
2010-10-15 9:46 ` [PATCH 06/22] m68knommu: introduce little endian bitops Akinobu Mita
@ 2010-10-15 9:46 ` Akinobu Mita
2010-10-15 9:46 ` Akinobu Mita
2010-10-15 9:46 ` [PATCH 08/22] rds: stop including asm-generic/bitops/le.h Akinobu Mita
` (15 subsequent siblings)
23 siblings, 1 reply; 75+ messages in thread
From: Akinobu Mita @ 2010-10-15 9:46 UTC (permalink / raw)
To: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig,
Andrew Morton
Cc: Akinobu Mita
Introduce little endian bit operations to the architectures which
do not have native little endian bit operations.
These architectures can just include generic implementation
(asm-generic/bitops/le.h).
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
---
arch/alpha/include/asm/bitops.h | 1 +
arch/avr32/include/asm/bitops.h | 1 +
arch/blackfin/include/asm/bitops.h | 1 +
arch/cris/include/asm/bitops.h | 1 +
arch/frv/include/asm/bitops.h | 1 +
arch/h8300/include/asm/bitops.h | 1 +
arch/ia64/include/asm/bitops.h | 1 +
arch/m32r/include/asm/bitops.h | 1 +
arch/mips/include/asm/bitops.h | 1 +
arch/mn10300/include/asm/bitops.h | 1 +
arch/parisc/include/asm/bitops.h | 1 +
arch/sh/include/asm/bitops.h | 1 +
arch/sparc/include/asm/bitops_32.h | 1 +
arch/sparc/include/asm/bitops_64.h | 1 +
arch/tile/include/asm/bitops.h | 1 +
arch/x86/include/asm/bitops.h | 1 +
arch/xtensa/include/asm/bitops.h | 1 +
include/asm-generic/bitops.h | 1 +
include/asm-generic/bitops/ext2-non-atomic.h | 2 --
include/asm-generic/bitops/minix-le.h | 2 --
20 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/arch/alpha/include/asm/bitops.h b/arch/alpha/include/asm/bitops.h
index adfab8a..955fec7 100644
--- a/arch/alpha/include/asm/bitops.h
+++ b/arch/alpha/include/asm/bitops.h
@@ -454,6 +454,7 @@ sched_find_first_bit(const unsigned long b[2])
return __ffs(tmp) + ofs;
}
+#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-non-atomic.h>
#define ext2_set_bit_atomic(l,n,a) test_and_set_bit(n,a)
diff --git a/arch/avr32/include/asm/bitops.h b/arch/avr32/include/asm/bitops.h
index f7dd5f7..1c482fc 100644
--- a/arch/avr32/include/asm/bitops.h
+++ b/arch/avr32/include/asm/bitops.h
@@ -299,6 +299,7 @@ static inline int ffs(unsigned long word)
#include <asm-generic/bitops/hweight.h>
#include <asm-generic/bitops/lock.h>
+#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-non-atomic.h>
#include <asm-generic/bitops/ext2-atomic.h>
#include <asm-generic/bitops/minix-le.h>
diff --git a/arch/blackfin/include/asm/bitops.h b/arch/blackfin/include/asm/bitops.h
index 3f7ef4d..1261078 100644
--- a/arch/blackfin/include/asm/bitops.h
+++ b/arch/blackfin/include/asm/bitops.h
@@ -25,6 +25,7 @@
#include <asm-generic/bitops/const_hweight.h>
#include <asm-generic/bitops/lock.h>
+#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-non-atomic.h>
#include <asm-generic/bitops/ext2-atomic.h>
#include <asm-generic/bitops/minix.h>
diff --git a/arch/cris/include/asm/bitops.h b/arch/cris/include/asm/bitops.h
index 9e69cfb..599ae67 100644
--- a/arch/cris/include/asm/bitops.h
+++ b/arch/cris/include/asm/bitops.h
@@ -154,6 +154,7 @@ static inline int test_and_change_bit(int nr, volatile unsigned long *addr)
#include <asm-generic/bitops/find.h>
#include <asm-generic/bitops/lock.h>
+#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-non-atomic.h>
#define ext2_set_bit_atomic(l,n,a) test_and_set_bit(n,a)
diff --git a/arch/frv/include/asm/bitops.h b/arch/frv/include/asm/bitops.h
index 50ae91b..2631917 100644
--- a/arch/frv/include/asm/bitops.h
+++ b/arch/frv/include/asm/bitops.h
@@ -401,6 +401,7 @@ int __ilog2_u64(u64 n)
#include <asm-generic/bitops/hweight.h>
#include <asm-generic/bitops/lock.h>
+#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-non-atomic.h>
#define ext2_set_bit_atomic(lock,nr,addr) test_and_set_bit ((nr) ^ 0x18, (addr))
diff --git a/arch/h8300/include/asm/bitops.h b/arch/h8300/include/asm/bitops.h
index cb9ddf5..763094f 100644
--- a/arch/h8300/include/asm/bitops.h
+++ b/arch/h8300/include/asm/bitops.h
@@ -200,6 +200,7 @@ static __inline__ unsigned long __ffs(unsigned long word)
#include <asm-generic/bitops/sched.h>
#include <asm-generic/bitops/hweight.h>
#include <asm-generic/bitops/lock.h>
+#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-non-atomic.h>
#include <asm-generic/bitops/ext2-atomic.h>
#include <asm-generic/bitops/minix.h>
diff --git a/arch/ia64/include/asm/bitops.h b/arch/ia64/include/asm/bitops.h
index 9da3df6..2cde4f0 100644
--- a/arch/ia64/include/asm/bitops.h
+++ b/arch/ia64/include/asm/bitops.h
@@ -456,6 +456,7 @@ static __inline__ unsigned long __arch_hweight64(unsigned long x)
#ifdef __KERNEL__
+#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-non-atomic.h>
#define ext2_set_bit_atomic(l,n,a) test_and_set_bit(n,a)
diff --git a/arch/m32r/include/asm/bitops.h b/arch/m32r/include/asm/bitops.h
index aaddf0d..681f7e8 100644
--- a/arch/m32r/include/asm/bitops.h
+++ b/arch/m32r/include/asm/bitops.h
@@ -266,6 +266,7 @@ static __inline__ int test_and_change_bit(int nr, volatile void * addr)
#ifdef __KERNEL__
+#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-non-atomic.h>
#include <asm-generic/bitops/ext2-atomic.h>
#include <asm-generic/bitops/minix.h>
diff --git a/arch/mips/include/asm/bitops.h b/arch/mips/include/asm/bitops.h
index b0ce7ca..4795820 100644
--- a/arch/mips/include/asm/bitops.h
+++ b/arch/mips/include/asm/bitops.h
@@ -704,6 +704,7 @@ static inline int ffs(int word)
#include <asm/arch_hweight.h>
#include <asm-generic/bitops/const_hweight.h>
+#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-non-atomic.h>
#include <asm-generic/bitops/ext2-atomic.h>
#include <asm-generic/bitops/minix.h>
diff --git a/arch/mn10300/include/asm/bitops.h b/arch/mn10300/include/asm/bitops.h
index 3f50e96..4688c08 100644
--- a/arch/mn10300/include/asm/bitops.h
+++ b/arch/mn10300/include/asm/bitops.h
@@ -233,6 +233,7 @@ int ffs(int x)
#define ext2_clear_bit_atomic(lock, nr, addr) \
test_and_clear_bit((nr), (addr))
+#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-non-atomic.h>
#include <asm-generic/bitops/minix-le.h>
diff --git a/arch/parisc/include/asm/bitops.h b/arch/parisc/include/asm/bitops.h
index 7a6ea10..4b9e58d 100644
--- a/arch/parisc/include/asm/bitops.h
+++ b/arch/parisc/include/asm/bitops.h
@@ -222,6 +222,7 @@ static __inline__ int fls(int x)
#ifdef __KERNEL__
+#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-non-atomic.h>
/* '3' is bits per byte */
diff --git a/arch/sh/include/asm/bitops.h b/arch/sh/include/asm/bitops.h
index 98511e4..9167810 100644
--- a/arch/sh/include/asm/bitops.h
+++ b/arch/sh/include/asm/bitops.h
@@ -94,6 +94,7 @@ static inline unsigned long ffz(unsigned long word)
#include <asm-generic/bitops/hweight.h>
#include <asm-generic/bitops/lock.h>
#include <asm-generic/bitops/sched.h>
+#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-non-atomic.h>
#include <asm-generic/bitops/ext2-atomic.h>
#include <asm-generic/bitops/minix.h>
diff --git a/arch/sparc/include/asm/bitops_32.h b/arch/sparc/include/asm/bitops_32.h
index 9cf4ae0..5b3ab06 100644
--- a/arch/sparc/include/asm/bitops_32.h
+++ b/arch/sparc/include/asm/bitops_32.h
@@ -103,6 +103,7 @@ static inline void change_bit(unsigned long nr, volatile unsigned long *addr)
#include <asm-generic/bitops/hweight.h>
#include <asm-generic/bitops/lock.h>
#include <asm-generic/bitops/find.h>
+#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-non-atomic.h>
#include <asm-generic/bitops/ext2-atomic.h>
#include <asm-generic/bitops/minix.h>
diff --git a/arch/sparc/include/asm/bitops_64.h b/arch/sparc/include/asm/bitops_64.h
index 766121a..9097862 100644
--- a/arch/sparc/include/asm/bitops_64.h
+++ b/arch/sparc/include/asm/bitops_64.h
@@ -89,6 +89,7 @@ static inline unsigned int __arch_hweight8(unsigned int w)
#ifdef __KERNEL__
+#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-non-atomic.h>
#define ext2_set_bit_atomic(lock,nr,addr) \
diff --git a/arch/tile/include/asm/bitops.h b/arch/tile/include/asm/bitops.h
index 6d4f0ff..56b0355 100644
--- a/arch/tile/include/asm/bitops.h
+++ b/arch/tile/include/asm/bitops.h
@@ -122,6 +122,7 @@ static inline unsigned long __arch_hweight64(__u64 w)
#include <asm-generic/bitops/lock.h>
#include <asm-generic/bitops/find.h>
#include <asm-generic/bitops/sched.h>
+#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-non-atomic.h>
#include <asm-generic/bitops/minix.h>
diff --git a/arch/x86/include/asm/bitops.h b/arch/x86/include/asm/bitops.h
index 903683b..c68bc10 100644
--- a/arch/x86/include/asm/bitops.h
+++ b/arch/x86/include/asm/bitops.h
@@ -456,6 +456,7 @@ static inline int fls(int x)
#ifdef __KERNEL__
+#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-non-atomic.h>
#define ext2_set_bit_atomic(lock, nr, addr) \
diff --git a/arch/xtensa/include/asm/bitops.h b/arch/xtensa/include/asm/bitops.h
index 6c39303..0475c11 100644
--- a/arch/xtensa/include/asm/bitops.h
+++ b/arch/xtensa/include/asm/bitops.h
@@ -106,6 +106,7 @@ static inline unsigned long __fls(unsigned long word)
#include <asm-generic/bitops/fls64.h>
#include <asm-generic/bitops/find.h>
+#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-non-atomic.h>
#ifdef __XTENSA_EL__
diff --git a/include/asm-generic/bitops.h b/include/asm-generic/bitops.h
index a54f442..933710b 100644
--- a/include/asm-generic/bitops.h
+++ b/include/asm-generic/bitops.h
@@ -38,6 +38,7 @@
#include <asm-generic/bitops/atomic.h>
#include <asm-generic/bitops/non-atomic.h>
+#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-non-atomic.h>
#include <asm-generic/bitops/ext2-atomic.h>
#include <asm-generic/bitops/minix.h>
diff --git a/include/asm-generic/bitops/ext2-non-atomic.h b/include/asm-generic/bitops/ext2-non-atomic.h
index 9c7bb9a..c4639dd 100644
--- a/include/asm-generic/bitops/ext2-non-atomic.h
+++ b/include/asm-generic/bitops/ext2-non-atomic.h
@@ -1,8 +1,6 @@
#ifndef _ASM_GENERIC_BITOPS_EXT2_NON_ATOMIC_H_
#define _ASM_GENERIC_BITOPS_EXT2_NON_ATOMIC_H_
-#include <asm-generic/bitops/le.h>
-
#define ext2_set_bit(nr,addr) \
__test_and_set_le_bit((nr), (unsigned long *)(addr))
#define ext2_clear_bit(nr,addr) \
diff --git a/include/asm-generic/bitops/minix-le.h b/include/asm-generic/bitops/minix-le.h
index ed0ae09..f366cfa 100644
--- a/include/asm-generic/bitops/minix-le.h
+++ b/include/asm-generic/bitops/minix-le.h
@@ -1,8 +1,6 @@
#ifndef _ASM_GENERIC_BITOPS_MINIX_LE_H_
#define _ASM_GENERIC_BITOPS_MINIX_LE_H_
-#include <asm-generic/bitops/le.h>
-
#define minix_test_and_set_bit(nr,addr) \
__test_and_set_le_bit((nr), (unsigned long *)(addr))
#define minix_set_bit(nr,addr) \
--
1.7.1.231.gd0b16
^ permalink raw reply related [flat|nested] 75+ messages in thread
* [PATCH 07/22] bitops: introduce little endian bitops for most architectures
2010-10-15 9:46 ` [PATCH 07/22] bitops: introduce little endian bitops for most architectures Akinobu Mita
@ 2010-10-15 9:46 ` Akinobu Mita
0 siblings, 0 replies; 75+ messages in thread
From: Akinobu Mita @ 2010-10-15 9:46 UTC (permalink / raw)
To: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig,
Andrew Morton
Cc: Akinobu Mita
Introduce little endian bit operations to the architectures which
do not have native little endian bit operations.
These architectures can just include generic implementation
(asm-generic/bitops/le.h).
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
---
arch/alpha/include/asm/bitops.h | 1 +
arch/avr32/include/asm/bitops.h | 1 +
arch/blackfin/include/asm/bitops.h | 1 +
arch/cris/include/asm/bitops.h | 1 +
arch/frv/include/asm/bitops.h | 1 +
arch/h8300/include/asm/bitops.h | 1 +
arch/ia64/include/asm/bitops.h | 1 +
arch/m32r/include/asm/bitops.h | 1 +
arch/mips/include/asm/bitops.h | 1 +
arch/mn10300/include/asm/bitops.h | 1 +
arch/parisc/include/asm/bitops.h | 1 +
arch/sh/include/asm/bitops.h | 1 +
arch/sparc/include/asm/bitops_32.h | 1 +
arch/sparc/include/asm/bitops_64.h | 1 +
arch/tile/include/asm/bitops.h | 1 +
arch/x86/include/asm/bitops.h | 1 +
arch/xtensa/include/asm/bitops.h | 1 +
include/asm-generic/bitops.h | 1 +
include/asm-generic/bitops/ext2-non-atomic.h | 2 --
include/asm-generic/bitops/minix-le.h | 2 --
20 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/arch/alpha/include/asm/bitops.h b/arch/alpha/include/asm/bitops.h
index adfab8a..955fec7 100644
--- a/arch/alpha/include/asm/bitops.h
+++ b/arch/alpha/include/asm/bitops.h
@@ -454,6 +454,7 @@ sched_find_first_bit(const unsigned long b[2])
return __ffs(tmp) + ofs;
}
+#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-non-atomic.h>
#define ext2_set_bit_atomic(l,n,a) test_and_set_bit(n,a)
diff --git a/arch/avr32/include/asm/bitops.h b/arch/avr32/include/asm/bitops.h
index f7dd5f7..1c482fc 100644
--- a/arch/avr32/include/asm/bitops.h
+++ b/arch/avr32/include/asm/bitops.h
@@ -299,6 +299,7 @@ static inline int ffs(unsigned long word)
#include <asm-generic/bitops/hweight.h>
#include <asm-generic/bitops/lock.h>
+#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-non-atomic.h>
#include <asm-generic/bitops/ext2-atomic.h>
#include <asm-generic/bitops/minix-le.h>
diff --git a/arch/blackfin/include/asm/bitops.h b/arch/blackfin/include/asm/bitops.h
index 3f7ef4d..1261078 100644
--- a/arch/blackfin/include/asm/bitops.h
+++ b/arch/blackfin/include/asm/bitops.h
@@ -25,6 +25,7 @@
#include <asm-generic/bitops/const_hweight.h>
#include <asm-generic/bitops/lock.h>
+#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-non-atomic.h>
#include <asm-generic/bitops/ext2-atomic.h>
#include <asm-generic/bitops/minix.h>
diff --git a/arch/cris/include/asm/bitops.h b/arch/cris/include/asm/bitops.h
index 9e69cfb..599ae67 100644
--- a/arch/cris/include/asm/bitops.h
+++ b/arch/cris/include/asm/bitops.h
@@ -154,6 +154,7 @@ static inline int test_and_change_bit(int nr, volatile unsigned long *addr)
#include <asm-generic/bitops/find.h>
#include <asm-generic/bitops/lock.h>
+#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-non-atomic.h>
#define ext2_set_bit_atomic(l,n,a) test_and_set_bit(n,a)
diff --git a/arch/frv/include/asm/bitops.h b/arch/frv/include/asm/bitops.h
index 50ae91b..2631917 100644
--- a/arch/frv/include/asm/bitops.h
+++ b/arch/frv/include/asm/bitops.h
@@ -401,6 +401,7 @@ int __ilog2_u64(u64 n)
#include <asm-generic/bitops/hweight.h>
#include <asm-generic/bitops/lock.h>
+#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-non-atomic.h>
#define ext2_set_bit_atomic(lock,nr,addr) test_and_set_bit ((nr) ^ 0x18, (addr))
diff --git a/arch/h8300/include/asm/bitops.h b/arch/h8300/include/asm/bitops.h
index cb9ddf5..763094f 100644
--- a/arch/h8300/include/asm/bitops.h
+++ b/arch/h8300/include/asm/bitops.h
@@ -200,6 +200,7 @@ static __inline__ unsigned long __ffs(unsigned long word)
#include <asm-generic/bitops/sched.h>
#include <asm-generic/bitops/hweight.h>
#include <asm-generic/bitops/lock.h>
+#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-non-atomic.h>
#include <asm-generic/bitops/ext2-atomic.h>
#include <asm-generic/bitops/minix.h>
diff --git a/arch/ia64/include/asm/bitops.h b/arch/ia64/include/asm/bitops.h
index 9da3df6..2cde4f0 100644
--- a/arch/ia64/include/asm/bitops.h
+++ b/arch/ia64/include/asm/bitops.h
@@ -456,6 +456,7 @@ static __inline__ unsigned long __arch_hweight64(unsigned long x)
#ifdef __KERNEL__
+#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-non-atomic.h>
#define ext2_set_bit_atomic(l,n,a) test_and_set_bit(n,a)
diff --git a/arch/m32r/include/asm/bitops.h b/arch/m32r/include/asm/bitops.h
index aaddf0d..681f7e8 100644
--- a/arch/m32r/include/asm/bitops.h
+++ b/arch/m32r/include/asm/bitops.h
@@ -266,6 +266,7 @@ static __inline__ int test_and_change_bit(int nr, volatile void * addr)
#ifdef __KERNEL__
+#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-non-atomic.h>
#include <asm-generic/bitops/ext2-atomic.h>
#include <asm-generic/bitops/minix.h>
diff --git a/arch/mips/include/asm/bitops.h b/arch/mips/include/asm/bitops.h
index b0ce7ca..4795820 100644
--- a/arch/mips/include/asm/bitops.h
+++ b/arch/mips/include/asm/bitops.h
@@ -704,6 +704,7 @@ static inline int ffs(int word)
#include <asm/arch_hweight.h>
#include <asm-generic/bitops/const_hweight.h>
+#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-non-atomic.h>
#include <asm-generic/bitops/ext2-atomic.h>
#include <asm-generic/bitops/minix.h>
diff --git a/arch/mn10300/include/asm/bitops.h b/arch/mn10300/include/asm/bitops.h
index 3f50e96..4688c08 100644
--- a/arch/mn10300/include/asm/bitops.h
+++ b/arch/mn10300/include/asm/bitops.h
@@ -233,6 +233,7 @@ int ffs(int x)
#define ext2_clear_bit_atomic(lock, nr, addr) \
test_and_clear_bit((nr), (addr))
+#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-non-atomic.h>
#include <asm-generic/bitops/minix-le.h>
diff --git a/arch/parisc/include/asm/bitops.h b/arch/parisc/include/asm/bitops.h
index 7a6ea10..4b9e58d 100644
--- a/arch/parisc/include/asm/bitops.h
+++ b/arch/parisc/include/asm/bitops.h
@@ -222,6 +222,7 @@ static __inline__ int fls(int x)
#ifdef __KERNEL__
+#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-non-atomic.h>
/* '3' is bits per byte */
diff --git a/arch/sh/include/asm/bitops.h b/arch/sh/include/asm/bitops.h
index 98511e4..9167810 100644
--- a/arch/sh/include/asm/bitops.h
+++ b/arch/sh/include/asm/bitops.h
@@ -94,6 +94,7 @@ static inline unsigned long ffz(unsigned long word)
#include <asm-generic/bitops/hweight.h>
#include <asm-generic/bitops/lock.h>
#include <asm-generic/bitops/sched.h>
+#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-non-atomic.h>
#include <asm-generic/bitops/ext2-atomic.h>
#include <asm-generic/bitops/minix.h>
diff --git a/arch/sparc/include/asm/bitops_32.h b/arch/sparc/include/asm/bitops_32.h
index 9cf4ae0..5b3ab06 100644
--- a/arch/sparc/include/asm/bitops_32.h
+++ b/arch/sparc/include/asm/bitops_32.h
@@ -103,6 +103,7 @@ static inline void change_bit(unsigned long nr, volatile unsigned long *addr)
#include <asm-generic/bitops/hweight.h>
#include <asm-generic/bitops/lock.h>
#include <asm-generic/bitops/find.h>
+#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-non-atomic.h>
#include <asm-generic/bitops/ext2-atomic.h>
#include <asm-generic/bitops/minix.h>
diff --git a/arch/sparc/include/asm/bitops_64.h b/arch/sparc/include/asm/bitops_64.h
index 766121a..9097862 100644
--- a/arch/sparc/include/asm/bitops_64.h
+++ b/arch/sparc/include/asm/bitops_64.h
@@ -89,6 +89,7 @@ static inline unsigned int __arch_hweight8(unsigned int w)
#ifdef __KERNEL__
+#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-non-atomic.h>
#define ext2_set_bit_atomic(lock,nr,addr) \
diff --git a/arch/tile/include/asm/bitops.h b/arch/tile/include/asm/bitops.h
index 6d4f0ff..56b0355 100644
--- a/arch/tile/include/asm/bitops.h
+++ b/arch/tile/include/asm/bitops.h
@@ -122,6 +122,7 @@ static inline unsigned long __arch_hweight64(__u64 w)
#include <asm-generic/bitops/lock.h>
#include <asm-generic/bitops/find.h>
#include <asm-generic/bitops/sched.h>
+#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-non-atomic.h>
#include <asm-generic/bitops/minix.h>
diff --git a/arch/x86/include/asm/bitops.h b/arch/x86/include/asm/bitops.h
index 903683b..c68bc10 100644
--- a/arch/x86/include/asm/bitops.h
+++ b/arch/x86/include/asm/bitops.h
@@ -456,6 +456,7 @@ static inline int fls(int x)
#ifdef __KERNEL__
+#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-non-atomic.h>
#define ext2_set_bit_atomic(lock, nr, addr) \
diff --git a/arch/xtensa/include/asm/bitops.h b/arch/xtensa/include/asm/bitops.h
index 6c39303..0475c11 100644
--- a/arch/xtensa/include/asm/bitops.h
+++ b/arch/xtensa/include/asm/bitops.h
@@ -106,6 +106,7 @@ static inline unsigned long __fls(unsigned long word)
#include <asm-generic/bitops/fls64.h>
#include <asm-generic/bitops/find.h>
+#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-non-atomic.h>
#ifdef __XTENSA_EL__
diff --git a/include/asm-generic/bitops.h b/include/asm-generic/bitops.h
index a54f442..933710b 100644
--- a/include/asm-generic/bitops.h
+++ b/include/asm-generic/bitops.h
@@ -38,6 +38,7 @@
#include <asm-generic/bitops/atomic.h>
#include <asm-generic/bitops/non-atomic.h>
+#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-non-atomic.h>
#include <asm-generic/bitops/ext2-atomic.h>
#include <asm-generic/bitops/minix.h>
diff --git a/include/asm-generic/bitops/ext2-non-atomic.h b/include/asm-generic/bitops/ext2-non-atomic.h
index 9c7bb9a..c4639dd 100644
--- a/include/asm-generic/bitops/ext2-non-atomic.h
+++ b/include/asm-generic/bitops/ext2-non-atomic.h
@@ -1,8 +1,6 @@
#ifndef _ASM_GENERIC_BITOPS_EXT2_NON_ATOMIC_H_
#define _ASM_GENERIC_BITOPS_EXT2_NON_ATOMIC_H_
-#include <asm-generic/bitops/le.h>
-
#define ext2_set_bit(nr,addr) \
__test_and_set_le_bit((nr), (unsigned long *)(addr))
#define ext2_clear_bit(nr,addr) \
diff --git a/include/asm-generic/bitops/minix-le.h b/include/asm-generic/bitops/minix-le.h
index ed0ae09..f366cfa 100644
--- a/include/asm-generic/bitops/minix-le.h
+++ b/include/asm-generic/bitops/minix-le.h
@@ -1,8 +1,6 @@
#ifndef _ASM_GENERIC_BITOPS_MINIX_LE_H_
#define _ASM_GENERIC_BITOPS_MINIX_LE_H_
-#include <asm-generic/bitops/le.h>
-
#define minix_test_and_set_bit(nr,addr) \
__test_and_set_le_bit((nr), (unsigned long *)(addr))
#define minix_set_bit(nr,addr) \
--
1.7.1.231.gd0b16
^ permalink raw reply related [flat|nested] 75+ messages in thread
* [PATCH 08/22] rds: stop including asm-generic/bitops/le.h
2010-10-15 9:45 [PATCH 00/22] Introduce little endian bitops Akinobu Mita
` (7 preceding siblings ...)
2010-10-15 9:46 ` [PATCH 07/22] bitops: introduce little endian bitops for most architectures Akinobu Mita
@ 2010-10-15 9:46 ` Akinobu Mita
2010-10-15 9:46 ` [PATCH 09/22] kvm: " Akinobu Mita
` (14 subsequent siblings)
23 siblings, 0 replies; 75+ messages in thread
From: Akinobu Mita @ 2010-10-15 9:46 UTC (permalink / raw)
To: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig,
Andrew Morton
Cc: Akinobu Mita, Andy Grover, rds-devel, David S. Miller, netdev
No need to include asm-generic/bitops/le.h as all architectures
provide little endian bit operations now.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Andy Grover <andy.grover@oracle.com>
Cc: rds-devel@oss.oracle.com
Cc: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
---
net/rds/cong.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/net/rds/cong.c b/net/rds/cong.c
index c6784d5..15a65f0 100644
--- a/net/rds/cong.c
+++ b/net/rds/cong.c
@@ -34,8 +34,6 @@
#include <linux/types.h>
#include <linux/rbtree.h>
-#include <asm-generic/bitops/le.h>
-
#include "rds.h"
/*
--
1.7.1.231.gd0b16
^ permalink raw reply related [flat|nested] 75+ messages in thread
* [PATCH 09/22] kvm: stop including asm-generic/bitops/le.h
2010-10-15 9:45 [PATCH 00/22] Introduce little endian bitops Akinobu Mita
` (8 preceding siblings ...)
2010-10-15 9:46 ` [PATCH 08/22] rds: stop including asm-generic/bitops/le.h Akinobu Mita
@ 2010-10-15 9:46 ` Akinobu Mita
2010-10-15 9:46 ` [PATCH 10/22] asm-generic: use little endian bitops Akinobu Mita
` (13 subsequent siblings)
23 siblings, 0 replies; 75+ messages in thread
From: Akinobu Mita @ 2010-10-15 9:46 UTC (permalink / raw)
To: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig,
Andrew Morton
Cc: Akinobu Mita, Avi Kivity, Marcelo Tosatti, kvm
No need to include asm-generic/bitops/le.h as all architectures
provide little endian bit operations now.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Avi Kivity <avi@redhat.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: kvm@vger.kernel.org
---
virt/kvm/kvm_main.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 2d9927c..e5d190f 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -52,7 +52,6 @@
#include <asm/io.h>
#include <asm/uaccess.h>
#include <asm/pgtable.h>
-#include <asm-generic/bitops/le.h>
#include "coalesced_mmio.h"
--
1.7.1.231.gd0b16
^ permalink raw reply related [flat|nested] 75+ messages in thread
* [PATCH 10/22] asm-generic: use little endian bitops
2010-10-15 9:45 [PATCH 00/22] Introduce little endian bitops Akinobu Mita
` (9 preceding siblings ...)
2010-10-15 9:46 ` [PATCH 09/22] kvm: " Akinobu Mita
@ 2010-10-15 9:46 ` Akinobu Mita
2010-10-15 11:06 ` Arnd Bergmann
2010-10-15 9:46 ` [PATCH 11/22] ext3: " Akinobu Mita
` (12 subsequent siblings)
23 siblings, 1 reply; 75+ messages in thread
From: Akinobu Mita @ 2010-10-15 9:46 UTC (permalink / raw)
To: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig,
Andrew Morton
Cc: Akinobu Mita
As a preparation for removing ext2 non-atomic bit operations from
asm/bitops.h. This converts ext2 non-atomic bit operations to
little endian bit operations.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
---
include/asm-generic/bitops/ext2-atomic.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/asm-generic/bitops/ext2-atomic.h b/include/asm-generic/bitops/ext2-atomic.h
index ab1c875..bcf359f 100644
--- a/include/asm-generic/bitops/ext2-atomic.h
+++ b/include/asm-generic/bitops/ext2-atomic.h
@@ -5,7 +5,7 @@
({ \
int ret; \
spin_lock(lock); \
- ret = ext2_set_bit((nr), (unsigned long *)(addr)); \
+ ret = __test_and_set_le_bit((nr), (unsigned long *)(addr)); \
spin_unlock(lock); \
ret; \
})
@@ -14,7 +14,7 @@
({ \
int ret; \
spin_lock(lock); \
- ret = ext2_clear_bit((nr), (unsigned long *)(addr)); \
+ ret = __test_and_clear_le_bit((nr), (unsigned long *)(addr)); \
spin_unlock(lock); \
ret; \
})
--
1.7.1.231.gd0b16
^ permalink raw reply related [flat|nested] 75+ messages in thread
* [PATCH 11/22] ext3: use little endian bitops
2010-10-15 9:45 [PATCH 00/22] Introduce little endian bitops Akinobu Mita
` (10 preceding siblings ...)
2010-10-15 9:46 ` [PATCH 10/22] asm-generic: use little endian bitops Akinobu Mita
@ 2010-10-15 9:46 ` Akinobu Mita
2010-10-15 9:46 ` Akinobu Mita
2010-10-18 10:31 ` Jan Kara
2010-10-15 9:46 ` [PATCH 12/22] ext4: " Akinobu Mita
` (11 subsequent siblings)
23 siblings, 2 replies; 75+ messages in thread
From: Akinobu Mita @ 2010-10-15 9:46 UTC (permalink / raw)
To: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig
Cc: Akinobu Mita, Jan Kara, Andrew Morton, Andreas Dilger, linux-ext4
As a preparation for removing ext2 non-atomic bit operations from
asm/bitops.h. This converts ext2 non-atomic bit operations to
little endian bit operations.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Jan Kara <jack@suse.cz>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andreas Dilger <adilger.kernel@dilger.ca>
Cc: linux-ext4@vger.kernel.org
---
include/linux/ext3_fs.h | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h
index 6ce1bca..34ef455 100644
--- a/include/linux/ext3_fs.h
+++ b/include/linux/ext3_fs.h
@@ -418,13 +418,18 @@ struct ext3_inode {
#define EXT2_MOUNT_DATA_FLAGS EXT3_MOUNT_DATA_FLAGS
#endif
-#define ext3_set_bit ext2_set_bit
+#define ext3_set_bit(nr, addr) \
+ __test_and_set_le_bit((nr), (unsigned long *)(addr))
#define ext3_set_bit_atomic ext2_set_bit_atomic
-#define ext3_clear_bit ext2_clear_bit
+#define ext3_clear_bit(nr, addr) \
+ __test_and_clear_le_bit((nr), (unsigned long *)(addr))
#define ext3_clear_bit_atomic ext2_clear_bit_atomic
-#define ext3_test_bit ext2_test_bit
-#define ext3_find_first_zero_bit ext2_find_first_zero_bit
-#define ext3_find_next_zero_bit ext2_find_next_zero_bit
+#define ext3_test_bit(nr, addr) \
+ test_le_bit((nr), (unsigned long *)(addr))
+#define ext3_find_first_zero_bit(addr, size) \
+ find_first_zero_le_bit((unsigned long *)(addr), (size))
+#define ext3_find_next_zero_bit(addr, size, off) \
+ find_next_zero_le_bit((unsigned long *)(addr), (size), (off))
/*
* Maximal mount counts between two filesystem checks
--
1.7.1.231.gd0b16
^ permalink raw reply related [flat|nested] 75+ messages in thread
* [PATCH 11/22] ext3: use little endian bitops
2010-10-15 9:46 ` [PATCH 11/22] ext3: " Akinobu Mita
@ 2010-10-15 9:46 ` Akinobu Mita
2010-10-18 10:31 ` Jan Kara
1 sibling, 0 replies; 75+ messages in thread
From: Akinobu Mita @ 2010-10-15 9:46 UTC (permalink / raw)
To: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig,
Andrew Morton
Cc: Akinobu Mita, Jan Kara, Andreas Dilger, linux-ext4
As a preparation for removing ext2 non-atomic bit operations from
asm/bitops.h. This converts ext2 non-atomic bit operations to
little endian bit operations.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Jan Kara <jack@suse.cz>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andreas Dilger <adilger.kernel@dilger.ca>
Cc: linux-ext4@vger.kernel.org
---
include/linux/ext3_fs.h | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h
index 6ce1bca..34ef455 100644
--- a/include/linux/ext3_fs.h
+++ b/include/linux/ext3_fs.h
@@ -418,13 +418,18 @@ struct ext3_inode {
#define EXT2_MOUNT_DATA_FLAGS EXT3_MOUNT_DATA_FLAGS
#endif
-#define ext3_set_bit ext2_set_bit
+#define ext3_set_bit(nr, addr) \
+ __test_and_set_le_bit((nr), (unsigned long *)(addr))
#define ext3_set_bit_atomic ext2_set_bit_atomic
-#define ext3_clear_bit ext2_clear_bit
+#define ext3_clear_bit(nr, addr) \
+ __test_and_clear_le_bit((nr), (unsigned long *)(addr))
#define ext3_clear_bit_atomic ext2_clear_bit_atomic
-#define ext3_test_bit ext2_test_bit
-#define ext3_find_first_zero_bit ext2_find_first_zero_bit
-#define ext3_find_next_zero_bit ext2_find_next_zero_bit
+#define ext3_test_bit(nr, addr) \
+ test_le_bit((nr), (unsigned long *)(addr))
+#define ext3_find_first_zero_bit(addr, size) \
+ find_first_zero_le_bit((unsigned long *)(addr), (size))
+#define ext3_find_next_zero_bit(addr, size, off) \
+ find_next_zero_le_bit((unsigned long *)(addr), (size), (off))
/*
* Maximal mount counts between two filesystem checks
--
1.7.1.231.gd0b16
^ permalink raw reply related [flat|nested] 75+ messages in thread
* [PATCH 12/22] ext4: use little endian bitops
2010-10-15 9:45 [PATCH 00/22] Introduce little endian bitops Akinobu Mita
` (11 preceding siblings ...)
2010-10-15 9:46 ` [PATCH 11/22] ext3: " Akinobu Mita
@ 2010-10-15 9:46 ` Akinobu Mita
2010-10-15 9:46 ` Akinobu Mita
2010-10-15 9:46 ` [PATCH 13/22] ocfs2: " Akinobu Mita
` (10 subsequent siblings)
23 siblings, 1 reply; 75+ messages in thread
From: Akinobu Mita @ 2010-10-15 9:46 UTC (permalink / raw)
To: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig,
Andrew Morton
Cc: Akinobu Mita, Theodore Ts'o, Andreas Dilger, linux-ext4
As a preparation for removing ext2 non-atomic bit operations from
asm/bitops.h. This converts ext2 non-atomic bit operations to
little endian bit operations.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Andreas Dilger <adilger.kernel@dilger.ca>
Cc: linux-ext4@vger.kernel.org
---
fs/ext4/ext4.h | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 889ec9d..821c11a 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -895,14 +895,20 @@ struct ext4_inode_info {
#define test_opt(sb, opt) (EXT4_SB(sb)->s_mount_opt & \
EXT4_MOUNT_##opt)
-#define ext4_set_bit ext2_set_bit
+#define ext4_set_bit(nr, addr) \
+ __test_and_set_le_bit((nr), (unsigned long *)(addr))
#define ext4_set_bit_atomic ext2_set_bit_atomic
-#define ext4_clear_bit ext2_clear_bit
+#define ext4_clear_bit(nr, addr) \
+ __test_and_clear_le_bit((nr), (unsigned long *)(addr))
#define ext4_clear_bit_atomic ext2_clear_bit_atomic
-#define ext4_test_bit ext2_test_bit
-#define ext4_find_first_zero_bit ext2_find_first_zero_bit
-#define ext4_find_next_zero_bit ext2_find_next_zero_bit
-#define ext4_find_next_bit ext2_find_next_bit
+#define ext4_test_bit(nr, addr) \
+ test_le_bit((nr), (unsigned long *)(addr))
+#define ext4_find_first_zero_bit(addr, size) \
+ find_first_zero_le_bit((unsigned long *)(addr), (size))
+#define ext4_find_next_zero_bit(addr, size, off) \
+ find_next_zero_le_bit((unsigned long *)(addr), (size), (off))
+#define ext4_find_next_bit(addr, size, off) \
+ find_next_le_bit((unsigned long *)(addr), (size), (off))
/*
* Maximal mount counts between two filesystem checks
--
1.7.1.231.gd0b16
^ permalink raw reply related [flat|nested] 75+ messages in thread
* [PATCH 12/22] ext4: use little endian bitops
2010-10-15 9:46 ` [PATCH 12/22] ext4: " Akinobu Mita
@ 2010-10-15 9:46 ` Akinobu Mita
0 siblings, 0 replies; 75+ messages in thread
From: Akinobu Mita @ 2010-10-15 9:46 UTC (permalink / raw)
To: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig,
Andrew Morton
Cc: Akinobu Mita, Theodore Ts'o, Andreas Dilger, linux-ext4
As a preparation for removing ext2 non-atomic bit operations from
asm/bitops.h. This converts ext2 non-atomic bit operations to
little endian bit operations.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Andreas Dilger <adilger.kernel@dilger.ca>
Cc: linux-ext4@vger.kernel.org
---
fs/ext4/ext4.h | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 889ec9d..821c11a 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -895,14 +895,20 @@ struct ext4_inode_info {
#define test_opt(sb, opt) (EXT4_SB(sb)->s_mount_opt & \
EXT4_MOUNT_##opt)
-#define ext4_set_bit ext2_set_bit
+#define ext4_set_bit(nr, addr) \
+ __test_and_set_le_bit((nr), (unsigned long *)(addr))
#define ext4_set_bit_atomic ext2_set_bit_atomic
-#define ext4_clear_bit ext2_clear_bit
+#define ext4_clear_bit(nr, addr) \
+ __test_and_clear_le_bit((nr), (unsigned long *)(addr))
#define ext4_clear_bit_atomic ext2_clear_bit_atomic
-#define ext4_test_bit ext2_test_bit
-#define ext4_find_first_zero_bit ext2_find_first_zero_bit
-#define ext4_find_next_zero_bit ext2_find_next_zero_bit
-#define ext4_find_next_bit ext2_find_next_bit
+#define ext4_test_bit(nr, addr) \
+ test_le_bit((nr), (unsigned long *)(addr))
+#define ext4_find_first_zero_bit(addr, size) \
+ find_first_zero_le_bit((unsigned long *)(addr), (size))
+#define ext4_find_next_zero_bit(addr, size, off) \
+ find_next_zero_le_bit((unsigned long *)(addr), (size), (off))
+#define ext4_find_next_bit(addr, size, off) \
+ find_next_le_bit((unsigned long *)(addr), (size), (off))
/*
* Maximal mount counts between two filesystem checks
--
1.7.1.231.gd0b16
^ permalink raw reply related [flat|nested] 75+ messages in thread
* [PATCH 13/22] ocfs2: use little endian bitops
2010-10-15 9:45 [PATCH 00/22] Introduce little endian bitops Akinobu Mita
` (12 preceding siblings ...)
2010-10-15 9:46 ` [PATCH 12/22] ext4: " Akinobu Mita
@ 2010-10-15 9:46 ` Akinobu Mita
2010-10-18 20:19 ` Joel Becker
2010-10-15 9:46 ` [PATCH 14/22] nilfs2: " Akinobu Mita
` (9 subsequent siblings)
23 siblings, 1 reply; 75+ messages in thread
From: Akinobu Mita @ 2010-10-15 9:46 UTC (permalink / raw)
To: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig,
Andrew Morton
Cc: Akinobu Mita, Mark Fasheh, Joel Becker, ocfs2-devel
As a preparation for removing ext2 non-atomic bit operations from
asm/bitops.h. This converts ext2 non-atomic bit operations to
little endian bit operations.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <joel.becker@oracle.com>
Cc: ocfs2-devel@oss.oracle.com
---
fs/ocfs2/ocfs2.h | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/fs/ocfs2/ocfs2.h b/fs/ocfs2/ocfs2.h
index c67003b..24b0cb0 100644
--- a/fs/ocfs2/ocfs2.h
+++ b/fs/ocfs2/ocfs2.h
@@ -787,18 +787,21 @@ static inline unsigned int ocfs2_clusters_to_megabytes(struct super_block *sb,
static inline void _ocfs2_set_bit(unsigned int bit, unsigned long *bitmap)
{
- ext2_set_bit(bit, bitmap);
+ __test_and_set_le_bit(bit, bitmap);
}
#define ocfs2_set_bit(bit, addr) _ocfs2_set_bit((bit), (unsigned long *)(addr))
static inline void _ocfs2_clear_bit(unsigned int bit, unsigned long *bitmap)
{
- ext2_clear_bit(bit, bitmap);
+ __test_and_clear_le_bit(bit, bitmap);
}
#define ocfs2_clear_bit(bit, addr) _ocfs2_clear_bit((bit), (unsigned long *)(addr))
-#define ocfs2_test_bit ext2_test_bit
-#define ocfs2_find_next_zero_bit ext2_find_next_zero_bit
-#define ocfs2_find_next_bit ext2_find_next_bit
+#define ocfs2_test_bit(nr, addr) \
+ test_le_bit(nr, (unsigned long *)(addr))
+#define ocfs2_find_next_zero_bit(addr, size, off) \
+ find_next_zero_le_bit((unsigned long *)(addr), size, off)
+#define ocfs2_find_next_bit(addr, size, off) \
+ find_next_le_bit((unsigned long *)(addr), size, off)
#endif /* OCFS2_H */
--
1.7.1.231.gd0b16
^ permalink raw reply related [flat|nested] 75+ messages in thread
* [PATCH 14/22] nilfs2: use little endian bitops
2010-10-15 9:45 [PATCH 00/22] Introduce little endian bitops Akinobu Mita
` (13 preceding siblings ...)
2010-10-15 9:46 ` [PATCH 13/22] ocfs2: " Akinobu Mita
@ 2010-10-15 9:46 ` Akinobu Mita
2010-10-15 9:46 ` Akinobu Mita
2010-10-15 9:46 ` [PATCH 15/22] reiserfs: " Akinobu Mita
` (8 subsequent siblings)
23 siblings, 1 reply; 75+ messages in thread
From: Akinobu Mita @ 2010-10-15 9:46 UTC (permalink / raw)
To: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig,
Andrew Morton
Cc: Akinobu Mita, KONISHI Ryusuke, linux-nilfs
As a preparation for removing ext2 non-atomic bit operations from
asm/bitops.h. This converts ext2 non-atomic bit operations to
little endian bit operations.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: KONISHI Ryusuke <konishi.ryusuke@lab.ntt.co.jp>
Cc: linux-nilfs@vger.kernel.org
---
fs/nilfs2/alloc.h | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/fs/nilfs2/alloc.h b/fs/nilfs2/alloc.h
index 9af34a7..a2463e2 100644
--- a/fs/nilfs2/alloc.h
+++ b/fs/nilfs2/alloc.h
@@ -74,7 +74,8 @@ int nilfs_palloc_freev(struct inode *, __u64 *, size_t);
#define nilfs_set_bit_atomic ext2_set_bit_atomic
#define nilfs_clear_bit_atomic ext2_clear_bit_atomic
-#define nilfs_find_next_zero_bit ext2_find_next_zero_bit
+#define nilfs_find_next_zero_bit(addr, size, off) \
+ find_next_zero_le_bit((unsigned long *)(addr), (size), (off))
/*
* persistent object allocator cache
--
1.7.1.231.gd0b16
^ permalink raw reply related [flat|nested] 75+ messages in thread
* [PATCH 14/22] nilfs2: use little endian bitops
2010-10-15 9:46 ` [PATCH 14/22] nilfs2: " Akinobu Mita
@ 2010-10-15 9:46 ` Akinobu Mita
0 siblings, 0 replies; 75+ messages in thread
From: Akinobu Mita @ 2010-10-15 9:46 UTC (permalink / raw)
To: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig,
Andrew Morton
Cc: Akinobu Mita, KONISHI Ryusuke, linux-nilfs
As a preparation for removing ext2 non-atomic bit operations from
asm/bitops.h. This converts ext2 non-atomic bit operations to
little endian bit operations.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: KONISHI Ryusuke <konishi.ryusuke@lab.ntt.co.jp>
Cc: linux-nilfs@vger.kernel.org
---
fs/nilfs2/alloc.h | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/fs/nilfs2/alloc.h b/fs/nilfs2/alloc.h
index 9af34a7..a2463e2 100644
--- a/fs/nilfs2/alloc.h
+++ b/fs/nilfs2/alloc.h
@@ -74,7 +74,8 @@ int nilfs_palloc_freev(struct inode *, __u64 *, size_t);
#define nilfs_set_bit_atomic ext2_set_bit_atomic
#define nilfs_clear_bit_atomic ext2_clear_bit_atomic
-#define nilfs_find_next_zero_bit ext2_find_next_zero_bit
+#define nilfs_find_next_zero_bit(addr, size, off) \
+ find_next_zero_le_bit((unsigned long *)(addr), (size), (off))
/*
* persistent object allocator cache
--
1.7.1.231.gd0b16
^ permalink raw reply related [flat|nested] 75+ messages in thread
* [PATCH 15/22] reiserfs: use little endian bitops
2010-10-15 9:45 [PATCH 00/22] Introduce little endian bitops Akinobu Mita
` (14 preceding siblings ...)
2010-10-15 9:46 ` [PATCH 14/22] nilfs2: " Akinobu Mita
@ 2010-10-15 9:46 ` Akinobu Mita
2010-10-15 9:46 ` Akinobu Mita
2010-10-15 9:46 ` [PATCH 16/22] udf: " Akinobu Mita
` (7 subsequent siblings)
23 siblings, 1 reply; 75+ messages in thread
From: Akinobu Mita @ 2010-10-15 9:46 UTC (permalink / raw)
To: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig,
Andrew Morton
Cc: Akinobu Mita, reiserfs-devel
As a preparation for removing ext2 non-atomic bit operations from
asm/bitops.h. This converts ext2 non-atomic bit operations to
little endian bit operations.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: reiserfs-devel@vger.kernel.org
---
include/linux/reiserfs_fs.h | 34 ++++++++++++++++++++--------------
1 files changed, 20 insertions(+), 14 deletions(-)
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h
index 91a4177..8d5f122 100644
--- a/include/linux/reiserfs_fs.h
+++ b/include/linux/reiserfs_fs.h
@@ -1125,15 +1125,21 @@ struct reiserfs_de_head {
# define aligned_address(addr) ((void *)((long)(addr) & ~((1UL << ADDR_UNALIGNED_BITS) - 1)))
# define unaligned_offset(addr) (((int)((long)(addr) & ((1 << ADDR_UNALIGNED_BITS) - 1))) << 3)
-# define set_bit_unaligned(nr, addr) ext2_set_bit((nr) + unaligned_offset(addr), aligned_address(addr))
-# define clear_bit_unaligned(nr, addr) ext2_clear_bit((nr) + unaligned_offset(addr), aligned_address(addr))
-# define test_bit_unaligned(nr, addr) ext2_test_bit((nr) + unaligned_offset(addr), aligned_address(addr))
+# define set_bit_unaligned(nr, addr) \
+ __test_and_set_le_bit((nr) + unaligned_offset(addr), aligned_address(addr))
+# define clear_bit_unaligned(nr, addr) \
+ __test_and_clear_le_bit((nr) + unaligned_offset(addr), aligned_address(addr))
+# define test_bit_unaligned(nr, addr) \
+ test_le_bit((nr) + unaligned_offset(addr), aligned_address(addr))
#else
-# define set_bit_unaligned(nr, addr) ext2_set_bit(nr, addr)
-# define clear_bit_unaligned(nr, addr) ext2_clear_bit(nr, addr)
-# define test_bit_unaligned(nr, addr) ext2_test_bit(nr, addr)
+# define set_bit_unaligned(nr, addr) \
+ __test_and_set_le_bit(nr, (unsigned long *)(addr))
+# define clear_bit_unaligned(nr, addr) \
+ __test_and_clear_le_bit(nr, (unsigned long *)(addr))
+# define test_bit_unaligned(nr, addr) \
+ test_le_bit(nr, (unsigned long *)(addr))
#endif
@@ -2328,14 +2334,14 @@ __u32 keyed_hash(const signed char *msg, int len);
__u32 yura_hash(const signed char *msg, int len);
__u32 r5_hash(const signed char *msg, int len);
-/* the ext2 bit routines adjust for big or little endian as
-** appropriate for the arch, so in our laziness we use them rather
-** than using the bit routines they call more directly. These
-** routines must be used when changing on disk bitmaps. */
-#define reiserfs_test_and_set_le_bit ext2_set_bit
-#define reiserfs_test_and_clear_le_bit ext2_clear_bit
-#define reiserfs_test_le_bit ext2_test_bit
-#define reiserfs_find_next_zero_le_bit ext2_find_next_zero_bit
+#define reiserfs_test_and_set_le_bit(nr, addr) \
+ __test_and_set_le_bit((nr), (unsigned long *)(addr))
+#define reiserfs_test_and_clear_le_bit(nr, addr) \
+ __test_and_clear_le_bit((nr), (unsigned long *)(addr))
+#define reiserfs_test_le_bit(nr, addr) \
+ test_le_bit((nr), (unsigned long *)(addr))
+#define reiserfs_find_next_zero_le_bit(addr, size, off) \
+ find_next_zero_le_bit((unsigned long *)(addr), (size), (off))
/* sometimes reiserfs_truncate may require to allocate few new blocks
to perform indirect2direct conversion. People probably used to
--
1.7.1.231.gd0b16
^ permalink raw reply related [flat|nested] 75+ messages in thread
* [PATCH 15/22] reiserfs: use little endian bitops
2010-10-15 9:46 ` [PATCH 15/22] reiserfs: " Akinobu Mita
@ 2010-10-15 9:46 ` Akinobu Mita
0 siblings, 0 replies; 75+ messages in thread
From: Akinobu Mita @ 2010-10-15 9:46 UTC (permalink / raw)
To: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig,
Andrew Morton
Cc: Akinobu Mita, reiserfs-devel
As a preparation for removing ext2 non-atomic bit operations from
asm/bitops.h. This converts ext2 non-atomic bit operations to
little endian bit operations.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: reiserfs-devel@vger.kernel.org
---
include/linux/reiserfs_fs.h | 34 ++++++++++++++++++++--------------
1 files changed, 20 insertions(+), 14 deletions(-)
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h
index 91a4177..8d5f122 100644
--- a/include/linux/reiserfs_fs.h
+++ b/include/linux/reiserfs_fs.h
@@ -1125,15 +1125,21 @@ struct reiserfs_de_head {
# define aligned_address(addr) ((void *)((long)(addr) & ~((1UL << ADDR_UNALIGNED_BITS) - 1)))
# define unaligned_offset(addr) (((int)((long)(addr) & ((1 << ADDR_UNALIGNED_BITS) - 1))) << 3)
-# define set_bit_unaligned(nr, addr) ext2_set_bit((nr) + unaligned_offset(addr), aligned_address(addr))
-# define clear_bit_unaligned(nr, addr) ext2_clear_bit((nr) + unaligned_offset(addr), aligned_address(addr))
-# define test_bit_unaligned(nr, addr) ext2_test_bit((nr) + unaligned_offset(addr), aligned_address(addr))
+# define set_bit_unaligned(nr, addr) \
+ __test_and_set_le_bit((nr) + unaligned_offset(addr), aligned_address(addr))
+# define clear_bit_unaligned(nr, addr) \
+ __test_and_clear_le_bit((nr) + unaligned_offset(addr), aligned_address(addr))
+# define test_bit_unaligned(nr, addr) \
+ test_le_bit((nr) + unaligned_offset(addr), aligned_address(addr))
#else
-# define set_bit_unaligned(nr, addr) ext2_set_bit(nr, addr)
-# define clear_bit_unaligned(nr, addr) ext2_clear_bit(nr, addr)
-# define test_bit_unaligned(nr, addr) ext2_test_bit(nr, addr)
+# define set_bit_unaligned(nr, addr) \
+ __test_and_set_le_bit(nr, (unsigned long *)(addr))
+# define clear_bit_unaligned(nr, addr) \
+ __test_and_clear_le_bit(nr, (unsigned long *)(addr))
+# define test_bit_unaligned(nr, addr) \
+ test_le_bit(nr, (unsigned long *)(addr))
#endif
@@ -2328,14 +2334,14 @@ __u32 keyed_hash(const signed char *msg, int len);
__u32 yura_hash(const signed char *msg, int len);
__u32 r5_hash(const signed char *msg, int len);
-/* the ext2 bit routines adjust for big or little endian as
-** appropriate for the arch, so in our laziness we use them rather
-** than using the bit routines they call more directly. These
-** routines must be used when changing on disk bitmaps. */
-#define reiserfs_test_and_set_le_bit ext2_set_bit
-#define reiserfs_test_and_clear_le_bit ext2_clear_bit
-#define reiserfs_test_le_bit ext2_test_bit
-#define reiserfs_find_next_zero_le_bit ext2_find_next_zero_bit
+#define reiserfs_test_and_set_le_bit(nr, addr) \
+ __test_and_set_le_bit((nr), (unsigned long *)(addr))
+#define reiserfs_test_and_clear_le_bit(nr, addr) \
+ __test_and_clear_le_bit((nr), (unsigned long *)(addr))
+#define reiserfs_test_le_bit(nr, addr) \
+ test_le_bit((nr), (unsigned long *)(addr))
+#define reiserfs_find_next_zero_le_bit(addr, size, off) \
+ find_next_zero_le_bit((unsigned long *)(addr), (size), (off))
/* sometimes reiserfs_truncate may require to allocate few new blocks
to perform indirect2direct conversion. People probably used to
--
1.7.1.231.gd0b16
^ permalink raw reply related [flat|nested] 75+ messages in thread
* [PATCH 16/22] udf: use little endian bitops
2010-10-15 9:45 [PATCH 00/22] Introduce little endian bitops Akinobu Mita
` (15 preceding siblings ...)
2010-10-15 9:46 ` [PATCH 15/22] reiserfs: " Akinobu Mita
@ 2010-10-15 9:46 ` Akinobu Mita
2010-10-15 9:46 ` Akinobu Mita
2010-10-18 10:46 ` Jan Kara
2010-10-15 9:46 ` [PATCH 17/22] ufs: " Akinobu Mita
` (6 subsequent siblings)
23 siblings, 2 replies; 75+ messages in thread
From: Akinobu Mita @ 2010-10-15 9:46 UTC (permalink / raw)
To: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig,
Andrew Morton
Cc: Akinobu Mita, Jan Kara
As a preparation for removing ext2 non-atomic bit operations from
asm/bitops.h. This converts ext2 non-atomic bit operations to
little endian bit operations.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Jan Kara <jack@suse.cz>
---
fs/udf/balloc.c | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/fs/udf/balloc.c b/fs/udf/balloc.c
index b608efa..e55aff9 100644
--- a/fs/udf/balloc.c
+++ b/fs/udf/balloc.c
@@ -27,11 +27,14 @@
#include "udf_i.h"
#include "udf_sb.h"
-#define udf_clear_bit(nr, addr) ext2_clear_bit(nr, addr)
-#define udf_set_bit(nr, addr) ext2_set_bit(nr, addr)
-#define udf_test_bit(nr, addr) ext2_test_bit(nr, addr)
+#define udf_clear_bit(nr, addr) \
+ __test_and_clear_le_bit(nr, (unsigned long *)(addr))
+#define udf_set_bit(nr, addr) \
+ __test_and_set_le_bit(nr, (unsigned long *)(addr))
+#define udf_test_bit(nr, addr) \
+ test_le_bit(nr, (unsigned long *)(addr))
#define udf_find_next_one_bit(addr, size, offset) \
- ext2_find_next_bit(addr, size, offset)
+ find_next_le_bit((unsigned long *)(addr), size, offset)
static int read_block_bitmap(struct super_block *sb,
struct udf_bitmap *bitmap, unsigned int block,
--
1.7.1.231.gd0b16
^ permalink raw reply related [flat|nested] 75+ messages in thread
* [PATCH 16/22] udf: use little endian bitops
2010-10-15 9:46 ` [PATCH 16/22] udf: " Akinobu Mita
@ 2010-10-15 9:46 ` Akinobu Mita
2010-10-18 10:46 ` Jan Kara
1 sibling, 0 replies; 75+ messages in thread
From: Akinobu Mita @ 2010-10-15 9:46 UTC (permalink / raw)
To: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig,
Andrew Morton
Cc: Akinobu Mita, Jan Kara
As a preparation for removing ext2 non-atomic bit operations from
asm/bitops.h. This converts ext2 non-atomic bit operations to
little endian bit operations.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Jan Kara <jack@suse.cz>
---
fs/udf/balloc.c | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/fs/udf/balloc.c b/fs/udf/balloc.c
index b608efa..e55aff9 100644
--- a/fs/udf/balloc.c
+++ b/fs/udf/balloc.c
@@ -27,11 +27,14 @@
#include "udf_i.h"
#include "udf_sb.h"
-#define udf_clear_bit(nr, addr) ext2_clear_bit(nr, addr)
-#define udf_set_bit(nr, addr) ext2_set_bit(nr, addr)
-#define udf_test_bit(nr, addr) ext2_test_bit(nr, addr)
+#define udf_clear_bit(nr, addr) \
+ __test_and_clear_le_bit(nr, (unsigned long *)(addr))
+#define udf_set_bit(nr, addr) \
+ __test_and_set_le_bit(nr, (unsigned long *)(addr))
+#define udf_test_bit(nr, addr) \
+ test_le_bit(nr, (unsigned long *)(addr))
#define udf_find_next_one_bit(addr, size, offset) \
- ext2_find_next_bit(addr, size, offset)
+ find_next_le_bit((unsigned long *)(addr), size, offset)
static int read_block_bitmap(struct super_block *sb,
struct udf_bitmap *bitmap, unsigned int block,
--
1.7.1.231.gd0b16
^ permalink raw reply related [flat|nested] 75+ messages in thread
* [PATCH 17/22] ufs: use little endian bitops
2010-10-15 9:45 [PATCH 00/22] Introduce little endian bitops Akinobu Mita
` (16 preceding siblings ...)
2010-10-15 9:46 ` [PATCH 16/22] udf: " Akinobu Mita
@ 2010-10-15 9:46 ` Akinobu Mita
2010-10-15 9:46 ` Akinobu Mita
2010-10-15 9:46 ` [PATCH 18/22] md: use little endian bit operations Akinobu Mita
` (5 subsequent siblings)
23 siblings, 1 reply; 75+ messages in thread
From: Akinobu Mita @ 2010-10-15 9:46 UTC (permalink / raw)
To: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig,
Andrew Morton
Cc: Akinobu Mita, Evgeniy Dushistov
As a preparation for removing ext2 non-atomic bit operations from
asm/bitops.h. This converts ext2 non-atomic bit operations to
little endian bit operations.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Evgeniy Dushistov <dushistov@mail.ru>
---
fs/ufs/util.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/ufs/util.h b/fs/ufs/util.h
index 9f8775c..64f7559 100644
--- a/fs/ufs/util.h
+++ b/fs/ufs/util.h
@@ -408,7 +408,7 @@ static inline unsigned _ubh_find_next_zero_bit_(
for (;;) {
count = min_t(unsigned int, size + offset, uspi->s_bpf);
size -= count - offset;
- pos = ext2_find_next_zero_bit (ubh->bh[base]->b_data, count, offset);
+ pos = find_next_zero_le_bit((unsigned long *)ubh->bh[base]->b_data, count, offset);
if (pos < count || !size)
break;
base++;
--
1.7.1.231.gd0b16
^ permalink raw reply related [flat|nested] 75+ messages in thread
* [PATCH 17/22] ufs: use little endian bitops
2010-10-15 9:46 ` [PATCH 17/22] ufs: " Akinobu Mita
@ 2010-10-15 9:46 ` Akinobu Mita
0 siblings, 0 replies; 75+ messages in thread
From: Akinobu Mita @ 2010-10-15 9:46 UTC (permalink / raw)
To: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig,
Andrew Morton
Cc: Akinobu Mita, Evgeniy Dushistov
As a preparation for removing ext2 non-atomic bit operations from
asm/bitops.h. This converts ext2 non-atomic bit operations to
little endian bit operations.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Evgeniy Dushistov <dushistov@mail.ru>
---
fs/ufs/util.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/ufs/util.h b/fs/ufs/util.h
index 9f8775c..64f7559 100644
--- a/fs/ufs/util.h
+++ b/fs/ufs/util.h
@@ -408,7 +408,7 @@ static inline unsigned _ubh_find_next_zero_bit_(
for (;;) {
count = min_t(unsigned int, size + offset, uspi->s_bpf);
size -= count - offset;
- pos = ext2_find_next_zero_bit (ubh->bh[base]->b_data, count, offset);
+ pos = find_next_zero_le_bit((unsigned long *)ubh->bh[base]->b_data, count, offset);
if (pos < count || !size)
break;
base++;
--
1.7.1.231.gd0b16
^ permalink raw reply related [flat|nested] 75+ messages in thread
* [PATCH 18/22] md: use little endian bit operations
2010-10-15 9:45 [PATCH 00/22] Introduce little endian bitops Akinobu Mita
` (17 preceding siblings ...)
2010-10-15 9:46 ` [PATCH 17/22] ufs: " Akinobu Mita
@ 2010-10-15 9:46 ` Akinobu Mita
2010-10-18 2:41 ` Neil Brown
2010-10-15 9:46 ` [PATCH 19/22] dm: " Akinobu Mita
` (4 subsequent siblings)
23 siblings, 1 reply; 75+ messages in thread
From: Akinobu Mita @ 2010-10-15 9:46 UTC (permalink / raw)
To: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig,
Andrew Morton
Cc: Akinobu Mita, Neil Brown, linux-raid
As a preparation for removing ext2 non-atomic bit operations from
asm/bitops.h. This converts ext2 non-atomic bit operations to
little endian bit operations.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Neil Brown <neilb@suse.de>
Cc: linux-raid@vger.kernel.org
---
drivers/md/bitmap.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
index e4fb58d..2a37051 100644
--- a/drivers/md/bitmap.c
+++ b/drivers/md/bitmap.c
@@ -850,7 +850,7 @@ static void bitmap_file_set_bit(struct bitmap *bitmap, sector_t block)
if (bitmap->flags & BITMAP_HOSTENDIAN)
set_bit(bit, kaddr);
else
- ext2_set_bit(bit, kaddr);
+ __test_and_set_le_bit(bit, kaddr);
kunmap_atomic(kaddr, KM_USER0);
PRINTK("set file bit %lu page %lu\n", bit, page->index);
}
@@ -1046,7 +1046,7 @@ static int bitmap_init_from_disk(struct bitmap *bitmap, sector_t start)
if (bitmap->flags & BITMAP_HOSTENDIAN)
b = test_bit(bit, paddr);
else
- b = ext2_test_bit(bit, paddr);
+ b = test_le_bit(bit, paddr);
kunmap_atomic(paddr, KM_USER0);
if (b) {
/* if the disk bit is set, set the memory bit */
@@ -1222,7 +1222,7 @@ void bitmap_daemon_work(mddev_t *mddev)
clear_bit(file_page_offset(bitmap, j),
paddr);
else
- ext2_clear_bit(file_page_offset(bitmap, j),
+ __test_and_clear_le_bit(file_page_offset(bitmap, j),
paddr);
kunmap_atomic(paddr, KM_USER0);
} else
--
1.7.1.231.gd0b16
^ permalink raw reply related [flat|nested] 75+ messages in thread
* [PATCH 19/22] dm: use little endian bit operations
2010-10-15 9:45 [PATCH 00/22] Introduce little endian bitops Akinobu Mita
` (18 preceding siblings ...)
2010-10-15 9:46 ` [PATCH 18/22] md: use little endian bit operations Akinobu Mita
@ 2010-10-15 9:46 ` Akinobu Mita
2010-10-15 9:46 ` Akinobu Mita
2010-10-15 9:46 ` [PATCH 20/22] bitops: remove ext2 non-atomic bitops from asm/bitops.h Akinobu Mita
` (3 subsequent siblings)
23 siblings, 1 reply; 75+ messages in thread
From: Akinobu Mita @ 2010-10-15 9:46 UTC (permalink / raw)
To: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig,
Andrew Morton
Cc: dm-devel, Akinobu Mita
As a preparation for removing ext2 non-atomic bit operations from
asm/bitops.h. This converts ext2 non-atomic bit operations to
little endian bit operations.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Alasdair Kergon
Cc: dm-devel@redhat.com
---
drivers/md/dm-log.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/md/dm-log.c b/drivers/md/dm-log.c
index 5a08be0..9a61fbc 100644
--- a/drivers/md/dm-log.c
+++ b/drivers/md/dm-log.c
@@ -251,20 +251,20 @@ struct log_c {
*/
static inline int log_test_bit(uint32_t *bs, unsigned bit)
{
- return ext2_test_bit(bit, (unsigned long *) bs) ? 1 : 0;
+ return test_le_bit(bit, (unsigned long *) bs) ? 1 : 0;
}
static inline void log_set_bit(struct log_c *l,
uint32_t *bs, unsigned bit)
{
- ext2_set_bit(bit, (unsigned long *) bs);
+ __test_and_set_le_bit(bit, (unsigned long *) bs);
l->touched_cleaned = 1;
}
static inline void log_clear_bit(struct log_c *l,
uint32_t *bs, unsigned bit)
{
- ext2_clear_bit(bit, (unsigned long *) bs);
+ __test_and_clear_le_bit(bit, (unsigned long *) bs);
l->touched_dirtied = 1;
}
@@ -740,7 +740,7 @@ static int core_get_resync_work(struct dm_dirty_log *log, region_t *region)
return 0;
do {
- *region = ext2_find_next_zero_bit(
+ *region = find_next_zero_le_bit(
(unsigned long *) lc->sync_bits,
lc->region_count,
lc->sync_search);
--
1.7.1.231.gd0b16
^ permalink raw reply related [flat|nested] 75+ messages in thread
* [PATCH 19/22] dm: use little endian bit operations
2010-10-15 9:46 ` [PATCH 19/22] dm: " Akinobu Mita
@ 2010-10-15 9:46 ` Akinobu Mita
0 siblings, 0 replies; 75+ messages in thread
From: Akinobu Mita @ 2010-10-15 9:46 UTC (permalink / raw)
To: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig,
Andrew Morton
Cc: Akinobu Mita, dm-devel
As a preparation for removing ext2 non-atomic bit operations from
asm/bitops.h. This converts ext2 non-atomic bit operations to
little endian bit operations.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Alasdair Kergon
Cc: dm-devel@redhat.com
---
drivers/md/dm-log.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/md/dm-log.c b/drivers/md/dm-log.c
index 5a08be0..9a61fbc 100644
--- a/drivers/md/dm-log.c
+++ b/drivers/md/dm-log.c
@@ -251,20 +251,20 @@ struct log_c {
*/
static inline int log_test_bit(uint32_t *bs, unsigned bit)
{
- return ext2_test_bit(bit, (unsigned long *) bs) ? 1 : 0;
+ return test_le_bit(bit, (unsigned long *) bs) ? 1 : 0;
}
static inline void log_set_bit(struct log_c *l,
uint32_t *bs, unsigned bit)
{
- ext2_set_bit(bit, (unsigned long *) bs);
+ __test_and_set_le_bit(bit, (unsigned long *) bs);
l->touched_cleaned = 1;
}
static inline void log_clear_bit(struct log_c *l,
uint32_t *bs, unsigned bit)
{
- ext2_clear_bit(bit, (unsigned long *) bs);
+ __test_and_clear_le_bit(bit, (unsigned long *) bs);
l->touched_dirtied = 1;
}
@@ -740,7 +740,7 @@ static int core_get_resync_work(struct dm_dirty_log *log, region_t *region)
return 0;
do {
- *region = ext2_find_next_zero_bit(
+ *region = find_next_zero_le_bit(
(unsigned long *) lc->sync_bits,
lc->region_count,
lc->sync_search);
--
1.7.1.231.gd0b16
^ permalink raw reply related [flat|nested] 75+ messages in thread
* [PATCH 20/22] bitops: remove ext2 non-atomic bitops from asm/bitops.h
2010-10-15 9:45 [PATCH 00/22] Introduce little endian bitops Akinobu Mita
` (19 preceding siblings ...)
2010-10-15 9:46 ` [PATCH 19/22] dm: " Akinobu Mita
@ 2010-10-15 9:46 ` Akinobu Mita
2010-10-15 9:46 ` Akinobu Mita
2010-10-15 9:46 ` [PATCH 21/22] m68k: convert minix bitops to use little endian bitops Akinobu Mita
` (2 subsequent siblings)
23 siblings, 1 reply; 75+ messages in thread
From: Akinobu Mita @ 2010-10-15 9:46 UTC (permalink / raw)
To: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig,
Andrew Morton
Cc: Akinobu Mita, Jan Kara, linux-ext4
As all ext2 non-atomic bit operations are converted to little endian
bit operations except for fs/ext2/*, this makes them ext2 local macros
using little endian bit operations, and remove them from asm/bitops.h
for all architectures.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Jan Kara <jack@suse.cz>
Cc: linux-ext4@vger.kernel.org
---
arch/alpha/include/asm/bitops.h | 1 -
arch/arm/include/asm/bitops.h | 12 ------------
arch/avr32/include/asm/bitops.h | 1 -
arch/blackfin/include/asm/bitops.h | 1 -
arch/cris/include/asm/bitops.h | 1 -
arch/frv/include/asm/bitops.h | 1 -
arch/h8300/include/asm/bitops.h | 1 -
arch/ia64/include/asm/bitops.h | 1 -
arch/m32r/include/asm/bitops.h | 1 -
arch/m68k/include/asm/bitops_mm.h | 13 -------------
arch/m68k/include/asm/bitops_no.h | 20 --------------------
arch/mips/include/asm/bitops.h | 1 -
arch/mn10300/include/asm/bitops.h | 1 -
arch/parisc/include/asm/bitops.h | 1 -
arch/powerpc/include/asm/bitops.h | 14 --------------
arch/s390/include/asm/bitops.h | 15 ---------------
arch/sh/include/asm/bitops.h | 1 -
arch/sparc/include/asm/bitops_32.h | 1 -
arch/sparc/include/asm/bitops_64.h | 1 -
arch/tile/include/asm/bitops.h | 1 -
arch/x86/include/asm/bitops.h | 1 -
arch/xtensa/include/asm/bitops.h | 1 -
include/asm-generic/bitops.h | 1 -
include/asm-generic/bitops/ext2-non-atomic.h | 18 ------------------
include/linux/ext2_fs.h | 12 ++++++++++++
25 files changed, 12 insertions(+), 110 deletions(-)
delete mode 100644 include/asm-generic/bitops/ext2-non-atomic.h
diff --git a/arch/alpha/include/asm/bitops.h b/arch/alpha/include/asm/bitops.h
index 955fec7..822433a 100644
--- a/arch/alpha/include/asm/bitops.h
+++ b/arch/alpha/include/asm/bitops.h
@@ -455,7 +455,6 @@ sched_find_first_bit(const unsigned long b[2])
}
#include <asm-generic/bitops/le.h>
-#include <asm-generic/bitops/ext2-non-atomic.h>
#define ext2_set_bit_atomic(l,n,a) test_and_set_bit(n,a)
#define ext2_clear_bit_atomic(l,n,a) test_and_clear_bit(n,a)
diff --git a/arch/arm/include/asm/bitops.h b/arch/arm/include/asm/bitops.h
index d8af4af..e656a85 100644
--- a/arch/arm/include/asm/bitops.h
+++ b/arch/arm/include/asm/bitops.h
@@ -327,22 +327,10 @@ static inline int fls(int x)
* Ext2 is defined to use little-endian byte ordering.
* These do not need to be atomic.
*/
-#define ext2_set_bit(nr,p) \
- __test_and_set_le_bit(nr, (unsigned long *)(p))
#define ext2_set_bit_atomic(lock,nr,p) \
test_and_set_le_bit(nr, (unsigned long *)(p))
-#define ext2_clear_bit(nr,p) \
- __test_and_clear_le_bit(nr, (unsigned long *)(p))
#define ext2_clear_bit_atomic(lock,nr,p) \
test_and_clear_le_bit(nr, (unsigned long *)(p))
-#define ext2_test_bit(nr,p) \
- test_le_bit(nr, (unsigned long *)(p))
-#define ext2_find_first_zero_bit(p,sz) \
- find_first_zero_le_bit((unsigned long *)(p), sz)
-#define ext2_find_next_zero_bit(p,sz,off) \
- find_next_zero_le_bit((unsigned long *)(p), sz, off)
-#define ext2_find_next_bit(p, sz, off) \
- find_next_le_bit((unsigned long *)(p), sz, off)
/*
* Minix is defined to use little-endian byte ordering.
diff --git a/arch/avr32/include/asm/bitops.h b/arch/avr32/include/asm/bitops.h
index 1c482fc..73a163a 100644
--- a/arch/avr32/include/asm/bitops.h
+++ b/arch/avr32/include/asm/bitops.h
@@ -300,7 +300,6 @@ static inline int ffs(unsigned long word)
#include <asm-generic/bitops/lock.h>
#include <asm-generic/bitops/le.h>
-#include <asm-generic/bitops/ext2-non-atomic.h>
#include <asm-generic/bitops/ext2-atomic.h>
#include <asm-generic/bitops/minix-le.h>
diff --git a/arch/blackfin/include/asm/bitops.h b/arch/blackfin/include/asm/bitops.h
index 1261078..2c549f7 100644
--- a/arch/blackfin/include/asm/bitops.h
+++ b/arch/blackfin/include/asm/bitops.h
@@ -26,7 +26,6 @@
#include <asm-generic/bitops/lock.h>
#include <asm-generic/bitops/le.h>
-#include <asm-generic/bitops/ext2-non-atomic.h>
#include <asm-generic/bitops/ext2-atomic.h>
#include <asm-generic/bitops/minix.h>
diff --git a/arch/cris/include/asm/bitops.h b/arch/cris/include/asm/bitops.h
index 599ae67..71bea40 100644
--- a/arch/cris/include/asm/bitops.h
+++ b/arch/cris/include/asm/bitops.h
@@ -155,7 +155,6 @@ static inline int test_and_change_bit(int nr, volatile unsigned long *addr)
#include <asm-generic/bitops/lock.h>
#include <asm-generic/bitops/le.h>
-#include <asm-generic/bitops/ext2-non-atomic.h>
#define ext2_set_bit_atomic(l,n,a) test_and_set_bit(n,a)
#define ext2_clear_bit_atomic(l,n,a) test_and_clear_bit(n,a)
diff --git a/arch/frv/include/asm/bitops.h b/arch/frv/include/asm/bitops.h
index 2631917..e3ea644 100644
--- a/arch/frv/include/asm/bitops.h
+++ b/arch/frv/include/asm/bitops.h
@@ -402,7 +402,6 @@ int __ilog2_u64(u64 n)
#include <asm-generic/bitops/lock.h>
#include <asm-generic/bitops/le.h>
-#include <asm-generic/bitops/ext2-non-atomic.h>
#define ext2_set_bit_atomic(lock,nr,addr) test_and_set_bit ((nr) ^ 0x18, (addr))
#define ext2_clear_bit_atomic(lock,nr,addr) test_and_clear_bit((nr) ^ 0x18, (addr))
diff --git a/arch/h8300/include/asm/bitops.h b/arch/h8300/include/asm/bitops.h
index 763094f..23cea66 100644
--- a/arch/h8300/include/asm/bitops.h
+++ b/arch/h8300/include/asm/bitops.h
@@ -201,7 +201,6 @@ static __inline__ unsigned long __ffs(unsigned long word)
#include <asm-generic/bitops/hweight.h>
#include <asm-generic/bitops/lock.h>
#include <asm-generic/bitops/le.h>
-#include <asm-generic/bitops/ext2-non-atomic.h>
#include <asm-generic/bitops/ext2-atomic.h>
#include <asm-generic/bitops/minix.h>
diff --git a/arch/ia64/include/asm/bitops.h b/arch/ia64/include/asm/bitops.h
index 2cde4f0..336984a 100644
--- a/arch/ia64/include/asm/bitops.h
+++ b/arch/ia64/include/asm/bitops.h
@@ -457,7 +457,6 @@ static __inline__ unsigned long __arch_hweight64(unsigned long x)
#ifdef __KERNEL__
#include <asm-generic/bitops/le.h>
-#include <asm-generic/bitops/ext2-non-atomic.h>
#define ext2_set_bit_atomic(l,n,a) test_and_set_bit(n,a)
#define ext2_clear_bit_atomic(l,n,a) test_and_clear_bit(n,a)
diff --git a/arch/m32r/include/asm/bitops.h b/arch/m32r/include/asm/bitops.h
index 681f7e8..cdfb4c8 100644
--- a/arch/m32r/include/asm/bitops.h
+++ b/arch/m32r/include/asm/bitops.h
@@ -267,7 +267,6 @@ static __inline__ int test_and_change_bit(int nr, volatile void * addr)
#ifdef __KERNEL__
#include <asm-generic/bitops/le.h>
-#include <asm-generic/bitops/ext2-non-atomic.h>
#include <asm-generic/bitops/ext2-atomic.h>
#include <asm-generic/bitops/minix.h>
diff --git a/arch/m68k/include/asm/bitops_mm.h b/arch/m68k/include/asm/bitops_mm.h
index 8b3059d..e2cc3be 100644
--- a/arch/m68k/include/asm/bitops_mm.h
+++ b/arch/m68k/include/asm/bitops_mm.h
@@ -467,23 +467,10 @@ static inline unsigned long find_next_le_bit(const unsigned long *addr,
/* Bitmap functions for the ext2 filesystem. */
-#define ext2_set_bit(nr, addr) \
- __test_and_set_le_bit(nr, (unsigned long *)(addr))
#define ext2_set_bit_atomic(lock, nr, addr) \
test_and_set_le_bit(nr, (unsigned long *)(addr))
-#define ext2_clear_bit(nr, addr) \
- __test_and_clear_le_bit(nr, (unsigned long *)(addr))
#define ext2_clear_bit_atomic(lock, nr, addr) \
test_and_clear_le_bit(nr, (unsigned long *)(addr))
-#define ext2_find_next_zero_bit(addr, size, offset) \
- find_next_zero_le_bit((unsigned long *)(addr), size, offset)
-#define ext2_find_next_bit(addr, size, offset) \
- find_next_le_bit((unsigned long *)(addr), size, offset)
-#define ext2_test_bit(nr, vaddr) test_le_bit(nr, vaddr)
-#define ext2_find_first_zero_bit(vaddr, size) \
- find_first_zero_le_bit((unsigned long *)(vaddr), size)
-#define ext2_find_first_bit(vaddr, size) \
- find_first_le_bit((unsigned long *)(vaddr), size)
#endif /* __KERNEL__ */
diff --git a/arch/m68k/include/asm/bitops_no.h b/arch/m68k/include/asm/bitops_no.h
index 9f5eb02..7cabe45 100644
--- a/arch/m68k/include/asm/bitops_no.h
+++ b/arch/m68k/include/asm/bitops_no.h
@@ -332,26 +332,6 @@ found_middle:
return result + ffz(__swab32(tmp));
}
-#define ext2_set_bit(nr, addr) \
- __test_and_set_le_bit(nr, addr)
-
-#define ext2_clear_bit(nr, addr) \
- test_and_clear_le_bit(nr, addr)
-
-#define ext2_test_bit(nr, addr) \
- test_le_bit(nr, addr)
-
-#define ext2_find_first_zero_bit(addr, size) \
- find_first_zero_le_bit(addr, size)
-
-#define ext2_find_next_zero_bit(addr, size, offset) \
- find_next_zero_le_bit(addr, size, offset)
-
-#define ext2_find_next_bit(addr, size, off) \
- find_next_le_bit((unsigned long *)(addr), (size), (off))
-
-#include <asm-generic/bitops/minix.h>
-
#endif /* __KERNEL__ */
#include <asm-generic/bitops/fls.h>
diff --git a/arch/mips/include/asm/bitops.h b/arch/mips/include/asm/bitops.h
index 4795820..07ce5aa 100644
--- a/arch/mips/include/asm/bitops.h
+++ b/arch/mips/include/asm/bitops.h
@@ -705,7 +705,6 @@ static inline int ffs(int word)
#include <asm-generic/bitops/const_hweight.h>
#include <asm-generic/bitops/le.h>
-#include <asm-generic/bitops/ext2-non-atomic.h>
#include <asm-generic/bitops/ext2-atomic.h>
#include <asm-generic/bitops/minix.h>
diff --git a/arch/mn10300/include/asm/bitops.h b/arch/mn10300/include/asm/bitops.h
index 4688c08..e1a9768 100644
--- a/arch/mn10300/include/asm/bitops.h
+++ b/arch/mn10300/include/asm/bitops.h
@@ -234,7 +234,6 @@ int ffs(int x)
test_and_clear_bit((nr), (addr))
#include <asm-generic/bitops/le.h>
-#include <asm-generic/bitops/ext2-non-atomic.h>
#include <asm-generic/bitops/minix-le.h>
#endif /* __KERNEL__ */
diff --git a/arch/parisc/include/asm/bitops.h b/arch/parisc/include/asm/bitops.h
index 4b9e58d..919d7ed 100644
--- a/arch/parisc/include/asm/bitops.h
+++ b/arch/parisc/include/asm/bitops.h
@@ -223,7 +223,6 @@ static __inline__ int fls(int x)
#ifdef __KERNEL__
#include <asm-generic/bitops/le.h>
-#include <asm-generic/bitops/ext2-non-atomic.h>
/* '3' is bits per byte */
#define LE_BYTE_ADDR ((sizeof(unsigned long) - 1) << 3)
diff --git a/arch/powerpc/include/asm/bitops.h b/arch/powerpc/include/asm/bitops.h
index b4f3f84..eb9ce7f 100644
--- a/arch/powerpc/include/asm/bitops.h
+++ b/arch/powerpc/include/asm/bitops.h
@@ -303,25 +303,11 @@ unsigned long find_next_le_bit(const unsigned long *addr,
unsigned long size, unsigned long offset);
/* Bitmap functions for the ext2 filesystem */
-#define ext2_set_bit(nr,addr) \
- __test_and_set_le_bit((nr), (unsigned long*)addr)
-#define ext2_clear_bit(nr, addr) \
- __test_and_clear_le_bit((nr), (unsigned long*)addr)
-
#define ext2_set_bit_atomic(lock, nr, addr) \
test_and_set_le_bit((nr), (unsigned long*)addr)
#define ext2_clear_bit_atomic(lock, nr, addr) \
test_and_clear_le_bit((nr), (unsigned long*)addr)
-#define ext2_test_bit(nr, addr) test_le_bit((nr),(unsigned long*)addr)
-
-#define ext2_find_first_zero_bit(addr, size) \
- find_first_zero_le_bit((unsigned long*)addr, size)
-#define ext2_find_next_zero_bit(addr, size, off) \
- find_next_zero_le_bit((unsigned long *)addr, size, off)
-
-#define ext2_find_next_bit(addr, size, off) \
- find_next_le_bit((unsigned long *)addr, size, off)
/* Bitmap functions for the minix filesystem. */
#define minix_test_and_set_bit(nr,addr) \
diff --git a/arch/s390/include/asm/bitops.h b/arch/s390/include/asm/bitops.h
index 5d14515..2ac6819 100644
--- a/arch/s390/include/asm/bitops.h
+++ b/arch/s390/include/asm/bitops.h
@@ -837,25 +837,10 @@ static inline int find_next_le_bit(void *vaddr, unsigned long size,
return offset + find_first_le_bit(p, size);
}
-#define ext2_set_bit(nr, addr) \
- __test_and_set_le_bit((nr), (unsigned long *)(addr))
#define ext2_set_bit_atomic(lock, nr, addr) \
test_and_set_le_bit((nr), (unsigned long *)(addr))
-#define ext2_clear_bit(nr, addr) \
- __test_and_clear_le_bit((nr), (unsigned long *)(addr))
#define ext2_clear_bit_atomic(lock, nr, addr) \
test_and_clear_le_bit((nr), (unsigned long *)(addr))
-#define ext2_test_bit(nr, addr) \
- test_le_bit((nr), (unsigned long *)(addr))
-
-#define ext2_find_first_zero_bit(vaddr, size) \
- find_first_zero_le_bit((unsigned long *)(vaddr), (size))
-#define ext2_find_next_zero_bit(vaddr, size, offset) \
- find_next_zero_le_bit((unsigned long *)(vaddr), (size), (offset))
-#define ext2_find_first_bit(vaddr, size) \
- find_first_le_bit((unsigned long *)(vaddr), (size))
-#define ext2_find_next_bit(vaddr, size, offset) \
- find_next_le_bit((unsigned long *)(vaddr), (size), (offset))
#include <asm-generic/bitops/minix.h>
diff --git a/arch/sh/include/asm/bitops.h b/arch/sh/include/asm/bitops.h
index 9167810..fc5cd5b 100644
--- a/arch/sh/include/asm/bitops.h
+++ b/arch/sh/include/asm/bitops.h
@@ -95,7 +95,6 @@ static inline unsigned long ffz(unsigned long word)
#include <asm-generic/bitops/lock.h>
#include <asm-generic/bitops/sched.h>
#include <asm-generic/bitops/le.h>
-#include <asm-generic/bitops/ext2-non-atomic.h>
#include <asm-generic/bitops/ext2-atomic.h>
#include <asm-generic/bitops/minix.h>
#include <asm-generic/bitops/fls.h>
diff --git a/arch/sparc/include/asm/bitops_32.h b/arch/sparc/include/asm/bitops_32.h
index 5b3ab06..75da6f8 100644
--- a/arch/sparc/include/asm/bitops_32.h
+++ b/arch/sparc/include/asm/bitops_32.h
@@ -104,7 +104,6 @@ static inline void change_bit(unsigned long nr, volatile unsigned long *addr)
#include <asm-generic/bitops/lock.h>
#include <asm-generic/bitops/find.h>
#include <asm-generic/bitops/le.h>
-#include <asm-generic/bitops/ext2-non-atomic.h>
#include <asm-generic/bitops/ext2-atomic.h>
#include <asm-generic/bitops/minix.h>
diff --git a/arch/sparc/include/asm/bitops_64.h b/arch/sparc/include/asm/bitops_64.h
index 9097862..66db28e 100644
--- a/arch/sparc/include/asm/bitops_64.h
+++ b/arch/sparc/include/asm/bitops_64.h
@@ -90,7 +90,6 @@ static inline unsigned int __arch_hweight8(unsigned int w)
#ifdef __KERNEL__
#include <asm-generic/bitops/le.h>
-#include <asm-generic/bitops/ext2-non-atomic.h>
#define ext2_set_bit_atomic(lock,nr,addr) \
test_and_set_bit((nr) ^ 0x38,(unsigned long *)(addr))
diff --git a/arch/tile/include/asm/bitops.h b/arch/tile/include/asm/bitops.h
index 56b0355..5447add 100644
--- a/arch/tile/include/asm/bitops.h
+++ b/arch/tile/include/asm/bitops.h
@@ -123,7 +123,6 @@ static inline unsigned long __arch_hweight64(__u64 w)
#include <asm-generic/bitops/find.h>
#include <asm-generic/bitops/sched.h>
#include <asm-generic/bitops/le.h>
-#include <asm-generic/bitops/ext2-non-atomic.h>
#include <asm-generic/bitops/minix.h>
#endif /* _ASM_TILE_BITOPS_H */
diff --git a/arch/x86/include/asm/bitops.h b/arch/x86/include/asm/bitops.h
index c68bc10..3c95e07 100644
--- a/arch/x86/include/asm/bitops.h
+++ b/arch/x86/include/asm/bitops.h
@@ -457,7 +457,6 @@ static inline int fls(int x)
#ifdef __KERNEL__
#include <asm-generic/bitops/le.h>
-#include <asm-generic/bitops/ext2-non-atomic.h>
#define ext2_set_bit_atomic(lock, nr, addr) \
test_and_set_bit((nr), (unsigned long *)(addr))
diff --git a/arch/xtensa/include/asm/bitops.h b/arch/xtensa/include/asm/bitops.h
index 0475c11..a56b7b5 100644
--- a/arch/xtensa/include/asm/bitops.h
+++ b/arch/xtensa/include/asm/bitops.h
@@ -107,7 +107,6 @@ static inline unsigned long __fls(unsigned long word)
#include <asm-generic/bitops/fls64.h>
#include <asm-generic/bitops/find.h>
#include <asm-generic/bitops/le.h>
-#include <asm-generic/bitops/ext2-non-atomic.h>
#ifdef __XTENSA_EL__
# define ext2_set_bit_atomic(lock,nr,addr) \
diff --git a/include/asm-generic/bitops.h b/include/asm-generic/bitops.h
index 933710b..dd7c014 100644
--- a/include/asm-generic/bitops.h
+++ b/include/asm-generic/bitops.h
@@ -39,7 +39,6 @@
#include <asm-generic/bitops/atomic.h>
#include <asm-generic/bitops/non-atomic.h>
#include <asm-generic/bitops/le.h>
-#include <asm-generic/bitops/ext2-non-atomic.h>
#include <asm-generic/bitops/ext2-atomic.h>
#include <asm-generic/bitops/minix.h>
diff --git a/include/asm-generic/bitops/ext2-non-atomic.h b/include/asm-generic/bitops/ext2-non-atomic.h
deleted file mode 100644
index c4639dd..0000000
--- a/include/asm-generic/bitops/ext2-non-atomic.h
+++ /dev/null
@@ -1,18 +0,0 @@
-#ifndef _ASM_GENERIC_BITOPS_EXT2_NON_ATOMIC_H_
-#define _ASM_GENERIC_BITOPS_EXT2_NON_ATOMIC_H_
-
-#define ext2_set_bit(nr,addr) \
- __test_and_set_le_bit((nr), (unsigned long *)(addr))
-#define ext2_clear_bit(nr,addr) \
- __test_and_clear_le_bit((nr), (unsigned long *)(addr))
-
-#define ext2_test_bit(nr,addr) \
- test_le_bit((nr), (unsigned long *)(addr))
-#define ext2_find_first_zero_bit(addr, size) \
- find_first_zero_le_bit((unsigned long *)(addr), (size))
-#define ext2_find_next_zero_bit(addr, size, off) \
- find_next_zero_le_bit((unsigned long *)(addr), (size), (off))
-#define ext2_find_next_bit(addr, size, off) \
- find_next_le_bit((unsigned long *)(addr), (size), (off))
-
-#endif /* _ASM_GENERIC_BITOPS_EXT2_NON_ATOMIC_H_ */
diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h
index 2dfa707..5348177 100644
--- a/include/linux/ext2_fs.h
+++ b/include/linux/ext2_fs.h
@@ -353,6 +353,18 @@ struct ext2_inode {
#define set_opt(o, opt) o |= EXT2_MOUNT_##opt
#define test_opt(sb, opt) (EXT2_SB(sb)->s_mount_opt & \
EXT2_MOUNT_##opt)
+
+#define ext2_set_bit(nr, addr) \
+ __test_and_set_le_bit((nr), (unsigned long *)(addr))
+#define ext2_clear_bit(nr, addr) \
+ __test_and_clear_le_bit((nr), (unsigned long *)(addr))
+#define ext2_test_bit(nr, addr) \
+ test_le_bit((nr), (unsigned long *)(addr))
+#define ext2_find_first_zero_bit(addr, size) \
+ find_first_zero_le_bit((unsigned long *)(addr), (size))
+#define ext2_find_next_zero_bit(addr, size, off) \
+ find_next_zero_le_bit((unsigned long *)(addr), (size), (off))
+
/*
* Maximal mount counts between two filesystem checks
*/
--
1.7.1.231.gd0b16
^ permalink raw reply related [flat|nested] 75+ messages in thread
* [PATCH 20/22] bitops: remove ext2 non-atomic bitops from asm/bitops.h
2010-10-15 9:46 ` [PATCH 20/22] bitops: remove ext2 non-atomic bitops from asm/bitops.h Akinobu Mita
@ 2010-10-15 9:46 ` Akinobu Mita
0 siblings, 0 replies; 75+ messages in thread
From: Akinobu Mita @ 2010-10-15 9:46 UTC (permalink / raw)
To: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig,
Andrew Morton
Cc: Akinobu Mita, Jan Kara, linux-ext4
As all ext2 non-atomic bit operations are converted to little endian
bit operations except for fs/ext2/*, this makes them ext2 local macros
using little endian bit operations, and remove them from asm/bitops.h
for all architectures.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Jan Kara <jack@suse.cz>
Cc: linux-ext4@vger.kernel.org
---
arch/alpha/include/asm/bitops.h | 1 -
arch/arm/include/asm/bitops.h | 12 ------------
arch/avr32/include/asm/bitops.h | 1 -
arch/blackfin/include/asm/bitops.h | 1 -
arch/cris/include/asm/bitops.h | 1 -
arch/frv/include/asm/bitops.h | 1 -
arch/h8300/include/asm/bitops.h | 1 -
arch/ia64/include/asm/bitops.h | 1 -
arch/m32r/include/asm/bitops.h | 1 -
arch/m68k/include/asm/bitops_mm.h | 13 -------------
arch/m68k/include/asm/bitops_no.h | 20 --------------------
arch/mips/include/asm/bitops.h | 1 -
arch/mn10300/include/asm/bitops.h | 1 -
arch/parisc/include/asm/bitops.h | 1 -
arch/powerpc/include/asm/bitops.h | 14 --------------
arch/s390/include/asm/bitops.h | 15 ---------------
arch/sh/include/asm/bitops.h | 1 -
arch/sparc/include/asm/bitops_32.h | 1 -
arch/sparc/include/asm/bitops_64.h | 1 -
arch/tile/include/asm/bitops.h | 1 -
arch/x86/include/asm/bitops.h | 1 -
arch/xtensa/include/asm/bitops.h | 1 -
include/asm-generic/bitops.h | 1 -
include/asm-generic/bitops/ext2-non-atomic.h | 18 ------------------
include/linux/ext2_fs.h | 12 ++++++++++++
25 files changed, 12 insertions(+), 110 deletions(-)
delete mode 100644 include/asm-generic/bitops/ext2-non-atomic.h
diff --git a/arch/alpha/include/asm/bitops.h b/arch/alpha/include/asm/bitops.h
index 955fec7..822433a 100644
--- a/arch/alpha/include/asm/bitops.h
+++ b/arch/alpha/include/asm/bitops.h
@@ -455,7 +455,6 @@ sched_find_first_bit(const unsigned long b[2])
}
#include <asm-generic/bitops/le.h>
-#include <asm-generic/bitops/ext2-non-atomic.h>
#define ext2_set_bit_atomic(l,n,a) test_and_set_bit(n,a)
#define ext2_clear_bit_atomic(l,n,a) test_and_clear_bit(n,a)
diff --git a/arch/arm/include/asm/bitops.h b/arch/arm/include/asm/bitops.h
index d8af4af..e656a85 100644
--- a/arch/arm/include/asm/bitops.h
+++ b/arch/arm/include/asm/bitops.h
@@ -327,22 +327,10 @@ static inline int fls(int x)
* Ext2 is defined to use little-endian byte ordering.
* These do not need to be atomic.
*/
-#define ext2_set_bit(nr,p) \
- __test_and_set_le_bit(nr, (unsigned long *)(p))
#define ext2_set_bit_atomic(lock,nr,p) \
test_and_set_le_bit(nr, (unsigned long *)(p))
-#define ext2_clear_bit(nr,p) \
- __test_and_clear_le_bit(nr, (unsigned long *)(p))
#define ext2_clear_bit_atomic(lock,nr,p) \
test_and_clear_le_bit(nr, (unsigned long *)(p))
-#define ext2_test_bit(nr,p) \
- test_le_bit(nr, (unsigned long *)(p))
-#define ext2_find_first_zero_bit(p,sz) \
- find_first_zero_le_bit((unsigned long *)(p), sz)
-#define ext2_find_next_zero_bit(p,sz,off) \
- find_next_zero_le_bit((unsigned long *)(p), sz, off)
-#define ext2_find_next_bit(p, sz, off) \
- find_next_le_bit((unsigned long *)(p), sz, off)
/*
* Minix is defined to use little-endian byte ordering.
diff --git a/arch/avr32/include/asm/bitops.h b/arch/avr32/include/asm/bitops.h
index 1c482fc..73a163a 100644
--- a/arch/avr32/include/asm/bitops.h
+++ b/arch/avr32/include/asm/bitops.h
@@ -300,7 +300,6 @@ static inline int ffs(unsigned long word)
#include <asm-generic/bitops/lock.h>
#include <asm-generic/bitops/le.h>
-#include <asm-generic/bitops/ext2-non-atomic.h>
#include <asm-generic/bitops/ext2-atomic.h>
#include <asm-generic/bitops/minix-le.h>
diff --git a/arch/blackfin/include/asm/bitops.h b/arch/blackfin/include/asm/bitops.h
index 1261078..2c549f7 100644
--- a/arch/blackfin/include/asm/bitops.h
+++ b/arch/blackfin/include/asm/bitops.h
@@ -26,7 +26,6 @@
#include <asm-generic/bitops/lock.h>
#include <asm-generic/bitops/le.h>
-#include <asm-generic/bitops/ext2-non-atomic.h>
#include <asm-generic/bitops/ext2-atomic.h>
#include <asm-generic/bitops/minix.h>
diff --git a/arch/cris/include/asm/bitops.h b/arch/cris/include/asm/bitops.h
index 599ae67..71bea40 100644
--- a/arch/cris/include/asm/bitops.h
+++ b/arch/cris/include/asm/bitops.h
@@ -155,7 +155,6 @@ static inline int test_and_change_bit(int nr, volatile unsigned long *addr)
#include <asm-generic/bitops/lock.h>
#include <asm-generic/bitops/le.h>
-#include <asm-generic/bitops/ext2-non-atomic.h>
#define ext2_set_bit_atomic(l,n,a) test_and_set_bit(n,a)
#define ext2_clear_bit_atomic(l,n,a) test_and_clear_bit(n,a)
diff --git a/arch/frv/include/asm/bitops.h b/arch/frv/include/asm/bitops.h
index 2631917..e3ea644 100644
--- a/arch/frv/include/asm/bitops.h
+++ b/arch/frv/include/asm/bitops.h
@@ -402,7 +402,6 @@ int __ilog2_u64(u64 n)
#include <asm-generic/bitops/lock.h>
#include <asm-generic/bitops/le.h>
-#include <asm-generic/bitops/ext2-non-atomic.h>
#define ext2_set_bit_atomic(lock,nr,addr) test_and_set_bit ((nr) ^ 0x18, (addr))
#define ext2_clear_bit_atomic(lock,nr,addr) test_and_clear_bit((nr) ^ 0x18, (addr))
diff --git a/arch/h8300/include/asm/bitops.h b/arch/h8300/include/asm/bitops.h
index 763094f..23cea66 100644
--- a/arch/h8300/include/asm/bitops.h
+++ b/arch/h8300/include/asm/bitops.h
@@ -201,7 +201,6 @@ static __inline__ unsigned long __ffs(unsigned long word)
#include <asm-generic/bitops/hweight.h>
#include <asm-generic/bitops/lock.h>
#include <asm-generic/bitops/le.h>
-#include <asm-generic/bitops/ext2-non-atomic.h>
#include <asm-generic/bitops/ext2-atomic.h>
#include <asm-generic/bitops/minix.h>
diff --git a/arch/ia64/include/asm/bitops.h b/arch/ia64/include/asm/bitops.h
index 2cde4f0..336984a 100644
--- a/arch/ia64/include/asm/bitops.h
+++ b/arch/ia64/include/asm/bitops.h
@@ -457,7 +457,6 @@ static __inline__ unsigned long __arch_hweight64(unsigned long x)
#ifdef __KERNEL__
#include <asm-generic/bitops/le.h>
-#include <asm-generic/bitops/ext2-non-atomic.h>
#define ext2_set_bit_atomic(l,n,a) test_and_set_bit(n,a)
#define ext2_clear_bit_atomic(l,n,a) test_and_clear_bit(n,a)
diff --git a/arch/m32r/include/asm/bitops.h b/arch/m32r/include/asm/bitops.h
index 681f7e8..cdfb4c8 100644
--- a/arch/m32r/include/asm/bitops.h
+++ b/arch/m32r/include/asm/bitops.h
@@ -267,7 +267,6 @@ static __inline__ int test_and_change_bit(int nr, volatile void * addr)
#ifdef __KERNEL__
#include <asm-generic/bitops/le.h>
-#include <asm-generic/bitops/ext2-non-atomic.h>
#include <asm-generic/bitops/ext2-atomic.h>
#include <asm-generic/bitops/minix.h>
diff --git a/arch/m68k/include/asm/bitops_mm.h b/arch/m68k/include/asm/bitops_mm.h
index 8b3059d..e2cc3be 100644
--- a/arch/m68k/include/asm/bitops_mm.h
+++ b/arch/m68k/include/asm/bitops_mm.h
@@ -467,23 +467,10 @@ static inline unsigned long find_next_le_bit(const unsigned long *addr,
/* Bitmap functions for the ext2 filesystem. */
-#define ext2_set_bit(nr, addr) \
- __test_and_set_le_bit(nr, (unsigned long *)(addr))
#define ext2_set_bit_atomic(lock, nr, addr) \
test_and_set_le_bit(nr, (unsigned long *)(addr))
-#define ext2_clear_bit(nr, addr) \
- __test_and_clear_le_bit(nr, (unsigned long *)(addr))
#define ext2_clear_bit_atomic(lock, nr, addr) \
test_and_clear_le_bit(nr, (unsigned long *)(addr))
-#define ext2_find_next_zero_bit(addr, size, offset) \
- find_next_zero_le_bit((unsigned long *)(addr), size, offset)
-#define ext2_find_next_bit(addr, size, offset) \
- find_next_le_bit((unsigned long *)(addr), size, offset)
-#define ext2_test_bit(nr, vaddr) test_le_bit(nr, vaddr)
-#define ext2_find_first_zero_bit(vaddr, size) \
- find_first_zero_le_bit((unsigned long *)(vaddr), size)
-#define ext2_find_first_bit(vaddr, size) \
- find_first_le_bit((unsigned long *)(vaddr), size)
#endif /* __KERNEL__ */
diff --git a/arch/m68k/include/asm/bitops_no.h b/arch/m68k/include/asm/bitops_no.h
index 9f5eb02..7cabe45 100644
--- a/arch/m68k/include/asm/bitops_no.h
+++ b/arch/m68k/include/asm/bitops_no.h
@@ -332,26 +332,6 @@ found_middle:
return result + ffz(__swab32(tmp));
}
-#define ext2_set_bit(nr, addr) \
- __test_and_set_le_bit(nr, addr)
-
-#define ext2_clear_bit(nr, addr) \
- test_and_clear_le_bit(nr, addr)
-
-#define ext2_test_bit(nr, addr) \
- test_le_bit(nr, addr)
-
-#define ext2_find_first_zero_bit(addr, size) \
- find_first_zero_le_bit(addr, size)
-
-#define ext2_find_next_zero_bit(addr, size, offset) \
- find_next_zero_le_bit(addr, size, offset)
-
-#define ext2_find_next_bit(addr, size, off) \
- find_next_le_bit((unsigned long *)(addr), (size), (off))
-
-#include <asm-generic/bitops/minix.h>
-
#endif /* __KERNEL__ */
#include <asm-generic/bitops/fls.h>
diff --git a/arch/mips/include/asm/bitops.h b/arch/mips/include/asm/bitops.h
index 4795820..07ce5aa 100644
--- a/arch/mips/include/asm/bitops.h
+++ b/arch/mips/include/asm/bitops.h
@@ -705,7 +705,6 @@ static inline int ffs(int word)
#include <asm-generic/bitops/const_hweight.h>
#include <asm-generic/bitops/le.h>
-#include <asm-generic/bitops/ext2-non-atomic.h>
#include <asm-generic/bitops/ext2-atomic.h>
#include <asm-generic/bitops/minix.h>
diff --git a/arch/mn10300/include/asm/bitops.h b/arch/mn10300/include/asm/bitops.h
index 4688c08..e1a9768 100644
--- a/arch/mn10300/include/asm/bitops.h
+++ b/arch/mn10300/include/asm/bitops.h
@@ -234,7 +234,6 @@ int ffs(int x)
test_and_clear_bit((nr), (addr))
#include <asm-generic/bitops/le.h>
-#include <asm-generic/bitops/ext2-non-atomic.h>
#include <asm-generic/bitops/minix-le.h>
#endif /* __KERNEL__ */
diff --git a/arch/parisc/include/asm/bitops.h b/arch/parisc/include/asm/bitops.h
index 4b9e58d..919d7ed 100644
--- a/arch/parisc/include/asm/bitops.h
+++ b/arch/parisc/include/asm/bitops.h
@@ -223,7 +223,6 @@ static __inline__ int fls(int x)
#ifdef __KERNEL__
#include <asm-generic/bitops/le.h>
-#include <asm-generic/bitops/ext2-non-atomic.h>
/* '3' is bits per byte */
#define LE_BYTE_ADDR ((sizeof(unsigned long) - 1) << 3)
diff --git a/arch/powerpc/include/asm/bitops.h b/arch/powerpc/include/asm/bitops.h
index b4f3f84..eb9ce7f 100644
--- a/arch/powerpc/include/asm/bitops.h
+++ b/arch/powerpc/include/asm/bitops.h
@@ -303,25 +303,11 @@ unsigned long find_next_le_bit(const unsigned long *addr,
unsigned long size, unsigned long offset);
/* Bitmap functions for the ext2 filesystem */
-#define ext2_set_bit(nr,addr) \
- __test_and_set_le_bit((nr), (unsigned long*)addr)
-#define ext2_clear_bit(nr, addr) \
- __test_and_clear_le_bit((nr), (unsigned long*)addr)
-
#define ext2_set_bit_atomic(lock, nr, addr) \
test_and_set_le_bit((nr), (unsigned long*)addr)
#define ext2_clear_bit_atomic(lock, nr, addr) \
test_and_clear_le_bit((nr), (unsigned long*)addr)
-#define ext2_test_bit(nr, addr) test_le_bit((nr),(unsigned long*)addr)
-
-#define ext2_find_first_zero_bit(addr, size) \
- find_first_zero_le_bit((unsigned long*)addr, size)
-#define ext2_find_next_zero_bit(addr, size, off) \
- find_next_zero_le_bit((unsigned long *)addr, size, off)
-
-#define ext2_find_next_bit(addr, size, off) \
- find_next_le_bit((unsigned long *)addr, size, off)
/* Bitmap functions for the minix filesystem. */
#define minix_test_and_set_bit(nr,addr) \
diff --git a/arch/s390/include/asm/bitops.h b/arch/s390/include/asm/bitops.h
index 5d14515..2ac6819 100644
--- a/arch/s390/include/asm/bitops.h
+++ b/arch/s390/include/asm/bitops.h
@@ -837,25 +837,10 @@ static inline int find_next_le_bit(void *vaddr, unsigned long size,
return offset + find_first_le_bit(p, size);
}
-#define ext2_set_bit(nr, addr) \
- __test_and_set_le_bit((nr), (unsigned long *)(addr))
#define ext2_set_bit_atomic(lock, nr, addr) \
test_and_set_le_bit((nr), (unsigned long *)(addr))
-#define ext2_clear_bit(nr, addr) \
- __test_and_clear_le_bit((nr), (unsigned long *)(addr))
#define ext2_clear_bit_atomic(lock, nr, addr) \
test_and_clear_le_bit((nr), (unsigned long *)(addr))
-#define ext2_test_bit(nr, addr) \
- test_le_bit((nr), (unsigned long *)(addr))
-
-#define ext2_find_first_zero_bit(vaddr, size) \
- find_first_zero_le_bit((unsigned long *)(vaddr), (size))
-#define ext2_find_next_zero_bit(vaddr, size, offset) \
- find_next_zero_le_bit((unsigned long *)(vaddr), (size), (offset))
-#define ext2_find_first_bit(vaddr, size) \
- find_first_le_bit((unsigned long *)(vaddr), (size))
-#define ext2_find_next_bit(vaddr, size, offset) \
- find_next_le_bit((unsigned long *)(vaddr), (size), (offset))
#include <asm-generic/bitops/minix.h>
diff --git a/arch/sh/include/asm/bitops.h b/arch/sh/include/asm/bitops.h
index 9167810..fc5cd5b 100644
--- a/arch/sh/include/asm/bitops.h
+++ b/arch/sh/include/asm/bitops.h
@@ -95,7 +95,6 @@ static inline unsigned long ffz(unsigned long word)
#include <asm-generic/bitops/lock.h>
#include <asm-generic/bitops/sched.h>
#include <asm-generic/bitops/le.h>
-#include <asm-generic/bitops/ext2-non-atomic.h>
#include <asm-generic/bitops/ext2-atomic.h>
#include <asm-generic/bitops/minix.h>
#include <asm-generic/bitops/fls.h>
diff --git a/arch/sparc/include/asm/bitops_32.h b/arch/sparc/include/asm/bitops_32.h
index 5b3ab06..75da6f8 100644
--- a/arch/sparc/include/asm/bitops_32.h
+++ b/arch/sparc/include/asm/bitops_32.h
@@ -104,7 +104,6 @@ static inline void change_bit(unsigned long nr, volatile unsigned long *addr)
#include <asm-generic/bitops/lock.h>
#include <asm-generic/bitops/find.h>
#include <asm-generic/bitops/le.h>
-#include <asm-generic/bitops/ext2-non-atomic.h>
#include <asm-generic/bitops/ext2-atomic.h>
#include <asm-generic/bitops/minix.h>
diff --git a/arch/sparc/include/asm/bitops_64.h b/arch/sparc/include/asm/bitops_64.h
index 9097862..66db28e 100644
--- a/arch/sparc/include/asm/bitops_64.h
+++ b/arch/sparc/include/asm/bitops_64.h
@@ -90,7 +90,6 @@ static inline unsigned int __arch_hweight8(unsigned int w)
#ifdef __KERNEL__
#include <asm-generic/bitops/le.h>
-#include <asm-generic/bitops/ext2-non-atomic.h>
#define ext2_set_bit_atomic(lock,nr,addr) \
test_and_set_bit((nr) ^ 0x38,(unsigned long *)(addr))
diff --git a/arch/tile/include/asm/bitops.h b/arch/tile/include/asm/bitops.h
index 56b0355..5447add 100644
--- a/arch/tile/include/asm/bitops.h
+++ b/arch/tile/include/asm/bitops.h
@@ -123,7 +123,6 @@ static inline unsigned long __arch_hweight64(__u64 w)
#include <asm-generic/bitops/find.h>
#include <asm-generic/bitops/sched.h>
#include <asm-generic/bitops/le.h>
-#include <asm-generic/bitops/ext2-non-atomic.h>
#include <asm-generic/bitops/minix.h>
#endif /* _ASM_TILE_BITOPS_H */
diff --git a/arch/x86/include/asm/bitops.h b/arch/x86/include/asm/bitops.h
index c68bc10..3c95e07 100644
--- a/arch/x86/include/asm/bitops.h
+++ b/arch/x86/include/asm/bitops.h
@@ -457,7 +457,6 @@ static inline int fls(int x)
#ifdef __KERNEL__
#include <asm-generic/bitops/le.h>
-#include <asm-generic/bitops/ext2-non-atomic.h>
#define ext2_set_bit_atomic(lock, nr, addr) \
test_and_set_bit((nr), (unsigned long *)(addr))
diff --git a/arch/xtensa/include/asm/bitops.h b/arch/xtensa/include/asm/bitops.h
index 0475c11..a56b7b5 100644
--- a/arch/xtensa/include/asm/bitops.h
+++ b/arch/xtensa/include/asm/bitops.h
@@ -107,7 +107,6 @@ static inline unsigned long __fls(unsigned long word)
#include <asm-generic/bitops/fls64.h>
#include <asm-generic/bitops/find.h>
#include <asm-generic/bitops/le.h>
-#include <asm-generic/bitops/ext2-non-atomic.h>
#ifdef __XTENSA_EL__
# define ext2_set_bit_atomic(lock,nr,addr) \
diff --git a/include/asm-generic/bitops.h b/include/asm-generic/bitops.h
index 933710b..dd7c014 100644
--- a/include/asm-generic/bitops.h
+++ b/include/asm-generic/bitops.h
@@ -39,7 +39,6 @@
#include <asm-generic/bitops/atomic.h>
#include <asm-generic/bitops/non-atomic.h>
#include <asm-generic/bitops/le.h>
-#include <asm-generic/bitops/ext2-non-atomic.h>
#include <asm-generic/bitops/ext2-atomic.h>
#include <asm-generic/bitops/minix.h>
diff --git a/include/asm-generic/bitops/ext2-non-atomic.h b/include/asm-generic/bitops/ext2-non-atomic.h
deleted file mode 100644
index c4639dd..0000000
--- a/include/asm-generic/bitops/ext2-non-atomic.h
+++ /dev/null
@@ -1,18 +0,0 @@
-#ifndef _ASM_GENERIC_BITOPS_EXT2_NON_ATOMIC_H_
-#define _ASM_GENERIC_BITOPS_EXT2_NON_ATOMIC_H_
-
-#define ext2_set_bit(nr,addr) \
- __test_and_set_le_bit((nr), (unsigned long *)(addr))
-#define ext2_clear_bit(nr,addr) \
- __test_and_clear_le_bit((nr), (unsigned long *)(addr))
-
-#define ext2_test_bit(nr,addr) \
- test_le_bit((nr), (unsigned long *)(addr))
-#define ext2_find_first_zero_bit(addr, size) \
- find_first_zero_le_bit((unsigned long *)(addr), (size))
-#define ext2_find_next_zero_bit(addr, size, off) \
- find_next_zero_le_bit((unsigned long *)(addr), (size), (off))
-#define ext2_find_next_bit(addr, size, off) \
- find_next_le_bit((unsigned long *)(addr), (size), (off))
-
-#endif /* _ASM_GENERIC_BITOPS_EXT2_NON_ATOMIC_H_ */
diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h
index 2dfa707..5348177 100644
--- a/include/linux/ext2_fs.h
+++ b/include/linux/ext2_fs.h
@@ -353,6 +353,18 @@ struct ext2_inode {
#define set_opt(o, opt) o |= EXT2_MOUNT_##opt
#define test_opt(sb, opt) (EXT2_SB(sb)->s_mount_opt & \
EXT2_MOUNT_##opt)
+
+#define ext2_set_bit(nr, addr) \
+ __test_and_set_le_bit((nr), (unsigned long *)(addr))
+#define ext2_clear_bit(nr, addr) \
+ __test_and_clear_le_bit((nr), (unsigned long *)(addr))
+#define ext2_test_bit(nr, addr) \
+ test_le_bit((nr), (unsigned long *)(addr))
+#define ext2_find_first_zero_bit(addr, size) \
+ find_first_zero_le_bit((unsigned long *)(addr), (size))
+#define ext2_find_next_zero_bit(addr, size, off) \
+ find_next_zero_le_bit((unsigned long *)(addr), (size), (off))
+
/*
* Maximal mount counts between two filesystem checks
*/
--
1.7.1.231.gd0b16
^ permalink raw reply related [flat|nested] 75+ messages in thread
* [PATCH 21/22] m68k: convert minix bitops to use little endian bitops
2010-10-15 9:45 [PATCH 00/22] Introduce little endian bitops Akinobu Mita
` (20 preceding siblings ...)
2010-10-15 9:46 ` [PATCH 20/22] bitops: remove ext2 non-atomic bitops from asm/bitops.h Akinobu Mita
@ 2010-10-15 9:46 ` Akinobu Mita
2010-10-15 9:46 ` Akinobu Mita
2010-10-18 8:58 ` Andreas Schwab
2010-10-15 9:46 ` [PATCH 22/22] bitops: remove minix bitops from asm/bitops.h Akinobu Mita
2010-10-15 11:14 ` [PATCH 00/22] Introduce little endian bitops Arnd Bergmann
23 siblings, 2 replies; 75+ messages in thread
From: Akinobu Mita @ 2010-10-15 9:46 UTC (permalink / raw)
To: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig,
Andrew Morton
Cc: Akinobu Mita, Geert Uytterhoeven, Roman Zippel, linux-m68k
The inode and block bitmap for minix filesystem is little endian
byte order on m68k. This converts them to use little endian bit
operations.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: linux-m68k@lists.linux-m68k.org
---
arch/m68k/include/asm/bitops_mm.h | 38 ++++++++----------------------------
1 files changed, 9 insertions(+), 29 deletions(-)
diff --git a/arch/m68k/include/asm/bitops_mm.h b/arch/m68k/include/asm/bitops_mm.h
index e2cc3be..2451f7f 100644
--- a/arch/m68k/include/asm/bitops_mm.h
+++ b/arch/m68k/include/asm/bitops_mm.h
@@ -327,37 +327,17 @@ static inline int __fls(int x)
/* Bitmap functions for the minix filesystem */
-static inline int minix_find_first_zero_bit(const void *vaddr, unsigned size)
-{
- const unsigned short *p = vaddr, *addr = vaddr;
- int res;
- unsigned short num;
-
- if (!size)
- return 0;
-
- size = (size >> 4) + ((size & 15) > 0);
- while (*p++ == 0xffff)
- {
- if (--size == 0)
- return (p - addr) << 4;
- }
+#define minix_find_first_zero_bit(vaddr, size) \
+ find_first_zero_le_bit(vaddr, (size))
- num = ~*--p;
- __asm__ __volatile__ ("bfffo %1{#16,#16},%0"
- : "=d" (res) : "d" (num & -num));
- return ((p - addr) << 4) + (res ^ 31);
-}
+#define minix_test_and_set_bit(nr, addr) \
+ __test_and_set_le_bit((nr), (unsigned long *)(addr))
+#define minix_set_bit(nr, addr) \
+ __set_le_bit((nr), (unsigned long *)(addr))
+#define minix_test_and_clear_bit(nr, addr) \
+ __test_and_clear_le_bit((nr), (unsigned long *)(addr))
-#define minix_test_and_set_bit(nr, addr) __test_and_set_bit((nr) ^ 16, (unsigned long *)(addr))
-#define minix_set_bit(nr,addr) __set_bit((nr) ^ 16, (unsigned long *)(addr))
-#define minix_test_and_clear_bit(nr, addr) __test_and_clear_bit((nr) ^ 16, (unsigned long *)(addr))
-
-static inline int minix_test_bit(int nr, const void *vaddr)
-{
- const unsigned short *p = vaddr;
- return (p[nr >> 4] & (1U << (nr & 15))) != 0;
-}
+#define minix_test_bit(nr, addr) test_le_bit(nr, addr)
/* Bitmap functions for little endian. */
--
1.7.1.231.gd0b16
^ permalink raw reply related [flat|nested] 75+ messages in thread
* [PATCH 21/22] m68k: convert minix bitops to use little endian bitops
2010-10-15 9:46 ` [PATCH 21/22] m68k: convert minix bitops to use little endian bitops Akinobu Mita
@ 2010-10-15 9:46 ` Akinobu Mita
2010-10-18 8:58 ` Andreas Schwab
1 sibling, 0 replies; 75+ messages in thread
From: Akinobu Mita @ 2010-10-15 9:46 UTC (permalink / raw)
To: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig,
Andrew Morton
Cc: Akinobu Mita, Geert Uytterhoeven, Roman Zippel, linux-m68k
The inode and block bitmap for minix filesystem is little endian
byte order on m68k. This converts them to use little endian bit
operations.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: linux-m68k@lists.linux-m68k.org
---
arch/m68k/include/asm/bitops_mm.h | 38 ++++++++----------------------------
1 files changed, 9 insertions(+), 29 deletions(-)
diff --git a/arch/m68k/include/asm/bitops_mm.h b/arch/m68k/include/asm/bitops_mm.h
index e2cc3be..2451f7f 100644
--- a/arch/m68k/include/asm/bitops_mm.h
+++ b/arch/m68k/include/asm/bitops_mm.h
@@ -327,37 +327,17 @@ static inline int __fls(int x)
/* Bitmap functions for the minix filesystem */
-static inline int minix_find_first_zero_bit(const void *vaddr, unsigned size)
-{
- const unsigned short *p = vaddr, *addr = vaddr;
- int res;
- unsigned short num;
-
- if (!size)
- return 0;
-
- size = (size >> 4) + ((size & 15) > 0);
- while (*p++ == 0xffff)
- {
- if (--size == 0)
- return (p - addr) << 4;
- }
+#define minix_find_first_zero_bit(vaddr, size) \
+ find_first_zero_le_bit(vaddr, (size))
- num = ~*--p;
- __asm__ __volatile__ ("bfffo %1{#16,#16},%0"
- : "=d" (res) : "d" (num & -num));
- return ((p - addr) << 4) + (res ^ 31);
-}
+#define minix_test_and_set_bit(nr, addr) \
+ __test_and_set_le_bit((nr), (unsigned long *)(addr))
+#define minix_set_bit(nr, addr) \
+ __set_le_bit((nr), (unsigned long *)(addr))
+#define minix_test_and_clear_bit(nr, addr) \
+ __test_and_clear_le_bit((nr), (unsigned long *)(addr))
-#define minix_test_and_set_bit(nr, addr) __test_and_set_bit((nr) ^ 16, (unsigned long *)(addr))
-#define minix_set_bit(nr,addr) __set_bit((nr) ^ 16, (unsigned long *)(addr))
-#define minix_test_and_clear_bit(nr, addr) __test_and_clear_bit((nr) ^ 16, (unsigned long *)(addr))
-
-static inline int minix_test_bit(int nr, const void *vaddr)
-{
- const unsigned short *p = vaddr;
- return (p[nr >> 4] & (1U << (nr & 15))) != 0;
-}
+#define minix_test_bit(nr, addr) test_le_bit(nr, addr)
/* Bitmap functions for little endian. */
--
1.7.1.231.gd0b16
^ permalink raw reply related [flat|nested] 75+ messages in thread
* [PATCH 22/22] bitops: remove minix bitops from asm/bitops.h
2010-10-15 9:45 [PATCH 00/22] Introduce little endian bitops Akinobu Mita
` (21 preceding siblings ...)
2010-10-15 9:46 ` [PATCH 21/22] m68k: convert minix bitops to use little endian bitops Akinobu Mita
@ 2010-10-15 9:46 ` Akinobu Mita
2010-10-15 10:53 ` Arnd Bergmann
2010-10-15 11:14 ` [PATCH 00/22] Introduce little endian bitops Arnd Bergmann
23 siblings, 1 reply; 75+ messages in thread
From: Akinobu Mita @ 2010-10-15 9:46 UTC (permalink / raw)
To: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig,
Andrew Morton
Cc: Akinobu Mita
minix bit operations are only used by minix filesystem and useless
by other modules. Because byte order of inode and block bitmap is
defferent on each architectures.
This provides new config option CONFIG_MINIX_FS_LITTLE_ENDIAN and
CONFIG_MINIX_FS_NATIVE_ENDIAN that each architecture selects one of which.
Then we can remove minix bit operations from asm/bitops.h from all
architectures by making them minix filesystem local macros.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
---
arch/Kconfig | 6 +++++
arch/alpha/Kconfig | 1 +
arch/alpha/include/asm/bitops.h | 2 -
arch/arm/Kconfig | 1 +
arch/arm/include/asm/bitops.h | 14 ------------
arch/avr32/Kconfig | 1 +
arch/avr32/include/asm/bitops.h | 1 -
arch/blackfin/Kconfig | 1 +
arch/blackfin/include/asm/bitops.h | 1 -
arch/cris/Kconfig | 1 +
arch/cris/include/asm/bitops.h | 1 -
arch/frv/Kconfig | 1 +
arch/frv/include/asm/bitops.h | 2 -
arch/h8300/Kconfig | 1 +
arch/h8300/include/asm/bitops.h | 1 -
arch/ia64/Kconfig | 1 +
arch/ia64/include/asm/bitops.h | 1 -
arch/m32r/Kconfig | 1 +
arch/m32r/include/asm/bitops.h | 1 -
arch/m68k/Kconfig | 1 +
arch/m68k/include/asm/bitops_mm.h | 14 ------------
arch/m68knommu/Kconfig | 1 +
arch/microblaze/Kconfig | 1 +
arch/mips/Kconfig | 1 +
arch/mips/include/asm/bitops.h | 1 -
arch/mn10300/Kconfig | 1 +
arch/mn10300/include/asm/bitops.h | 1 -
arch/parisc/Kconfig | 1 +
arch/parisc/include/asm/bitops.h | 2 -
arch/powerpc/Kconfig | 1 +
arch/powerpc/include/asm/bitops.h | 14 ------------
arch/s390/Kconfig | 1 +
arch/s390/include/asm/bitops.h | 1 -
arch/score/Kconfig | 3 ++
arch/sh/Kconfig | 1 +
arch/sh/include/asm/bitops.h | 1 -
arch/sparc/Kconfig | 1 +
arch/sparc/include/asm/bitops_32.h | 1 -
arch/sparc/include/asm/bitops_64.h | 2 -
arch/tile/Kconfig | 1 +
arch/tile/include/asm/bitops.h | 1 -
arch/x86/Kconfig | 1 +
arch/x86/include/asm/bitops.h | 2 -
arch/xtensa/Kconfig | 1 +
arch/xtensa/include/asm/bitops.h | 1 -
fs/minix/minix.h | 37 +++++++++++++++++++++++++++++++++
include/asm-generic/bitops.h | 1 -
include/asm-generic/bitops/minix-le.h | 15 -------------
include/asm-generic/bitops/minix.h | 15 -------------
49 files changed, 68 insertions(+), 96 deletions(-)
delete mode 100644 include/asm-generic/bitops/minix-le.h
delete mode 100644 include/asm-generic/bitops/minix.h
diff --git a/arch/Kconfig b/arch/Kconfig
index fe48fc7..c4be275 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -159,3 +159,9 @@ config HAVE_PERF_EVENTS_NMI
to determine how many clock cycles in a given period.
source "kernel/gcov/Kconfig"
+
+config MINIX_FS_NATIVE_ENDIAN
+ bool
+
+config MINIX_FS_LITTLE_ENDIAN
+ bool
diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig
index b9647bb..4b892cc 100644
--- a/arch/alpha/Kconfig
+++ b/arch/alpha/Kconfig
@@ -11,6 +11,7 @@ config ALPHA
select HAVE_SYSCALL_WRAPPERS
select HAVE_PERF_EVENTS
select HAVE_DMA_ATTRS
+ select MINIX_FS_NATIVE_ENDIAN
help
The Alpha is a 64-bit general-purpose processor designed and
marketed by the Digital Equipment Corporation of blessed memory,
diff --git a/arch/alpha/include/asm/bitops.h b/arch/alpha/include/asm/bitops.h
index 822433a..85b8152 100644
--- a/arch/alpha/include/asm/bitops.h
+++ b/arch/alpha/include/asm/bitops.h
@@ -459,8 +459,6 @@ sched_find_first_bit(const unsigned long b[2])
#define ext2_set_bit_atomic(l,n,a) test_and_set_bit(n,a)
#define ext2_clear_bit_atomic(l,n,a) test_and_clear_bit(n,a)
-#include <asm-generic/bitops/minix.h>
-
#endif /* __KERNEL__ */
#endif /* _ALPHA_BITOPS_H */
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 9c26ba7..a1c86d4 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -26,6 +26,7 @@ config ARM
select HAVE_PERF_EVENTS
select PERF_USE_VMALLOC
select HAVE_REGS_AND_STACK_ACCESS_API
+ select MINIX_FS_LITTLE_ENDIAN
help
The ARM series is a line of low-power-consumption RISC chip designs
licensed by ARM Ltd and targeted at embedded applications and
diff --git a/arch/arm/include/asm/bitops.h b/arch/arm/include/asm/bitops.h
index e656a85..559756f 100644
--- a/arch/arm/include/asm/bitops.h
+++ b/arch/arm/include/asm/bitops.h
@@ -332,20 +332,6 @@ static inline int fls(int x)
#define ext2_clear_bit_atomic(lock,nr,p) \
test_and_clear_le_bit(nr, (unsigned long *)(p))
-/*
- * Minix is defined to use little-endian byte ordering.
- * These do not need to be atomic.
- */
-#define minix_set_bit(nr,p) \
- __set_le_bit(nr, (unsigned long *)(p))
-#define minix_test_bit(nr,p) \
- test_le_bit(nr, (unsigned long *)(p))
-#define minix_test_and_set_bit(nr,p) \
- __test_and_set_le_bit(nr, (unsigned long *)(p))
-#define minix_test_and_clear_bit(nr,p) \
- __test_and_clear_le_bit(nr, (unsigned long *)(p))
-#define minix_find_first_zero_bit(p,sz) \
- find_first_zero_le_bit((unsigned long *)(p), sz)
#endif /* __KERNEL__ */
diff --git a/arch/avr32/Kconfig b/arch/avr32/Kconfig
index f515727..0e49785 100644
--- a/arch/avr32/Kconfig
+++ b/arch/avr32/Kconfig
@@ -13,6 +13,7 @@ config AVR32
select HAVE_CLK
select HAVE_OPROFILE
select HAVE_KPROBES
+ select MINIX_FS_LITTLE_ENDIAN
help
AVR32 is a high-performance 32-bit RISC microprocessor core,
designed for cost-sensitive embedded applications, with particular
diff --git a/arch/avr32/include/asm/bitops.h b/arch/avr32/include/asm/bitops.h
index 73a163a..72444d9 100644
--- a/arch/avr32/include/asm/bitops.h
+++ b/arch/avr32/include/asm/bitops.h
@@ -301,6 +301,5 @@ static inline int ffs(unsigned long word)
#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-atomic.h>
-#include <asm-generic/bitops/minix-le.h>
#endif /* __ASM_AVR32_BITOPS_H */
diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig
index 5a3152b..61fc4d5 100644
--- a/arch/blackfin/Kconfig
+++ b/arch/blackfin/Kconfig
@@ -37,6 +37,7 @@ config BLACKFIN
select HAVE_KERNEL_LZO if RAMKERNEL
select HAVE_OPROFILE
select ARCH_WANT_OPTIONAL_GPIOLIB
+ select MINIX_FS_NATIVE_ENDIAN
config GENERIC_CSUM
def_bool y
diff --git a/arch/blackfin/include/asm/bitops.h b/arch/blackfin/include/asm/bitops.h
index 2c549f7..68843fa 100644
--- a/arch/blackfin/include/asm/bitops.h
+++ b/arch/blackfin/include/asm/bitops.h
@@ -27,7 +27,6 @@
#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-atomic.h>
-#include <asm-generic/bitops/minix.h>
#ifndef CONFIG_SMP
#include <linux/irqflags.h>
diff --git a/arch/cris/Kconfig b/arch/cris/Kconfig
index aefe3b1..71380b5 100644
--- a/arch/cris/Kconfig
+++ b/arch/cris/Kconfig
@@ -61,6 +61,7 @@ config CRIS
bool
default y
select HAVE_IDE
+ select MINIX_NATIVE_ENDIAN
config HZ
int
diff --git a/arch/cris/include/asm/bitops.h b/arch/cris/include/asm/bitops.h
index 71bea40..310e0de 100644
--- a/arch/cris/include/asm/bitops.h
+++ b/arch/cris/include/asm/bitops.h
@@ -159,7 +159,6 @@ static inline int test_and_change_bit(int nr, volatile unsigned long *addr)
#define ext2_set_bit_atomic(l,n,a) test_and_set_bit(n,a)
#define ext2_clear_bit_atomic(l,n,a) test_and_clear_bit(n,a)
-#include <asm-generic/bitops/minix.h>
#include <asm-generic/bitops/sched.h>
#endif /* __KERNEL__ */
diff --git a/arch/frv/Kconfig b/arch/frv/Kconfig
index 16399bd..3328e9a 100644
--- a/arch/frv/Kconfig
+++ b/arch/frv/Kconfig
@@ -8,6 +8,7 @@ config FRV
select HAVE_IDE
select HAVE_ARCH_TRACEHOOK
select HAVE_PERF_EVENTS
+ select MINIX_FS_LITTLE_ENDIAN
config ZONE_DMA
bool
diff --git a/arch/frv/include/asm/bitops.h b/arch/frv/include/asm/bitops.h
index e3ea644..a1d00b0 100644
--- a/arch/frv/include/asm/bitops.h
+++ b/arch/frv/include/asm/bitops.h
@@ -406,8 +406,6 @@ int __ilog2_u64(u64 n)
#define ext2_set_bit_atomic(lock,nr,addr) test_and_set_bit ((nr) ^ 0x18, (addr))
#define ext2_clear_bit_atomic(lock,nr,addr) test_and_clear_bit((nr) ^ 0x18, (addr))
-#include <asm-generic/bitops/minix-le.h>
-
#endif /* __KERNEL__ */
#endif /* _ASM_BITOPS_H */
diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig
index 988b6ff..bf9099c 100644
--- a/arch/h8300/Kconfig
+++ b/arch/h8300/Kconfig
@@ -9,6 +9,7 @@ config H8300
bool
default y
select HAVE_IDE
+ select MINIX_FS_NATIVE_ENDIAN
config SYMBOL_PREFIX
string
diff --git a/arch/h8300/include/asm/bitops.h b/arch/h8300/include/asm/bitops.h
index 23cea66..e856c1b 100644
--- a/arch/h8300/include/asm/bitops.h
+++ b/arch/h8300/include/asm/bitops.h
@@ -202,7 +202,6 @@ static __inline__ unsigned long __ffs(unsigned long word)
#include <asm-generic/bitops/lock.h>
#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-atomic.h>
-#include <asm-generic/bitops/minix.h>
#endif /* __KERNEL__ */
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index ba22849..b3649b7 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -29,6 +29,7 @@ config IA64
select HAVE_KVM
select HAVE_ARCH_TRACEHOOK
select HAVE_DMA_API_DEBUG
+ select MINIX_FS_NATIVE_ENDIAN
default y
help
The Itanium Processor Family is Intel's 64-bit successor to
diff --git a/arch/ia64/include/asm/bitops.h b/arch/ia64/include/asm/bitops.h
index 336984a..b76f7e0 100644
--- a/arch/ia64/include/asm/bitops.h
+++ b/arch/ia64/include/asm/bitops.h
@@ -461,7 +461,6 @@ static __inline__ unsigned long __arch_hweight64(unsigned long x)
#define ext2_set_bit_atomic(l,n,a) test_and_set_bit(n,a)
#define ext2_clear_bit_atomic(l,n,a) test_and_clear_bit(n,a)
-#include <asm-generic/bitops/minix.h>
#include <asm-generic/bitops/sched.h>
#endif /* __KERNEL__ */
diff --git a/arch/m32r/Kconfig b/arch/m32r/Kconfig
index 836abbb..078324c 100644
--- a/arch/m32r/Kconfig
+++ b/arch/m32r/Kconfig
@@ -14,6 +14,7 @@ config M32R
select HAVE_KERNEL_GZIP
select HAVE_KERNEL_BZIP2
select HAVE_KERNEL_LZMA
+ select MINIX_FS_NATIVE_ENDIAN
config SBUS
bool
diff --git a/arch/m32r/include/asm/bitops.h b/arch/m32r/include/asm/bitops.h
index cdfb4c8..6300f22 100644
--- a/arch/m32r/include/asm/bitops.h
+++ b/arch/m32r/include/asm/bitops.h
@@ -268,7 +268,6 @@ static __inline__ int test_and_change_bit(int nr, volatile void * addr)
#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-atomic.h>
-#include <asm-generic/bitops/minix.h>
#endif /* __KERNEL__ */
diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig
index 8030e24..5605acc 100644
--- a/arch/m68k/Kconfig
+++ b/arch/m68k/Kconfig
@@ -8,6 +8,7 @@ config M68K
select HAVE_AOUT
select HAVE_IDE
select GENERIC_ATOMIC64
+ select MINIX_FS_LITTLE_ENDIAN
config MMU
bool
diff --git a/arch/m68k/include/asm/bitops_mm.h b/arch/m68k/include/asm/bitops_mm.h
index 2451f7f..7011223 100644
--- a/arch/m68k/include/asm/bitops_mm.h
+++ b/arch/m68k/include/asm/bitops_mm.h
@@ -325,20 +325,6 @@ static inline int __fls(int x)
#include <asm-generic/bitops/hweight.h>
#include <asm-generic/bitops/lock.h>
-/* Bitmap functions for the minix filesystem */
-
-#define minix_find_first_zero_bit(vaddr, size) \
- find_first_zero_le_bit(vaddr, (size))
-
-#define minix_test_and_set_bit(nr, addr) \
- __test_and_set_le_bit((nr), (unsigned long *)(addr))
-#define minix_set_bit(nr, addr) \
- __set_le_bit((nr), (unsigned long *)(addr))
-#define minix_test_and_clear_bit(nr, addr) \
- __test_and_clear_le_bit((nr), (unsigned long *)(addr))
-
-#define minix_test_bit(nr, addr) test_le_bit(nr, addr)
-
/* Bitmap functions for little endian. */
#define __set_le_bit(nr, addr) \
diff --git a/arch/m68knommu/Kconfig b/arch/m68knommu/Kconfig
index 2609c39..fdd9e4c 100644
--- a/arch/m68knommu/Kconfig
+++ b/arch/m68knommu/Kconfig
@@ -9,6 +9,7 @@ config M68K
bool
default y
select HAVE_IDE
+ select MINIX_NATIVE_ENDIAN
config MMU
bool
diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig
index 692fdfc..1cfbaad 100644
--- a/arch/microblaze/Kconfig
+++ b/arch/microblaze/Kconfig
@@ -20,6 +20,7 @@ config MICROBLAZE
select TRACING_SUPPORT
select OF
select OF_FLATTREE
+ select MINIX_FS_NATIVE_ENDIAN
config SWAP
def_bool n
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 5526faa..e64530c 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -14,6 +14,7 @@ config MIPS
select HAVE_KRETPROBES
select RTC_LIB if !MACH_LOONGSON
select GENERIC_ATOMIC64 if !64BIT
+ select MINIX_FS_NATIVE_ENDIAN
mainmenu "Linux/MIPS Kernel Configuration"
diff --git a/arch/mips/include/asm/bitops.h b/arch/mips/include/asm/bitops.h
index 07ce5aa..6a2202c 100644
--- a/arch/mips/include/asm/bitops.h
+++ b/arch/mips/include/asm/bitops.h
@@ -706,7 +706,6 @@ static inline int ffs(int word)
#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-atomic.h>
-#include <asm-generic/bitops/minix.h>
#endif /* __KERNEL__ */
diff --git a/arch/mn10300/Kconfig b/arch/mn10300/Kconfig
index 7c2a2f7..674b503 100644
--- a/arch/mn10300/Kconfig
+++ b/arch/mn10300/Kconfig
@@ -8,6 +8,7 @@ mainmenu "Linux Kernel Configuration"
config MN10300
def_bool y
select HAVE_OPROFILE
+ select MINIX_FS_LITTLE_ENDIAN
config AM33
def_bool y
diff --git a/arch/mn10300/include/asm/bitops.h b/arch/mn10300/include/asm/bitops.h
index e1a9768..94ee844 100644
--- a/arch/mn10300/include/asm/bitops.h
+++ b/arch/mn10300/include/asm/bitops.h
@@ -234,7 +234,6 @@ int ffs(int x)
test_and_clear_bit((nr), (addr))
#include <asm-generic/bitops/le.h>
-#include <asm-generic/bitops/minix-le.h>
#endif /* __KERNEL__ */
#endif /* __ASM_BITOPS_H */
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
index 907417d..99e3164 100644
--- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -18,6 +18,7 @@ config PARISC
select BUG
select HAVE_PERF_EVENTS
select GENERIC_ATOMIC64 if !64BIT
+ select MINIX_FS_LITTLE_ENDIAN
help
The PA-RISC microprocessor is designed by Hewlett-Packard and used
in many of their workstations & servers (HP9000 700 and 800 series,
diff --git a/arch/parisc/include/asm/bitops.h b/arch/parisc/include/asm/bitops.h
index 919d7ed..43c516f 100644
--- a/arch/parisc/include/asm/bitops.h
+++ b/arch/parisc/include/asm/bitops.h
@@ -234,6 +234,4 @@ static __inline__ int fls(int x)
#endif /* __KERNEL__ */
-#include <asm-generic/bitops/minix-le.h>
-
#endif /* _PARISC_BITOPS_H */
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 631e5a0..fe166fe 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -141,6 +141,7 @@ config PPC
select HAVE_PERF_EVENTS
select HAVE_REGS_AND_STACK_ACCESS_API
select HAVE_HW_BREAKPOINT if PERF_EVENTS && PPC_BOOK3S_64
+ select MINIX_FS_LITTLE_ENDIAN
config EARLY_PRINTK
bool
diff --git a/arch/powerpc/include/asm/bitops.h b/arch/powerpc/include/asm/bitops.h
index eb9ce7f..bf5ccfc 100644
--- a/arch/powerpc/include/asm/bitops.h
+++ b/arch/powerpc/include/asm/bitops.h
@@ -308,20 +308,6 @@ unsigned long find_next_le_bit(const unsigned long *addr,
#define ext2_clear_bit_atomic(lock, nr, addr) \
test_and_clear_le_bit((nr), (unsigned long*)addr)
-/* Bitmap functions for the minix filesystem. */
-
-#define minix_test_and_set_bit(nr,addr) \
- __test_and_set_le_bit(nr, (unsigned long *)addr)
-#define minix_set_bit(nr,addr) \
- __set_le_bit(nr, (unsigned long *)addr)
-#define minix_test_and_clear_bit(nr,addr) \
- __test_and_clear_le_bit(nr, (unsigned long *)addr)
-#define minix_test_bit(nr,addr) \
- test_le_bit(nr, (unsigned long *)addr)
-
-#define minix_find_first_zero_bit(addr,size) \
- find_first_zero_le_bit((unsigned long *)addr, size)
-
#include <asm-generic/bitops/sched.h>
#endif /* __KERNEL__ */
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index f0777a4..1fbb039 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -128,6 +128,7 @@ config S390
select ARCH_INLINE_WRITE_UNLOCK_BH
select ARCH_INLINE_WRITE_UNLOCK_IRQ
select ARCH_INLINE_WRITE_UNLOCK_IRQRESTORE
+ select MINIX_FS_NATIVE_ENDIAN
config SCHED_OMIT_FRAME_POINTER
bool
diff --git a/arch/s390/include/asm/bitops.h b/arch/s390/include/asm/bitops.h
index 2ac6819..7f3ec8e 100644
--- a/arch/s390/include/asm/bitops.h
+++ b/arch/s390/include/asm/bitops.h
@@ -842,7 +842,6 @@ static inline int find_next_le_bit(void *vaddr, unsigned long size,
#define ext2_clear_bit_atomic(lock, nr, addr) \
test_and_clear_le_bit((nr), (unsigned long *)(addr))
-#include <asm-generic/bitops/minix.h>
#endif /* __KERNEL__ */
diff --git a/arch/score/Kconfig b/arch/score/Kconfig
index be4a155..42bd444 100644
--- a/arch/score/Kconfig
+++ b/arch/score/Kconfig
@@ -64,6 +64,9 @@ config GENERIC_HARDIRQS_NO__DO_IRQ
config GENERIC_SYSCALL_TABLE
def_bool y
+config MINIX_FS_NATIVE_ENDIAN
+ def_bool y
+
config SCORE_L1_CACHE_SHIFT
int
default "4"
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index 33990fa..04e4f7a 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -25,6 +25,7 @@ config SUPERH
select HAVE_SYSCALL_TRACEPOINTS
select RTC_LIB
select GENERIC_ATOMIC64
+ select MINIX_FS_NATIVE_ENDIAN
help
The SuperH is a RISC processor targeted for use in embedded systems
and consumer electronics; it was also used in the Sega Dreamcast
diff --git a/arch/sh/include/asm/bitops.h b/arch/sh/include/asm/bitops.h
index fc5cd5b..90fa3e4 100644
--- a/arch/sh/include/asm/bitops.h
+++ b/arch/sh/include/asm/bitops.h
@@ -96,7 +96,6 @@ static inline unsigned long ffz(unsigned long word)
#include <asm-generic/bitops/sched.h>
#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-atomic.h>
-#include <asm-generic/bitops/minix.h>
#include <asm-generic/bitops/fls.h>
#include <asm-generic/bitops/__fls.h>
#include <asm-generic/bitops/fls64.h>
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index 491e9d6..6a9ceff 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -30,6 +30,7 @@ config SPARC
select PERF_USE_VMALLOC
select HAVE_DMA_ATTRS
select HAVE_DMA_API_DEBUG
+ select MINIX_FS_NATIVE_ENDIAN
config SPARC32
def_bool !64BIT
diff --git a/arch/sparc/include/asm/bitops_32.h b/arch/sparc/include/asm/bitops_32.h
index 75da6f8..25a6766 100644
--- a/arch/sparc/include/asm/bitops_32.h
+++ b/arch/sparc/include/asm/bitops_32.h
@@ -105,7 +105,6 @@ static inline void change_bit(unsigned long nr, volatile unsigned long *addr)
#include <asm-generic/bitops/find.h>
#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-atomic.h>
-#include <asm-generic/bitops/minix.h>
#endif /* __KERNEL__ */
diff --git a/arch/sparc/include/asm/bitops_64.h b/arch/sparc/include/asm/bitops_64.h
index 66db28e..38e9aa1 100644
--- a/arch/sparc/include/asm/bitops_64.h
+++ b/arch/sparc/include/asm/bitops_64.h
@@ -96,8 +96,6 @@ static inline unsigned int __arch_hweight8(unsigned int w)
#define ext2_clear_bit_atomic(lock,nr,addr) \
test_and_clear_bit((nr) ^ 0x38,(unsigned long *)(addr))
-#include <asm-generic/bitops/minix.h>
-
#endif /* __KERNEL__ */
#endif /* defined(_SPARC64_BITOPS_H) */
diff --git a/arch/tile/Kconfig b/arch/tile/Kconfig
index 1eb308c..f05edeb 100644
--- a/arch/tile/Kconfig
+++ b/arch/tile/Kconfig
@@ -100,6 +100,7 @@ config TILE
select GENERIC_FIND_NEXT_BIT
select USE_GENERIC_SMP_HELPERS
select CC_OPTIMIZE_FOR_SIZE
+ select MINIX_FS_NATIVE_ENDIAN
# FIXME: investigate whether we need/want these options.
# select HAVE_IOREMAP_PROT
diff --git a/arch/tile/include/asm/bitops.h b/arch/tile/include/asm/bitops.h
index 5447add..132e6bb 100644
--- a/arch/tile/include/asm/bitops.h
+++ b/arch/tile/include/asm/bitops.h
@@ -123,6 +123,5 @@ static inline unsigned long __arch_hweight64(__u64 w)
#include <asm-generic/bitops/find.h>
#include <asm-generic/bitops/sched.h>
#include <asm-generic/bitops/le.h>
-#include <asm-generic/bitops/minix.h>
#endif /* _ASM_TILE_BITOPS_H */
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index cea0cd9..3a8c961 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -59,6 +59,7 @@ config X86
select ANON_INODES
select HAVE_ARCH_KMEMCHECK
select HAVE_USER_RETURN_NOTIFIER
+ select MINIX_FS_NATIVE_ENDIAN
config INSTRUCTION_DECODER
def_bool (KPROBES || PERF_EVENTS)
diff --git a/arch/x86/include/asm/bitops.h b/arch/x86/include/asm/bitops.h
index 3c95e07..69d5813 100644
--- a/arch/x86/include/asm/bitops.h
+++ b/arch/x86/include/asm/bitops.h
@@ -463,7 +463,5 @@ static inline int fls(int x)
#define ext2_clear_bit_atomic(lock, nr, addr) \
test_and_clear_bit((nr), (unsigned long *)(addr))
-#include <asm-generic/bitops/minix.h>
-
#endif /* __KERNEL__ */
#endif /* _ASM_X86_BITOPS_H */
diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig
index 0859bfd..ed7dd53 100644
--- a/arch/xtensa/Kconfig
+++ b/arch/xtensa/Kconfig
@@ -12,6 +12,7 @@ config ZONE_DMA
config XTENSA
def_bool y
select HAVE_IDE
+ select MINIX_FS_NATIVE_ENDIAN
help
Xtensa processors are 32-bit RISC machines designed by Tensilica
primarily for embedded systems. These processors are both
diff --git a/arch/xtensa/include/asm/bitops.h b/arch/xtensa/include/asm/bitops.h
index a56b7b5..c8fac8d 100644
--- a/arch/xtensa/include/asm/bitops.h
+++ b/arch/xtensa/include/asm/bitops.h
@@ -125,7 +125,6 @@ static inline unsigned long __fls(unsigned long word)
#include <asm-generic/bitops/hweight.h>
#include <asm-generic/bitops/lock.h>
#include <asm-generic/bitops/sched.h>
-#include <asm-generic/bitops/minix.h>
#endif /* __KERNEL__ */
diff --git a/fs/minix/minix.h b/fs/minix/minix.h
index 407b1c8..41c1bba 100644
--- a/fs/minix/minix.h
+++ b/fs/minix/minix.h
@@ -88,4 +88,41 @@ static inline struct minix_inode_info *minix_i(struct inode *inode)
return list_entry(inode, struct minix_inode_info, vfs_inode);
}
+#if defined(CONFIG_MINIX_FS_NATIVE_ENDIAN) && \
+ defined(CONFIG_MINIX_FS_LITTLE_ENDIAN)
+
+#error Minix file system byte order broken
+
+#elif defined(CONFIG_MINIX_FS_NATIVE_ENDIAN)
+
+#define minix_test_and_set_bit(nr, addr) \
+ __test_and_set_bit((nr), (unsigned long *)(addr))
+#define minix_set_bit(nr, addr) \
+ __set_bit((nr), (unsigned long *)(addr))
+#define minix_test_and_clear_bit(nr, addr) \
+ __test_and_clear_bit((nr), (unsigned long *)(addr))
+#define minix_test_bit(nr, addr) \
+ test_bit((nr), (unsigned long *)(addr))
+#define minix_find_first_zero_bit(addr, size) \
+ find_first_zero_bit((unsigned long *)(addr), (size))
+
+#elif defined(CONFIG_MINIX_FS_LITTLE_ENDIAN)
+
+#define minix_test_and_set_bit(nr, addr) \
+ __test_and_set_le_bit((nr), (unsigned long *)(addr))
+#define minix_set_bit(nr, addr) \
+ __set_le_bit((nr), (unsigned long *)(addr))
+#define minix_test_and_clear_bit(nr, addr) \
+ __test_and_clear_le_bit((nr), (unsigned long *)(addr))
+#define minix_test_bit(nr, addr) \
+ test_le_bit((nr), (unsigned long *)(addr))
+#define minix_find_first_zero_bit(addr, size) \
+ find_first_zero_le_bit((unsigned long *)(addr), (size))
+
+#else
+
+#error Minix file system byte order undefined
+
+#endif
+
#endif /* FS_MINIX_H */
diff --git a/include/asm-generic/bitops.h b/include/asm-generic/bitops.h
index dd7c014..280ca7a 100644
--- a/include/asm-generic/bitops.h
+++ b/include/asm-generic/bitops.h
@@ -40,6 +40,5 @@
#include <asm-generic/bitops/non-atomic.h>
#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-atomic.h>
-#include <asm-generic/bitops/minix.h>
#endif /* __ASM_GENERIC_BITOPS_H */
diff --git a/include/asm-generic/bitops/minix-le.h b/include/asm-generic/bitops/minix-le.h
deleted file mode 100644
index f366cfa..0000000
--- a/include/asm-generic/bitops/minix-le.h
+++ /dev/null
@@ -1,15 +0,0 @@
-#ifndef _ASM_GENERIC_BITOPS_MINIX_LE_H_
-#define _ASM_GENERIC_BITOPS_MINIX_LE_H_
-
-#define minix_test_and_set_bit(nr,addr) \
- __test_and_set_le_bit((nr), (unsigned long *)(addr))
-#define minix_set_bit(nr,addr) \
- __set_le_bit((nr), (unsigned long *)(addr))
-#define minix_test_and_clear_bit(nr,addr) \
- __test_and_clear_le_bit((nr), (unsigned long *)(addr))
-#define minix_test_bit(nr,addr) \
- test_le_bit((nr), (unsigned long *)(addr))
-#define minix_find_first_zero_bit(addr,size) \
- find_first_zero_le_bit((unsigned long *)(addr), (size))
-
-#endif /* _ASM_GENERIC_BITOPS_MINIX_LE_H_ */
diff --git a/include/asm-generic/bitops/minix.h b/include/asm-generic/bitops/minix.h
deleted file mode 100644
index 91f42e8..0000000
--- a/include/asm-generic/bitops/minix.h
+++ /dev/null
@@ -1,15 +0,0 @@
-#ifndef _ASM_GENERIC_BITOPS_MINIX_H_
-#define _ASM_GENERIC_BITOPS_MINIX_H_
-
-#define minix_test_and_set_bit(nr,addr) \
- __test_and_set_bit((nr),(unsigned long *)(addr))
-#define minix_set_bit(nr,addr) \
- __set_bit((nr),(unsigned long *)(addr))
-#define minix_test_and_clear_bit(nr,addr) \
- __test_and_clear_bit((nr),(unsigned long *)(addr))
-#define minix_test_bit(nr,addr) \
- test_bit((nr),(unsigned long *)(addr))
-#define minix_find_first_zero_bit(addr,size) \
- find_first_zero_bit((unsigned long *)(addr),(size))
-
-#endif /* _ASM_GENERIC_BITOPS_MINIX_H_ */
--
1.7.1.231.gd0b16
^ permalink raw reply related [flat|nested] 75+ messages in thread
* Re: [PATCH 22/22] bitops: remove minix bitops from asm/bitops.h
2010-10-15 9:46 ` [PATCH 22/22] bitops: remove minix bitops from asm/bitops.h Akinobu Mita
@ 2010-10-15 10:53 ` Arnd Bergmann
2010-10-15 18:53 ` Mike Frysinger
2010-10-16 7:59 ` Geert Uytterhoeven
0 siblings, 2 replies; 75+ messages in thread
From: Arnd Bergmann @ 2010-10-15 10:53 UTC (permalink / raw)
To: Akinobu Mita; +Cc: linux-kernel, linux-arch, Christoph Hellwig, Andrew Morton
On Friday 15 October 2010, Akinobu Mita wrote:
> minix bit operations are only used by minix filesystem and useless
> by other modules.
Right.
> This provides new config option CONFIG_MINIX_FS_LITTLE_ENDIAN and
> CONFIG_MINIX_FS_NATIVE_ENDIAN that each architecture selects one of which.
> Then we can remove minix bit operations from asm/bitops.h from all
> architectures by making them minix filesystem local macros.
I would say that any architecture that defines minix bitops as
little-endian is broken and we should not even need the #define.
You have defined these as "native endian":
always LE:
alpha, blackfin, ia64, score, tile, x86
always BE:
h8300, microblaze, s390, sparc
configurable:
m32r, mips, sh, xtensa
The only ones among these that possibly ever cared about mounting minix
file systems on a big-endian kernel are really old sparc and mips systems,
everyone else probably never noticed their mistake.
I'd say let's define the minix bitops as always LE and be done with it.
Arnd
^ permalink raw reply [flat|nested] 75+ messages in thread
* Re: [PATCH 10/22] asm-generic: use little endian bitops
2010-10-15 9:46 ` [PATCH 10/22] asm-generic: use little endian bitops Akinobu Mita
@ 2010-10-15 11:06 ` Arnd Bergmann
0 siblings, 0 replies; 75+ messages in thread
From: Arnd Bergmann @ 2010-10-15 11:06 UTC (permalink / raw)
To: Akinobu Mita; +Cc: linux-kernel, linux-arch, Christoph Hellwig, Andrew Morton
On Friday 15 October 2010, Akinobu Mita wrote:
> As a preparation for removing ext2 non-atomic bit operations from
> asm/bitops.h. This converts ext2 non-atomic bit operations to
> little endian bit operations.
>
> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
^ permalink raw reply [flat|nested] 75+ messages in thread
* Re: [PATCH 03/22] s390: introduce little endian bitops
2010-10-15 9:46 ` [PATCH 03/22] s390: introduce little endian bitops Akinobu Mita
2010-10-15 9:46 ` Akinobu Mita
@ 2010-10-15 11:12 ` Arnd Bergmann
2010-10-18 4:51 ` Akinobu Mita
1 sibling, 1 reply; 75+ messages in thread
From: Arnd Bergmann @ 2010-10-15 11:12 UTC (permalink / raw)
To: Akinobu Mita
Cc: linux-kernel, linux-arch, Christoph Hellwig, Andrew Morton,
Martin Schwidefsky, Heiko Carstens, linux390, linux-s390
On Friday 15 October 2010, Akinobu Mita wrote:
> +#define __set_le_bit(nr, addr) \
> + __set_bit((nr)^(__BITOPS_WORDSIZE - 8), (addr))
> +#define __clear_le_bit(nr, addr) \
> + __clear_bit((nr)^(__BITOPS_WORDSIZE - 8), (addr))
> +#define __test_and_set_le_bit(nr, addr) \
> + __test_and_set_bit((nr)^(__BITOPS_WORDSIZE - 8), (addr))
> +#define test_and_set_le_bit(lock, nr, addr) \
> + test_and_set_bit((nr)^(__BITOPS_WORDSIZE - 8), (addr))
> +#define __test_and_clear_le_bit(nr, addr) \
> + __test_and_clear_bit((nr)^(__BITOPS_WORDSIZE - 8), (addr))
> +#define test_and_clear_le_bit(lock, nr, addr) \
> + test_and_clear_bit((nr)^(__BITOPS_WORDSIZE - 8), (addr))
> +#define test_le_bit(nr, addr) \
> + test_bit((nr)^(__BITOPS_WORDSIZE - 8), (addr))
The test_and_clear_le_bit and test_and_set_le_bit calling conventions
are a little surprising here. I would not pass the lock argument
here but leave that to the ext2 wrapper:
#define test_and_set_le_bit(nr, addr) \
test_and_set_bit((nr)^(__BITOPS_WORDSIZE - 8), (addr))
#define test_and_clear_le_bit(nr, addr) \
test_and_clear_bit((nr)^(__BITOPS_WORDSIZE - 8), (addr))
#define ext2_set_bit_atomic(lock, nr, addr) \
test_and_set_le_bit((nr), (unsigned long *)(addr))
#define ext2_clear_bit_atomic(lock, nr, addr) \
test_and_clear_le_bit((nr), (unsigned long *)(addr))
Same thing on arm and m68k.
Arnd
^ permalink raw reply [flat|nested] 75+ messages in thread
* Re: [PATCH 00/22] Introduce little endian bitops
2010-10-15 9:45 [PATCH 00/22] Introduce little endian bitops Akinobu Mita
` (22 preceding siblings ...)
2010-10-15 9:46 ` [PATCH 22/22] bitops: remove minix bitops from asm/bitops.h Akinobu Mita
@ 2010-10-15 11:14 ` Arnd Bergmann
23 siblings, 0 replies; 75+ messages in thread
From: Arnd Bergmann @ 2010-10-15 11:14 UTC (permalink / raw)
To: Akinobu Mita; +Cc: linux-kernel, linux-arch, Christoph Hellwig, Andrew Morton
On Friday 15 October 2010, Akinobu Mita wrote:
>
> This patch series introduces little endian bit operations in asm/bitops.h
> for all architectures and converts ext2 non-atomic and minix bit operation
> to them. it enables to remove ext2 non-atomic and minix bit operations
> from asm/bitops.h. The reason they should be removed from asm/bitops.h
> is as follows:
>
> For ext2 non-atomic bit operations, they are used for little endian byte order
> bitmap access by some filesystems and modules. But using ext2_*() functions on
> a module other than ext2 filesystem makes someone feel strange.
>
> For minix bit operations, they are only used by minix filesystem and useless
> by other modules. Because byte order of inode and block bitmap is defferent
> on each architectures.
Very nice work! I already replied on two issues that I think could be improved,
everything else looks good.
Arnd
^ permalink raw reply [flat|nested] 75+ messages in thread
* Re: [PATCH 22/22] bitops: remove minix bitops from asm/bitops.h
2010-10-15 10:53 ` Arnd Bergmann
@ 2010-10-15 18:53 ` Mike Frysinger
2010-10-15 20:15 ` Arnd Bergmann
2010-10-16 7:59 ` Geert Uytterhoeven
1 sibling, 1 reply; 75+ messages in thread
From: Mike Frysinger @ 2010-10-15 18:53 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Akinobu Mita, linux-kernel, linux-arch, Christoph Hellwig,
Andrew Morton
On Fri, Oct 15, 2010 at 06:53, Arnd Bergmann wrote:
> On Friday 15 October 2010, Akinobu Mita wrote:
>> minix bit operations are only used by minix filesystem and useless
>> by other modules.
>
> Right.
>
>> This provides new config option CONFIG_MINIX_FS_LITTLE_ENDIAN and
>> CONFIG_MINIX_FS_NATIVE_ENDIAN that each architecture selects one of which.
>> Then we can remove minix bit operations from asm/bitops.h from all
>> architectures by making them minix filesystem local macros.
>
> I would say that any architecture that defines minix bitops as
> little-endian is broken and we should not even need the #define.
>
> You have defined these as "native endian":
>
> always LE:
> alpha, blackfin, ia64, score, tile, x86
>
> always BE:
> h8300, microblaze, s390, sparc
>
> configurable:
> m32r, mips, sh, xtensa
>
> The only ones among these that possibly ever cared about mounting minix
> file systems on a big-endian kernel are really old sparc and mips systems,
> everyone else probably never noticed their mistake.
>
> I'd say let's define the minix bitops as always LE and be done with it.
or at least make it so that this is the default, and you only have to
update Kconfig if you need to deviate from the default. i dont like
having to add this minix option to every single arch Kconfig.
-mike
^ permalink raw reply [flat|nested] 75+ messages in thread
* Re: [PATCH 22/22] bitops: remove minix bitops from asm/bitops.h
2010-10-15 18:53 ` Mike Frysinger
@ 2010-10-15 20:15 ` Arnd Bergmann
2010-10-15 20:15 ` Arnd Bergmann
0 siblings, 1 reply; 75+ messages in thread
From: Arnd Bergmann @ 2010-10-15 20:15 UTC (permalink / raw)
To: Mike Frysinger
Cc: Akinobu Mita, linux-kernel, linux-arch, Christoph Hellwig,
Andrew Morton
On Friday 15 October 2010 20:53:16 Mike Frysinger wrote:
> > You have defined these as "native endian":
> >
> > always LE:
> > alpha, blackfin, ia64, score, tile, x86
> >
> > always BE:
> > h8300, microblaze, s390, sparc
> >
> > configurable:
> > m32r, mips, sh, xtensa
> >
> > The only ones among these that possibly ever cared about mounting minix
> > file systems on a big-endian kernel are really old sparc and mips systems,
> > everyone else probably never noticed their mistake.
> >
> > I'd say let's define the minix bitops as always LE and be done with it.
>
> or at least make it so that this is the default, and you only have to
> update Kconfig if you need to deviate from the default. i dont like
> having to add this minix option to every single arch Kconfig.
Yes, that would also work if we find a compelling reason to keep it that
way. You can actually keep it private to fs/minix/Kconfig by writing it
as
config MINIX_FS_NATIVE_ENDIAN
def_bool y
depends on H8300 || M32R || MICROBLAZE || MIPS || S390 || SUPERH || SPARC || XTENSA
We normally use select for arch specific options, but in this case I think
I would prefer the single option since we know we don't want new architectures
to do it too.
Arnd
^ permalink raw reply [flat|nested] 75+ messages in thread
* Re: [PATCH 22/22] bitops: remove minix bitops from asm/bitops.h
2010-10-15 20:15 ` Arnd Bergmann
@ 2010-10-15 20:15 ` Arnd Bergmann
0 siblings, 0 replies; 75+ messages in thread
From: Arnd Bergmann @ 2010-10-15 20:15 UTC (permalink / raw)
To: Mike Frysinger
Cc: Akinobu Mita, linux-kernel, linux-arch, Christoph Hellwig,
Andrew Morton
On Friday 15 October 2010 20:53:16 Mike Frysinger wrote:
> > You have defined these as "native endian":
> >
> > always LE:
> > alpha, blackfin, ia64, score, tile, x86
> >
> > always BE:
> > h8300, microblaze, s390, sparc
> >
> > configurable:
> > m32r, mips, sh, xtensa
> >
> > The only ones among these that possibly ever cared about mounting minix
> > file systems on a big-endian kernel are really old sparc and mips systems,
> > everyone else probably never noticed their mistake.
> >
> > I'd say let's define the minix bitops as always LE and be done with it.
>
> or at least make it so that this is the default, and you only have to
> update Kconfig if you need to deviate from the default. i dont like
> having to add this minix option to every single arch Kconfig.
Yes, that would also work if we find a compelling reason to keep it that
way. You can actually keep it private to fs/minix/Kconfig by writing it
as
config MINIX_FS_NATIVE_ENDIAN
def_bool y
depends on H8300 || M32R || MICROBLAZE || MIPS || S390 || SUPERH || SPARC || XTENSA
We normally use select for arch specific options, but in this case I think
I would prefer the single option since we know we don't want new architectures
to do it too.
Arnd
^ permalink raw reply [flat|nested] 75+ messages in thread
* Re: [PATCH 22/22] bitops: remove minix bitops from asm/bitops.h
2010-10-15 10:53 ` Arnd Bergmann
2010-10-15 18:53 ` Mike Frysinger
@ 2010-10-16 7:59 ` Geert Uytterhoeven
2010-10-16 7:59 ` Geert Uytterhoeven
2010-10-16 8:50 ` Andreas Schwab
1 sibling, 2 replies; 75+ messages in thread
From: Geert Uytterhoeven @ 2010-10-16 7:59 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Akinobu Mita, linux-kernel, linux-arch, Christoph Hellwig,
Andrew Morton, Linux/m68k
On Fri, Oct 15, 2010 at 12:53, Arnd Bergmann <arnd@arndb.de> wrote:
> On Friday 15 October 2010, Akinobu Mita wrote:
>> minix bit operations are only used by minix filesystem and useless
>> by other modules.
>
> Right.
>
>> This provides new config option CONFIG_MINIX_FS_LITTLE_ENDIAN and
>> CONFIG_MINIX_FS_NATIVE_ENDIAN that each architecture selects one of which.
>> Then we can remove minix bit operations from asm/bitops.h from all
>> architectures by making them minix filesystem local macros.
>
> I would say that any architecture that defines minix bitops as
> little-endian is broken and we should not even need the #define.
>
> You have defined these as "native endian":
>
> always LE:
> alpha, blackfin, ia64, score, tile, x86
>
> always BE:
> h8300, microblaze, s390, sparc
>
> configurable:
> m32r, mips, sh, xtensa
>
> The only ones among these that possibly ever cared about mounting minix
> file systems on a big-endian kernel are really old sparc and mips systems,
> everyone else probably never noticed their mistake.
>
> I'd say let's define the minix bitops as always LE and be done with it.
Funny, m68k uses the little endian minix file system?
Perhaps this was due to minix using the ext2 accessors? And ext2 being
switched from big to little endian ext2 on m68k, without anyone
noticing the impact
on minix?
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 75+ messages in thread
* Re: [PATCH 22/22] bitops: remove minix bitops from asm/bitops.h
2010-10-16 7:59 ` Geert Uytterhoeven
@ 2010-10-16 7:59 ` Geert Uytterhoeven
2010-10-16 8:50 ` Andreas Schwab
1 sibling, 0 replies; 75+ messages in thread
From: Geert Uytterhoeven @ 2010-10-16 7:59 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Akinobu Mita, linux-kernel, linux-arch, Christoph Hellwig,
Andrew Morton, Linux/m68k
On Fri, Oct 15, 2010 at 12:53, Arnd Bergmann <arnd@arndb.de> wrote:
> On Friday 15 October 2010, Akinobu Mita wrote:
>> minix bit operations are only used by minix filesystem and useless
>> by other modules.
>
> Right.
>
>> This provides new config option CONFIG_MINIX_FS_LITTLE_ENDIAN and
>> CONFIG_MINIX_FS_NATIVE_ENDIAN that each architecture selects one of which.
>> Then we can remove minix bit operations from asm/bitops.h from all
>> architectures by making them minix filesystem local macros.
>
> I would say that any architecture that defines minix bitops as
> little-endian is broken and we should not even need the #define.
>
> You have defined these as "native endian":
>
> always LE:
> alpha, blackfin, ia64, score, tile, x86
>
> always BE:
> h8300, microblaze, s390, sparc
>
> configurable:
> m32r, mips, sh, xtensa
>
> The only ones among these that possibly ever cared about mounting minix
> file systems on a big-endian kernel are really old sparc and mips systems,
> everyone else probably never noticed their mistake.
>
> I'd say let's define the minix bitops as always LE and be done with it.
Funny, m68k uses the little endian minix file system?
Perhaps this was due to minix using the ext2 accessors? And ext2 being
switched from big to little endian ext2 on m68k, without anyone
noticing the impact
on minix?
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 75+ messages in thread
* Re: [PATCH 22/22] bitops: remove minix bitops from asm/bitops.h
2010-10-16 7:59 ` Geert Uytterhoeven
2010-10-16 7:59 ` Geert Uytterhoeven
@ 2010-10-16 8:50 ` Andreas Schwab
2010-10-16 11:35 ` Geert Uytterhoeven
1 sibling, 1 reply; 75+ messages in thread
From: Andreas Schwab @ 2010-10-16 8:50 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Arnd Bergmann, Akinobu Mita, linux-kernel, linux-arch,
Christoph Hellwig, Andrew Morton, Linux/m68k
Geert Uytterhoeven <geert@linux-m68k.org> writes:
> Funny, m68k uses the little endian minix file system?
>
> Perhaps this was due to minix using the ext2 accessors? And ext2 being
> switched from big to little endian ext2 on m68k, without anyone
> noticing the impact
> on minix?
m68k has always used big-endian minixfs and the minix bitops were always
independent of the ext2 ones.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 75+ messages in thread
* Re: [PATCH 22/22] bitops: remove minix bitops from asm/bitops.h
2010-10-16 8:50 ` Andreas Schwab
@ 2010-10-16 11:35 ` Geert Uytterhoeven
2010-10-16 12:40 ` Akinobu Mita
0 siblings, 1 reply; 75+ messages in thread
From: Geert Uytterhoeven @ 2010-10-16 11:35 UTC (permalink / raw)
To: Andreas Schwab
Cc: Arnd Bergmann, Akinobu Mita, linux-kernel, linux-arch,
Christoph Hellwig, Andrew Morton, Linux/m68k
On Sat, Oct 16, 2010 at 10:50, Andreas Schwab <schwab@linux-m68k.org> wrote:
> Geert Uytterhoeven <geert@linux-m68k.org> writes:
>
>> Funny, m68k uses the little endian minix file system?
>>
>> Perhaps this was due to minix using the ext2 accessors? And ext2 being
>> switched from big to little endian ext2 on m68k, without anyone
>> noticing the impact
>> on minix?
>
> m68k has always used big-endian minixfs and the minix bitops were always
> independent of the ext2 ones.
Thanks for confirming!
Hence "[PATCH 21/22] m68k: convert minix bitops to use little endian
bitops" is not correct?
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 75+ messages in thread
* Re: [PATCH 22/22] bitops: remove minix bitops from asm/bitops.h
2010-10-16 11:35 ` Geert Uytterhoeven
@ 2010-10-16 12:40 ` Akinobu Mita
2010-10-16 12:57 ` Andreas Schwab
0 siblings, 1 reply; 75+ messages in thread
From: Akinobu Mita @ 2010-10-16 12:40 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Andreas Schwab, Arnd Bergmann, linux-kernel, linux-arch,
Christoph Hellwig, Andrew Morton, Linux/m68k
2010/10/16 Geert Uytterhoeven <geert@linux-m68k.org>:
> On Sat, Oct 16, 2010 at 10:50, Andreas Schwab <schwab@linux-m68k.org> wrote:
>> Geert Uytterhoeven <geert@linux-m68k.org> writes:
>>
>>> Funny, m68k uses the little endian minix file system?
>>>
>>> Perhaps this was due to minix using the ext2 accessors? And ext2 being
>>> switched from big to little endian ext2 on m68k, without anyone
>>> noticing the impact
>>> on minix?
>>
>> m68k has always used big-endian minixfs and the minix bitops were always
>> independent of the ext2 ones.
>
> Thanks for confirming!
m68knommu is big-endian minixfs but m68k (mmu) is little-endian minixfs
if I read arch/m68k/include/asm/bitops_{mm,no}.h correctly.
^ permalink raw reply [flat|nested] 75+ messages in thread
* Re: [PATCH 22/22] bitops: remove minix bitops from asm/bitops.h
2010-10-16 12:40 ` Akinobu Mita
@ 2010-10-16 12:57 ` Andreas Schwab
2010-10-16 12:57 ` Andreas Schwab
2010-10-16 13:47 ` Akinobu Mita
0 siblings, 2 replies; 75+ messages in thread
From: Andreas Schwab @ 2010-10-16 12:57 UTC (permalink / raw)
To: Akinobu Mita
Cc: Geert Uytterhoeven, Arnd Bergmann, linux-kernel, linux-arch,
Christoph Hellwig, Andrew Morton, Linux/m68k
Akinobu Mita <akinobu.mita@gmail.com> writes:
> m68knommu is big-endian minixfs but m68k (mmu) is little-endian minixfs
> if I read arch/m68k/include/asm/bitops_{mm,no}.h correctly.
Don't be confused by ^16, this is for the 16bit/32bit indexing
correction. The nommu version uses big-endian 32bit indexing which yet
another format.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 75+ messages in thread
* Re: [PATCH 22/22] bitops: remove minix bitops from asm/bitops.h
2010-10-16 12:57 ` Andreas Schwab
@ 2010-10-16 12:57 ` Andreas Schwab
2010-10-16 13:47 ` Akinobu Mita
1 sibling, 0 replies; 75+ messages in thread
From: Andreas Schwab @ 2010-10-16 12:57 UTC (permalink / raw)
To: Akinobu Mita
Cc: Geert Uytterhoeven, Arnd Bergmann, linux-kernel, linux-arch,
Christoph Hellwig, Andrew Morton, Linux/m68k
Akinobu Mita <akinobu.mita@gmail.com> writes:
> m68knommu is big-endian minixfs but m68k (mmu) is little-endian minixfs
> if I read arch/m68k/include/asm/bitops_{mm,no}.h correctly.
Don't be confused by ^16, this is for the 16bit/32bit indexing
correction. The nommu version uses big-endian 32bit indexing which yet
another format.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 75+ messages in thread
* Re: [PATCH 22/22] bitops: remove minix bitops from asm/bitops.h
2010-10-16 12:57 ` Andreas Schwab
2010-10-16 12:57 ` Andreas Schwab
@ 2010-10-16 13:47 ` Akinobu Mita
2010-10-16 13:47 ` Akinobu Mita
2010-10-16 15:58 ` Andreas Schwab
1 sibling, 2 replies; 75+ messages in thread
From: Akinobu Mita @ 2010-10-16 13:47 UTC (permalink / raw)
To: Andreas Schwab
Cc: Geert Uytterhoeven, Arnd Bergmann, linux-kernel, linux-arch,
Christoph Hellwig, Andrew Morton, Linux/m68k
2010/10/16 Andreas Schwab <schwab@linux-m68k.org>:
> Akinobu Mita <akinobu.mita@gmail.com> writes:
>
>> m68knommu is big-endian minixfs but m68k (mmu) is little-endian minixfs
>> if I read arch/m68k/include/asm/bitops_{mm,no}.h correctly.
>
> Don't be confused by ^16, this is for the 16bit/32bit indexing
> correction. The nommu version uses big-endian 32bit indexing which yet
> another format.
Oh, I see. I misunderstood.
So we need a special handling for it to keep compatibility.
^ permalink raw reply [flat|nested] 75+ messages in thread
* Re: [PATCH 22/22] bitops: remove minix bitops from asm/bitops.h
2010-10-16 13:47 ` Akinobu Mita
@ 2010-10-16 13:47 ` Akinobu Mita
2010-10-16 15:58 ` Andreas Schwab
1 sibling, 0 replies; 75+ messages in thread
From: Akinobu Mita @ 2010-10-16 13:47 UTC (permalink / raw)
To: Andreas Schwab
Cc: Geert Uytterhoeven, Arnd Bergmann, linux-kernel, linux-arch,
Christoph Hellwig, Andrew Morton, Linux/m68k
2010/10/16 Andreas Schwab <schwab@linux-m68k.org>:
> Akinobu Mita <akinobu.mita@gmail.com> writes:
>
>> m68knommu is big-endian minixfs but m68k (mmu) is little-endian minixfs
>> if I read arch/m68k/include/asm/bitops_{mm,no}.h correctly.
>
> Don't be confused by ^16, this is for the 16bit/32bit indexing
> correction. The nommu version uses big-endian 32bit indexing which yet
> another format.
Oh, I see. I misunderstood.
So we need a special handling for it to keep compatibility.
^ permalink raw reply [flat|nested] 75+ messages in thread
* Re: [PATCH 22/22] bitops: remove minix bitops from asm/bitops.h
2010-10-16 13:47 ` Akinobu Mita
2010-10-16 13:47 ` Akinobu Mita
@ 2010-10-16 15:58 ` Andreas Schwab
2010-10-19 15:05 ` Akinobu Mita
1 sibling, 1 reply; 75+ messages in thread
From: Andreas Schwab @ 2010-10-16 15:58 UTC (permalink / raw)
To: Akinobu Mita
Cc: Geert Uytterhoeven, Arnd Bergmann, linux-kernel, linux-arch,
Christoph Hellwig, Andrew Morton, Linux/m68k
Akinobu Mita <akinobu.mita@gmail.com> writes:
> 2010/10/16 Andreas Schwab <schwab@linux-m68k.org>:
>> Akinobu Mita <akinobu.mita@gmail.com> writes:
>>
>>> m68knommu is big-endian minixfs but m68k (mmu) is little-endian minixfs
>>> if I read arch/m68k/include/asm/bitops_{mm,no}.h correctly.
>>
>> Don't be confused by ^16, this is for the 16bit/32bit indexing
>> correction. The nommu version uses big-endian 32bit indexing which yet
>> another format.
>
> Oh, I see. I misunderstood.
>
> So we need a special handling for it to keep compatibility.
IMHO we only need two versions: big-endian filesystem with big-endian
16bit indexed bitmaps and little-endian filesystem with little-endian
bitmaps. The rest is just the result of careless copying. Note that
the minix filesystem does no byte swapping, so native byte order is the
only sensible mode.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 75+ messages in thread
* Re: [PATCH 18/22] md: use little endian bit operations
2010-10-15 9:46 ` [PATCH 18/22] md: use little endian bit operations Akinobu Mita
@ 2010-10-18 2:41 ` Neil Brown
0 siblings, 0 replies; 75+ messages in thread
From: Neil Brown @ 2010-10-18 2:41 UTC (permalink / raw)
To: Akinobu Mita
Cc: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig,
Andrew Morton, linux-raid
On Fri, 15 Oct 2010 18:46:17 +0900
Akinobu Mita <akinobu.mita@gmail.com> wrote:
> As a preparation for removing ext2 non-atomic bit operations from
> asm/bitops.h. This converts ext2 non-atomic bit operations to
> little endian bit operations.
Looks good, thanks.
Acked-by: NeilBrown <neilb@suse.de>
NeilBrown
>
> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
> Cc: Neil Brown <neilb@suse.de>
> Cc: linux-raid@vger.kernel.org
> ---
> drivers/md/bitmap.c | 6 +++---
> 1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
> index e4fb58d..2a37051 100644
> --- a/drivers/md/bitmap.c
> +++ b/drivers/md/bitmap.c
> @@ -850,7 +850,7 @@ static void bitmap_file_set_bit(struct bitmap *bitmap, sector_t block)
> if (bitmap->flags & BITMAP_HOSTENDIAN)
> set_bit(bit, kaddr);
> else
> - ext2_set_bit(bit, kaddr);
> + __test_and_set_le_bit(bit, kaddr);
> kunmap_atomic(kaddr, KM_USER0);
> PRINTK("set file bit %lu page %lu\n", bit, page->index);
> }
> @@ -1046,7 +1046,7 @@ static int bitmap_init_from_disk(struct bitmap *bitmap, sector_t start)
> if (bitmap->flags & BITMAP_HOSTENDIAN)
> b = test_bit(bit, paddr);
> else
> - b = ext2_test_bit(bit, paddr);
> + b = test_le_bit(bit, paddr);
> kunmap_atomic(paddr, KM_USER0);
> if (b) {
> /* if the disk bit is set, set the memory bit */
> @@ -1222,7 +1222,7 @@ void bitmap_daemon_work(mddev_t *mddev)
> clear_bit(file_page_offset(bitmap, j),
> paddr);
> else
> - ext2_clear_bit(file_page_offset(bitmap, j),
> + __test_and_clear_le_bit(file_page_offset(bitmap, j),
> paddr);
> kunmap_atomic(paddr, KM_USER0);
> } else
^ permalink raw reply [flat|nested] 75+ messages in thread
* Re: [PATCH 03/22] s390: introduce little endian bitops
2010-10-15 11:12 ` Arnd Bergmann
@ 2010-10-18 4:51 ` Akinobu Mita
0 siblings, 0 replies; 75+ messages in thread
From: Akinobu Mita @ 2010-10-18 4:51 UTC (permalink / raw)
To: Arnd Bergmann
Cc: linux-kernel, linux-arch, Christoph Hellwig, Andrew Morton,
Martin Schwidefsky, Heiko Carstens, linux390, linux-s390
2010/10/15 Arnd Bergmann <arnd@arndb.de>:
> On Friday 15 October 2010, Akinobu Mita wrote:
>> +#define __set_le_bit(nr, addr) \
>> + __set_bit((nr)^(__BITOPS_WORDSIZE - 8), (addr))
>> +#define __clear_le_bit(nr, addr) \
>> + __clear_bit((nr)^(__BITOPS_WORDSIZE - 8), (addr))
>> +#define __test_and_set_le_bit(nr, addr) \
>> + __test_and_set_bit((nr)^(__BITOPS_WORDSIZE - 8), (addr))
>> +#define test_and_set_le_bit(lock, nr, addr) \
>> + test_and_set_bit((nr)^(__BITOPS_WORDSIZE - 8), (addr))
>> +#define __test_and_clear_le_bit(nr, addr) \
>> + __test_and_clear_bit((nr)^(__BITOPS_WORDSIZE - 8), (addr))
>> +#define test_and_clear_le_bit(lock, nr, addr) \
>> + test_and_clear_bit((nr)^(__BITOPS_WORDSIZE - 8), (addr))
>> +#define test_le_bit(nr, addr) \
>> + test_bit((nr)^(__BITOPS_WORDSIZE - 8), (addr))
>
> The test_and_clear_le_bit and test_and_set_le_bit calling conventions
> are a little surprising here. I would not pass the lock argument
> here but leave that to the ext2 wrapper:
>
> #define test_and_set_le_bit(nr, addr) \
> test_and_set_bit((nr)^(__BITOPS_WORDSIZE - 8), (addr))
> #define test_and_clear_le_bit(nr, addr) \
> test_and_clear_bit((nr)^(__BITOPS_WORDSIZE - 8), (addr))
>
> #define ext2_set_bit_atomic(lock, nr, addr) \
> test_and_set_le_bit((nr), (unsigned long *)(addr))
> #define ext2_clear_bit_atomic(lock, nr, addr) \
> test_and_clear_le_bit((nr), (unsigned long *)(addr))
>
> Same thing on arm and m68k.
Oops,
test_and_{set,clear}_le_bit() is only used by ext2_{set,clear}_bit_atomic
and I had one additional patch that cleans up these definisions across
the architectures. So I didn't realize that mistake when I did cross
compile.
^ permalink raw reply [flat|nested] 75+ messages in thread
* Re: [PATCH 21/22] m68k: convert minix bitops to use little endian bitops
2010-10-15 9:46 ` [PATCH 21/22] m68k: convert minix bitops to use little endian bitops Akinobu Mita
2010-10-15 9:46 ` Akinobu Mita
@ 2010-10-18 8:58 ` Andreas Schwab
2010-10-18 8:58 ` Andreas Schwab
1 sibling, 1 reply; 75+ messages in thread
From: Andreas Schwab @ 2010-10-18 8:58 UTC (permalink / raw)
To: Akinobu Mita
Cc: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig,
Andrew Morton, Geert Uytterhoeven, Roman Zippel, linux-m68k
Akinobu Mita <akinobu.mita@gmail.com> writes:
> The inode and block bitmap for minix filesystem is little endian
> byte order on m68k.
No, it isn't.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 75+ messages in thread
* Re: [PATCH 21/22] m68k: convert minix bitops to use little endian bitops
2010-10-18 8:58 ` Andreas Schwab
@ 2010-10-18 8:58 ` Andreas Schwab
0 siblings, 0 replies; 75+ messages in thread
From: Andreas Schwab @ 2010-10-18 8:58 UTC (permalink / raw)
To: Akinobu Mita
Cc: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig,
Andrew Morton, Geert Uytterhoeven, Roman Zippel, linux-m68k
Akinobu Mita <akinobu.mita@gmail.com> writes:
> The inode and block bitmap for minix filesystem is little endian
> byte order on m68k.
No, it isn't.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 75+ messages in thread
* Re: [PATCH 04/22] arm: introduce little endian bitops
2010-10-15 9:46 ` [PATCH 04/22] arm: " Akinobu Mita
@ 2010-10-18 9:26 ` Russell King - ARM Linux
2010-10-18 9:26 ` Russell King - ARM Linux
2010-10-18 13:22 ` Akinobu Mita
0 siblings, 2 replies; 75+ messages in thread
From: Russell King - ARM Linux @ 2010-10-18 9:26 UTC (permalink / raw)
To: Akinobu Mita
Cc: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig,
Andrew Morton, linux-arm-kernel
On Fri, Oct 15, 2010 at 06:46:03PM +0900, Akinobu Mita wrote:
> Introduce little endian bit operations by renaming native ext2 bit
> operations. The ext2 bit operations are kept by using little endian
> bit operations until the conversions are finished.
Can you explain why we need another level of indirection rather than
using asm-generic/bitops/le.h, asm-generic/bitops/minix.h and
asm-generic/bitops/ext2-non-atomic.h ?
^ permalink raw reply [flat|nested] 75+ messages in thread
* Re: [PATCH 04/22] arm: introduce little endian bitops
2010-10-18 9:26 ` Russell King - ARM Linux
@ 2010-10-18 9:26 ` Russell King - ARM Linux
2010-10-18 13:22 ` Akinobu Mita
1 sibling, 0 replies; 75+ messages in thread
From: Russell King - ARM Linux @ 2010-10-18 9:26 UTC (permalink / raw)
To: Akinobu Mita
Cc: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig,
Andrew Morton, linux-arm-kernel
On Fri, Oct 15, 2010 at 06:46:03PM +0900, Akinobu Mita wrote:
> Introduce little endian bit operations by renaming native ext2 bit
> operations. The ext2 bit operations are kept by using little endian
> bit operations until the conversions are finished.
Can you explain why we need another level of indirection rather than
using asm-generic/bitops/le.h, asm-generic/bitops/minix.h and
asm-generic/bitops/ext2-non-atomic.h ?
^ permalink raw reply [flat|nested] 75+ messages in thread
* Re: [PATCH 11/22] ext3: use little endian bitops
2010-10-15 9:46 ` [PATCH 11/22] ext3: " Akinobu Mita
2010-10-15 9:46 ` Akinobu Mita
@ 2010-10-18 10:31 ` Jan Kara
2010-10-18 10:31 ` Jan Kara
1 sibling, 1 reply; 75+ messages in thread
From: Jan Kara @ 2010-10-18 10:31 UTC (permalink / raw)
To: Akinobu Mita
Cc: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig,
Andrew Morton, Jan Kara, Andreas Dilger, linux-ext4
On Fri 15-10-10 18:46:10, Akinobu Mita wrote:
> As a preparation for removing ext2 non-atomic bit operations from
> asm/bitops.h. This converts ext2 non-atomic bit operations to
> little endian bit operations.
>
> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
> Cc: Jan Kara <jack@suse.cz>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Andreas Dilger <adilger.kernel@dilger.ca>
> Cc: linux-ext4@vger.kernel.org
Acked-by: Jan Kara <jack@suse.cz>
Honza
> ---
> include/linux/ext3_fs.h | 15 ++++++++++-----
> 1 files changed, 10 insertions(+), 5 deletions(-)
>
> diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h
> index 6ce1bca..34ef455 100644
> --- a/include/linux/ext3_fs.h
> +++ b/include/linux/ext3_fs.h
> @@ -418,13 +418,18 @@ struct ext3_inode {
> #define EXT2_MOUNT_DATA_FLAGS EXT3_MOUNT_DATA_FLAGS
> #endif
>
> -#define ext3_set_bit ext2_set_bit
> +#define ext3_set_bit(nr, addr) \
> + __test_and_set_le_bit((nr), (unsigned long *)(addr))
> #define ext3_set_bit_atomic ext2_set_bit_atomic
> -#define ext3_clear_bit ext2_clear_bit
> +#define ext3_clear_bit(nr, addr) \
> + __test_and_clear_le_bit((nr), (unsigned long *)(addr))
> #define ext3_clear_bit_atomic ext2_clear_bit_atomic
> -#define ext3_test_bit ext2_test_bit
> -#define ext3_find_first_zero_bit ext2_find_first_zero_bit
> -#define ext3_find_next_zero_bit ext2_find_next_zero_bit
> +#define ext3_test_bit(nr, addr) \
> + test_le_bit((nr), (unsigned long *)(addr))
> +#define ext3_find_first_zero_bit(addr, size) \
> + find_first_zero_le_bit((unsigned long *)(addr), (size))
> +#define ext3_find_next_zero_bit(addr, size, off) \
> + find_next_zero_le_bit((unsigned long *)(addr), (size), (off))
>
> /*
> * Maximal mount counts between two filesystem checks
> --
> 1.7.1.231.gd0b16
>
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 75+ messages in thread
* Re: [PATCH 11/22] ext3: use little endian bitops
2010-10-18 10:31 ` Jan Kara
@ 2010-10-18 10:31 ` Jan Kara
0 siblings, 0 replies; 75+ messages in thread
From: Jan Kara @ 2010-10-18 10:31 UTC (permalink / raw)
To: Akinobu Mita
Cc: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig,
Andrew Morton, Jan Kara, Andreas Dilger, linux-ext4
On Fri 15-10-10 18:46:10, Akinobu Mita wrote:
> As a preparation for removing ext2 non-atomic bit operations from
> asm/bitops.h. This converts ext2 non-atomic bit operations to
> little endian bit operations.
>
> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
> Cc: Jan Kara <jack@suse.cz>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Andreas Dilger <adilger.kernel@dilger.ca>
> Cc: linux-ext4@vger.kernel.org
Acked-by: Jan Kara <jack@suse.cz>
Honza
> ---
> include/linux/ext3_fs.h | 15 ++++++++++-----
> 1 files changed, 10 insertions(+), 5 deletions(-)
>
> diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h
> index 6ce1bca..34ef455 100644
> --- a/include/linux/ext3_fs.h
> +++ b/include/linux/ext3_fs.h
> @@ -418,13 +418,18 @@ struct ext3_inode {
> #define EXT2_MOUNT_DATA_FLAGS EXT3_MOUNT_DATA_FLAGS
> #endif
>
> -#define ext3_set_bit ext2_set_bit
> +#define ext3_set_bit(nr, addr) \
> + __test_and_set_le_bit((nr), (unsigned long *)(addr))
> #define ext3_set_bit_atomic ext2_set_bit_atomic
> -#define ext3_clear_bit ext2_clear_bit
> +#define ext3_clear_bit(nr, addr) \
> + __test_and_clear_le_bit((nr), (unsigned long *)(addr))
> #define ext3_clear_bit_atomic ext2_clear_bit_atomic
> -#define ext3_test_bit ext2_test_bit
> -#define ext3_find_first_zero_bit ext2_find_first_zero_bit
> -#define ext3_find_next_zero_bit ext2_find_next_zero_bit
> +#define ext3_test_bit(nr, addr) \
> + test_le_bit((nr), (unsigned long *)(addr))
> +#define ext3_find_first_zero_bit(addr, size) \
> + find_first_zero_le_bit((unsigned long *)(addr), (size))
> +#define ext3_find_next_zero_bit(addr, size, off) \
> + find_next_zero_le_bit((unsigned long *)(addr), (size), (off))
>
> /*
> * Maximal mount counts between two filesystem checks
> --
> 1.7.1.231.gd0b16
>
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 75+ messages in thread
* Re: [PATCH 16/22] udf: use little endian bitops
2010-10-15 9:46 ` [PATCH 16/22] udf: " Akinobu Mita
2010-10-15 9:46 ` Akinobu Mita
@ 2010-10-18 10:46 ` Jan Kara
1 sibling, 0 replies; 75+ messages in thread
From: Jan Kara @ 2010-10-18 10:46 UTC (permalink / raw)
To: Akinobu Mita
Cc: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig,
Andrew Morton, Jan Kara
On Fri 15-10-10 18:46:15, Akinobu Mita wrote:
> As a preparation for removing ext2 non-atomic bit operations from
> asm/bitops.h. This converts ext2 non-atomic bit operations to
> little endian bit operations.
>
> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
> Cc: Jan Kara <jack@suse.cz>
Acked-by: Jan Kara <jack@suse.cz>
Honza
> ---
> fs/udf/balloc.c | 11 +++++++----
> 1 files changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/fs/udf/balloc.c b/fs/udf/balloc.c
> index b608efa..e55aff9 100644
> --- a/fs/udf/balloc.c
> +++ b/fs/udf/balloc.c
> @@ -27,11 +27,14 @@
> #include "udf_i.h"
> #include "udf_sb.h"
>
> -#define udf_clear_bit(nr, addr) ext2_clear_bit(nr, addr)
> -#define udf_set_bit(nr, addr) ext2_set_bit(nr, addr)
> -#define udf_test_bit(nr, addr) ext2_test_bit(nr, addr)
> +#define udf_clear_bit(nr, addr) \
> + __test_and_clear_le_bit(nr, (unsigned long *)(addr))
> +#define udf_set_bit(nr, addr) \
> + __test_and_set_le_bit(nr, (unsigned long *)(addr))
> +#define udf_test_bit(nr, addr) \
> + test_le_bit(nr, (unsigned long *)(addr))
> #define udf_find_next_one_bit(addr, size, offset) \
> - ext2_find_next_bit(addr, size, offset)
> + find_next_le_bit((unsigned long *)(addr), size, offset)
>
> static int read_block_bitmap(struct super_block *sb,
> struct udf_bitmap *bitmap, unsigned int block,
> --
> 1.7.1.231.gd0b16
>
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 75+ messages in thread
* Re: [PATCH 04/22] arm: introduce little endian bitops
2010-10-18 9:26 ` Russell King - ARM Linux
2010-10-18 9:26 ` Russell King - ARM Linux
@ 2010-10-18 13:22 ` Akinobu Mita
2010-10-18 13:22 ` Akinobu Mita
` (2 more replies)
1 sibling, 3 replies; 75+ messages in thread
From: Akinobu Mita @ 2010-10-18 13:22 UTC (permalink / raw)
To: Russell King - ARM Linux
Cc: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig,
Andrew Morton, linux-arm-kernel
2010/10/18 Russell King - ARM Linux <linux@arm.linux.org.uk>:
> On Fri, Oct 15, 2010 at 06:46:03PM +0900, Akinobu Mita wrote:
>> Introduce little endian bit operations by renaming native ext2 bit
>> operations. The ext2 bit operations are kept by using little endian
>> bit operations until the conversions are finished.
>
> Can you explain why we need another level of indirection rather than
> using asm-generic/bitops/le.h, asm-generic/bitops/minix.h and
> asm-generic/bitops/ext2-non-atomic.h ?
Sorry for not CCing the cover letter of this patch series.
Currently there are no common little-endian bit operations for all
architectures, although some architectures implicitly include
asm-generic/bitops/le.h through asm-generic/bitops/minix-le.h or
asm-generic/bitops/ext2-non-atomic.h.
So some drivers (net/rds/cong.c and virt/kvm/kvm_main.c) need to
include asm/bitops/le.h directly. When I tried to remove the
direct inclusion of asm-generic/bitops/le.h by using ext2_*(),
several people prefer another solution like this patch series does.
This patch series introduces little-endian bit operations for
all architectures and convert all ext2 non-atomic bit operations
and minix bit operations to use little-endian bit operations.
it enables to remove ext2 non-atomic and minix bit operations
from asm/bitops.h. The reason they should be removed from
asm/bitops.h is as follows:
For ext2 non-atomic bit operations, they are used for little-endian
byte order bitmap access by some filesystems and modules.
But using ext2_*() functions on a module other than ext2 filesystem
makes someone feel strange.
For minix bit operations, they are only used by minix filesystem
and useless by other modules. Because byte order of inode and block
bitmap is defferent on each architectures.
There are several issues including arm part. So I'm now fixing them.
^ permalink raw reply [flat|nested] 75+ messages in thread
* Re: [PATCH 04/22] arm: introduce little endian bitops
2010-10-18 13:22 ` Akinobu Mita
@ 2010-10-18 13:22 ` Akinobu Mita
2010-10-18 13:56 ` Russell King - ARM Linux
2010-10-18 13:58 ` Russell King - ARM Linux
2 siblings, 0 replies; 75+ messages in thread
From: Akinobu Mita @ 2010-10-18 13:22 UTC (permalink / raw)
To: Russell King - ARM Linux
Cc: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig,
Andrew Morton, linux-arm-kernel
2010/10/18 Russell King - ARM Linux <linux@arm.linux.org.uk>:
> On Fri, Oct 15, 2010 at 06:46:03PM +0900, Akinobu Mita wrote:
>> Introduce little endian bit operations by renaming native ext2 bit
>> operations. The ext2 bit operations are kept by using little endian
>> bit operations until the conversions are finished.
>
> Can you explain why we need another level of indirection rather than
> using asm-generic/bitops/le.h, asm-generic/bitops/minix.h and
> asm-generic/bitops/ext2-non-atomic.h ?
Sorry for not CCing the cover letter of this patch series.
Currently there are no common little-endian bit operations for all
architectures, although some architectures implicitly include
asm-generic/bitops/le.h through asm-generic/bitops/minix-le.h or
asm-generic/bitops/ext2-non-atomic.h.
So some drivers (net/rds/cong.c and virt/kvm/kvm_main.c) need to
include asm/bitops/le.h directly. When I tried to remove the
direct inclusion of asm-generic/bitops/le.h by using ext2_*(),
several people prefer another solution like this patch series does.
This patch series introduces little-endian bit operations for
all architectures and convert all ext2 non-atomic bit operations
and minix bit operations to use little-endian bit operations.
it enables to remove ext2 non-atomic and minix bit operations
from asm/bitops.h. The reason they should be removed from
asm/bitops.h is as follows:
For ext2 non-atomic bit operations, they are used for little-endian
byte order bitmap access by some filesystems and modules.
But using ext2_*() functions on a module other than ext2 filesystem
makes someone feel strange.
For minix bit operations, they are only used by minix filesystem
and useless by other modules. Because byte order of inode and block
bitmap is defferent on each architectures.
There are several issues including arm part. So I'm now fixing them.
^ permalink raw reply [flat|nested] 75+ messages in thread
* Re: [PATCH 04/22] arm: introduce little endian bitops
2010-10-18 13:22 ` Akinobu Mita
2010-10-18 13:22 ` Akinobu Mita
@ 2010-10-18 13:56 ` Russell King - ARM Linux
2010-10-18 14:45 ` Arnd Bergmann
2010-10-18 13:58 ` Russell King - ARM Linux
2 siblings, 1 reply; 75+ messages in thread
From: Russell King - ARM Linux @ 2010-10-18 13:56 UTC (permalink / raw)
To: Akinobu Mita
Cc: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig,
Andrew Morton, linux-arm-kernel
On Mon, Oct 18, 2010 at 10:22:59PM +0900, Akinobu Mita wrote:
> 2010/10/18 Russell King - ARM Linux <linux@arm.linux.org.uk>:
> > On Fri, Oct 15, 2010 at 06:46:03PM +0900, Akinobu Mita wrote:
> >> Introduce little endian bit operations by renaming native ext2 bit
> >> operations. The ext2 bit operations are kept by using little endian
> >> bit operations until the conversions are finished.
> >
> > Can you explain why we need another level of indirection rather than
> > using asm-generic/bitops/le.h, asm-generic/bitops/minix.h and
> > asm-generic/bitops/ext2-non-atomic.h ?
>
> Sorry for not CCing the cover letter of this patch series.
>
> Currently there are no common little-endian bit operations for all
> architectures, although some architectures implicitly include
> asm-generic/bitops/le.h through asm-generic/bitops/minix-le.h or
> asm-generic/bitops/ext2-non-atomic.h.
>
> So some drivers (net/rds/cong.c and virt/kvm/kvm_main.c) need to
> include asm/bitops/le.h directly. When I tried to remove the
> direct inclusion of asm-generic/bitops/le.h by using ext2_*(),
> several people prefer another solution like this patch series does.
>
> This patch series introduces little-endian bit operations for
> all architectures and convert all ext2 non-atomic bit operations
> and minix bit operations to use little-endian bit operations.
> it enables to remove ext2 non-atomic and minix bit operations
> from asm/bitops.h. The reason they should be removed from
> asm/bitops.h is as follows:
>
> For ext2 non-atomic bit operations, they are used for little-endian
> byte order bitmap access by some filesystems and modules.
> But using ext2_*() functions on a module other than ext2 filesystem
> makes someone feel strange.
>
> For minix bit operations, they are only used by minix filesystem
> and useless by other modules. Because byte order of inode and block
> bitmap is defferent on each architectures.
>
> There are several issues including arm part. So I'm now fixing them.
le.h provides:
generic___set_le_bit
generic___test_and_set_le_bit
...
Your new patches provide:
__set_le_bit
__test_and_set_le_bit
Would it not be better to have le.h provide one set of these LE bitops
(called either generic___set_le_bit or __set_le_bit - which ever you
prefer), and then have everyone using those common names (including
minix-le.h and ext2-non-atomic.h) rather than adding a whole series of
new bitop macros to the current mess?
To put it another way, if we're providing a set of guaranteed-little-endian
bitops, I'd like to see ARM doing this:
#define __test_and_set_le_bit(nr,p) ...
#include <asm-generic/bitops/minix-le.h>
#include <asm-generic/bitops/ext2-non-atomic.h>
where ext2-non-atomic.h could just be:
#define ext2_set_bit(nr,addr) __test_and_set_le_bit((nr),(unsigned long *)(addr))
instead of defining its own minix and ext2 bitops as we do now:
#ifndef __ARMEB__
#define WORD_BITOFF_TO_LE(x) ((x))
#else
#define WORD_BITOFF_TO_LE(x) ((x) ^ 0x18)
#endif
#define ext2_set_bit(nr,p) \
__test_and_set_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
vs the current 'generic' stuff:
ARM byteorder.h (roughly):
#ifdef __ARMEB__
#define __BIG_ENDIAN 4321
#else
#define __LITTLE_ENDIAN 1234
#endif
le.h:
#define BITOP_LE_SWIZZLE ((BITS_PER_LONG-1) & ~0x7)
#if defined(__LITTLE_ENDIAN)
#define generic___test_and_set_le_bit(nr, addr) __test_and_set_bit(nr, addr)
#elif defined(__BIG_ENDIAN)
#define generic___test_and_set_le_bit(nr, addr) \
__test_and_set_bit((nr) ^ BITOP_LE_SWIZZLE, (addr))
#endif
ext2-non-atomic.h:
#define ext2_set_bit(nr,addr) \
generic___test_and_set_le_bit((nr),(unsigned long *)(addr))
What I'm trying to say is please don't make the existing mess of bitops
any worse than it currently is.
^ permalink raw reply [flat|nested] 75+ messages in thread
* Re: [PATCH 04/22] arm: introduce little endian bitops
2010-10-18 13:22 ` Akinobu Mita
2010-10-18 13:22 ` Akinobu Mita
2010-10-18 13:56 ` Russell King - ARM Linux
@ 2010-10-18 13:58 ` Russell King - ARM Linux
2010-10-18 13:58 ` Russell King - ARM Linux
2 siblings, 1 reply; 75+ messages in thread
From: Russell King - ARM Linux @ 2010-10-18 13:58 UTC (permalink / raw)
To: Akinobu Mita
Cc: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig,
Andrew Morton, linux-arm-kernel
On Mon, Oct 18, 2010 at 10:22:59PM +0900, Akinobu Mita wrote:
> 2010/10/18 Russell King - ARM Linux <linux@arm.linux.org.uk>:
> > On Fri, Oct 15, 2010 at 06:46:03PM +0900, Akinobu Mita wrote:
> >> Introduce little endian bit operations by renaming native ext2 bit
> >> operations. The ext2 bit operations are kept by using little endian
> >> bit operations until the conversions are finished.
> >
> > Can you explain why we need another level of indirection rather than
> > using asm-generic/bitops/le.h, asm-generic/bitops/minix.h and
> > asm-generic/bitops/ext2-non-atomic.h ?
>
> Sorry for not CCing the cover letter of this patch series.
BTW, I've not seen any of the others in this patch series, not even via
linux-arch...
^ permalink raw reply [flat|nested] 75+ messages in thread
* Re: [PATCH 04/22] arm: introduce little endian bitops
2010-10-18 13:58 ` Russell King - ARM Linux
@ 2010-10-18 13:58 ` Russell King - ARM Linux
0 siblings, 0 replies; 75+ messages in thread
From: Russell King - ARM Linux @ 2010-10-18 13:58 UTC (permalink / raw)
To: Akinobu Mita
Cc: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig,
Andrew Morton, linux-arm-kernel
On Mon, Oct 18, 2010 at 10:22:59PM +0900, Akinobu Mita wrote:
> 2010/10/18 Russell King - ARM Linux <linux@arm.linux.org.uk>:
> > On Fri, Oct 15, 2010 at 06:46:03PM +0900, Akinobu Mita wrote:
> >> Introduce little endian bit operations by renaming native ext2 bit
> >> operations. The ext2 bit operations are kept by using little endian
> >> bit operations until the conversions are finished.
> >
> > Can you explain why we need another level of indirection rather than
> > using asm-generic/bitops/le.h, asm-generic/bitops/minix.h and
> > asm-generic/bitops/ext2-non-atomic.h ?
>
> Sorry for not CCing the cover letter of this patch series.
BTW, I've not seen any of the others in this patch series, not even via
linux-arch...
^ permalink raw reply [flat|nested] 75+ messages in thread
* Re: [PATCH 04/22] arm: introduce little endian bitops
2010-10-18 13:56 ` Russell King - ARM Linux
@ 2010-10-18 14:45 ` Arnd Bergmann
2010-10-18 15:07 ` Russell King - ARM Linux
0 siblings, 1 reply; 75+ messages in thread
From: Arnd Bergmann @ 2010-10-18 14:45 UTC (permalink / raw)
To: Russell King - ARM Linux
Cc: Akinobu Mita, linux-kernel, linux-arch, Christoph Hellwig,
Andrew Morton, linux-arm-kernel
On Monday 18 October 2010, Russell King - ARM Linux wrote:
> le.h provides:
>
> generic___set_le_bit
> generic___test_and_set_le_bit
> ...
>
> Your new patches provide:
>
> __set_le_bit
> __test_and_set_le_bit
>
> Would it not be better to have le.h provide one set of these LE bitops
> (called either generic___set_le_bit or __set_le_bit - which ever you
> prefer), and then have everyone using those common names (including
> minix-le.h and ext2-non-atomic.h) rather than adding a whole series of
> new bitop macros to the current mess?
One optimization I can think of for the ARM headers would be to only
define find_first_zero_le_bit, find_next_zero_le_bit and find_next_le_bit
in arch/arm/include/asm/bitops.h and take the other definitions from
asm-generic/bitops/le.h, which encloses then duplicate ones in #ifdef.
> To put it another way, if we're providing a set of guaranteed-little-endian
> bitops, I'd like to see ARM doing this:
>
> #define __test_and_set_le_bit(nr,p) ...
>
> #include <asm-generic/bitops/minix-le.h>
> #include <asm-generic/bitops/ext2-non-atomic.h>
>
> where ext2-non-atomic.h could just be:
>
> #define ext2_set_bit(nr,addr) __test_and_set_le_bit((nr),(unsigned long *)(addr))
Note that patches 20 and 22 of the series completely eliminate the
the minix and ext2 definitions, putting them into architecture independent
code in those two file systems where they belong.
Adding the new definitions in patch 4 is just a logical step before removing
the old definitions in the later patches while maintaining bisectability.
> What I'm trying to say is please don't make the existing mess of bitops
> any worse than it currently is.
The series currently adds 20 lines to the arm code (could be reduced to
6 lines), but removes 26 lines which are essentially architecture
independent and shouldn't be there to start with. I'd call that the
opposite of making the mess worse.
Arnd
^ permalink raw reply [flat|nested] 75+ messages in thread
* Re: [PATCH 04/22] arm: introduce little endian bitops
2010-10-18 14:45 ` Arnd Bergmann
@ 2010-10-18 15:07 ` Russell King - ARM Linux
2010-10-18 15:07 ` Russell King - ARM Linux
0 siblings, 1 reply; 75+ messages in thread
From: Russell King - ARM Linux @ 2010-10-18 15:07 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Akinobu Mita, linux-kernel, linux-arch, Christoph Hellwig,
Andrew Morton, linux-arm-kernel
On Mon, Oct 18, 2010 at 04:45:12PM +0200, Arnd Bergmann wrote:
> Note that patches 20 and 22 of the series completely eliminate the
> the minix and ext2 definitions, putting them into architecture independent
> code in those two file systems where they belong.
Good.
> Adding the new definitions in patch 4 is just a logical step before removing
> the old definitions in the later patches while maintaining bisectability.
In which case I don't have a problem with the series.
> > What I'm trying to say is please don't make the existing mess of bitops
> > any worse than it currently is.
>
> The series currently adds 20 lines to the arm code (could be reduced to
> 6 lines), but removes 26 lines which are essentially architecture
> independent and shouldn't be there to start with. I'd call that the
> opposite of making the mess worse.
Right - if I could've seen the rest of the series, then maybe I'd have
known that. However, I seemed to have silently dropped off linux-arch
back in April and only just noticed, which means I've missed rather a
lot...
^ permalink raw reply [flat|nested] 75+ messages in thread
* Re: [PATCH 04/22] arm: introduce little endian bitops
2010-10-18 15:07 ` Russell King - ARM Linux
@ 2010-10-18 15:07 ` Russell King - ARM Linux
0 siblings, 0 replies; 75+ messages in thread
From: Russell King - ARM Linux @ 2010-10-18 15:07 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Akinobu Mita, linux-kernel, linux-arch, Christoph Hellwig,
Andrew Morton, linux-arm-kernel
On Mon, Oct 18, 2010 at 04:45:12PM +0200, Arnd Bergmann wrote:
> Note that patches 20 and 22 of the series completely eliminate the
> the minix and ext2 definitions, putting them into architecture independent
> code in those two file systems where they belong.
Good.
> Adding the new definitions in patch 4 is just a logical step before removing
> the old definitions in the later patches while maintaining bisectability.
In which case I don't have a problem with the series.
> > What I'm trying to say is please don't make the existing mess of bitops
> > any worse than it currently is.
>
> The series currently adds 20 lines to the arm code (could be reduced to
> 6 lines), but removes 26 lines which are essentially architecture
> independent and shouldn't be there to start with. I'd call that the
> opposite of making the mess worse.
Right - if I could've seen the rest of the series, then maybe I'd have
known that. However, I seemed to have silently dropped off linux-arch
back in April and only just noticed, which means I've missed rather a
lot...
^ permalink raw reply [flat|nested] 75+ messages in thread
* Re: [PATCH 13/22] ocfs2: use little endian bitops
2010-10-15 9:46 ` [PATCH 13/22] ocfs2: " Akinobu Mita
@ 2010-10-18 20:19 ` Joel Becker
2010-10-18 20:19 ` Joel Becker
0 siblings, 1 reply; 75+ messages in thread
From: Joel Becker @ 2010-10-18 20:19 UTC (permalink / raw)
To: Akinobu Mita
Cc: linux-arch, Arnd Bergmann, Mark Fasheh, linux-kernel,
Christoph Hellwig, Andrew Morton, ocfs2-devel
On Fri, Oct 15, 2010 at 06:46:12PM +0900, Akinobu Mita wrote:
> As a preparation for removing ext2 non-atomic bit operations from
> asm/bitops.h. This converts ext2 non-atomic bit operations to
> little endian bit operations.
>
> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
> Cc: Mark Fasheh <mfasheh@suse.com>
> Cc: Joel Becker <joel.becker@oracle.com>
> Cc: ocfs2-devel@oss.oracle.com
Acked-by: Joel Becker <joel.becker@oracle.com>
--
There are morethings in heaven and earth, Horatio,
Than are dreamt of in your philosophy.
Joel Becker
Consulting Software Developer
Oracle
E-mail: joel.becker@oracle.com
Phone: (650) 506-8127
^ permalink raw reply [flat|nested] 75+ messages in thread
* Re: [PATCH 13/22] ocfs2: use little endian bitops
2010-10-18 20:19 ` Joel Becker
@ 2010-10-18 20:19 ` Joel Becker
0 siblings, 0 replies; 75+ messages in thread
From: Joel Becker @ 2010-10-18 20:19 UTC (permalink / raw)
To: Akinobu Mita
Cc: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig,
Andrew Morton, Mark Fasheh, ocfs2-devel
On Fri, Oct 15, 2010 at 06:46:12PM +0900, Akinobu Mita wrote:
> As a preparation for removing ext2 non-atomic bit operations from
> asm/bitops.h. This converts ext2 non-atomic bit operations to
> little endian bit operations.
>
> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
> Cc: Mark Fasheh <mfasheh@suse.com>
> Cc: Joel Becker <joel.becker@oracle.com>
> Cc: ocfs2-devel@oss.oracle.com
Acked-by: Joel Becker <joel.becker@oracle.com>
--
There are morethings in heaven and earth, Horatio,
Than are dreamt of in your philosophy.
Joel Becker
Consulting Software Developer
Oracle
E-mail: joel.becker@oracle.com
Phone: (650) 506-8127
^ permalink raw reply [flat|nested] 75+ messages in thread
* Re: [PATCH 22/22] bitops: remove minix bitops from asm/bitops.h
2010-10-16 15:58 ` Andreas Schwab
@ 2010-10-19 15:05 ` Akinobu Mita
0 siblings, 0 replies; 75+ messages in thread
From: Akinobu Mita @ 2010-10-19 15:05 UTC (permalink / raw)
To: Andreas Schwab
Cc: Geert Uytterhoeven, Arnd Bergmann, linux-kernel, linux-arch,
Christoph Hellwig, Andrew Morton, Linux/m68k
On Sat, Oct 16, 2010 at 05:58:50PM +0200, Andreas Schwab wrote:
> Akinobu Mita <akinobu.mita@gmail.com> writes:
>
> > 2010/10/16 Andreas Schwab <schwab@linux-m68k.org>:
> >> Akinobu Mita <akinobu.mita@gmail.com> writes:
> >>
> >>> m68knommu is big-endian minixfs but m68k (mmu) is little-endian minixfs
> >>> if I read arch/m68k/include/asm/bitops_{mm,no}.h correctly.
> >>
> >> Don't be confused by ^16, this is for the 16bit/32bit indexing
> >> correction. The nommu version uses big-endian 32bit indexing which yet
> >> another format.
> >
> > Oh, I see. I misunderstood.
> >
> > So we need a special handling for it to keep compatibility.
>
> IMHO we only need two versions: big-endian filesystem with big-endian
> 16bit indexed bitmaps and little-endian filesystem with little-endian
> bitmaps. The rest is just the result of careless copying. Note that
> the minix filesystem does no byte swapping, so native byte order is the
> only sensible mode.
I'm going to fix it by adding another two config options.
(based on the Arnd's suggestion in the earlier reply in this thread)
config MINIX_FS_NATIVE_ENDIAN
def_bool MINIX_FS
depends on H8300 || M32R || MICROBLAZE || MIPS || S390 || SUPERH || SPARC || XTENSA || (M68K && !MMU)
config MINIX_FS_BIG_ENDIAN_16BIT_INDEXED
def_bool MINIX_FS
depends on M68K && MMU
The architectures which always use little-endian bitmaps do not select
these options.
---
arch/alpha/include/asm/bitops.h | 2 -
arch/arm/include/asm/bitops.h | 14 ------
arch/avr32/include/asm/bitops.h | 1 -
arch/blackfin/include/asm/bitops.h | 1 -
arch/cris/include/asm/bitops.h | 1 -
arch/frv/include/asm/bitops.h | 2 -
arch/h8300/include/asm/bitops.h | 1 -
arch/ia64/include/asm/bitops.h | 1 -
arch/m32r/include/asm/bitops.h | 1 -
arch/m68k/include/asm/bitops_mm.h | 30 ------------
arch/mips/include/asm/bitops.h | 1 -
arch/mn10300/include/asm/bitops.h | 1 -
arch/parisc/include/asm/bitops.h | 2 -
arch/powerpc/include/asm/bitops.h | 14 ------
arch/s390/include/asm/bitops.h | 1 -
arch/sh/include/asm/bitops.h | 1 -
arch/sparc/include/asm/bitops_32.h | 1 -
arch/sparc/include/asm/bitops_64.h | 2 -
arch/tile/include/asm/bitops.h | 1 -
arch/x86/include/asm/bitops.h | 2 -
arch/xtensa/include/asm/bitops.h | 1 -
fs/minix/Kconfig | 8 +++
fs/minix/minix.h | 79 +++++++++++++++++++++++++++++++++
include/asm-generic/bitops.h | 1 -
include/asm-generic/bitops/minix-le.h | 15 ------
include/asm-generic/bitops/minix.h | 15 ------
26 files changed, 87 insertions(+), 112 deletions(-)
delete mode 100644 include/asm-generic/bitops/minix-le.h
delete mode 100644 include/asm-generic/bitops/minix.h
diff --git a/arch/alpha/include/asm/bitops.h b/arch/alpha/include/asm/bitops.h
index 822433a..85b8152 100644
--- a/arch/alpha/include/asm/bitops.h
+++ b/arch/alpha/include/asm/bitops.h
@@ -459,8 +459,6 @@ sched_find_first_bit(const unsigned long b[2])
#define ext2_set_bit_atomic(l,n,a) test_and_set_bit(n,a)
#define ext2_clear_bit_atomic(l,n,a) test_and_clear_bit(n,a)
-#include <asm-generic/bitops/minix.h>
-
#endif /* __KERNEL__ */
#endif /* _ALPHA_BITOPS_H */
diff --git a/arch/arm/include/asm/bitops.h b/arch/arm/include/asm/bitops.h
index ac2edb4..59a2a2b 100644
--- a/arch/arm/include/asm/bitops.h
+++ b/arch/arm/include/asm/bitops.h
@@ -332,20 +332,6 @@ static inline int fls(int x)
#define ext2_clear_bit_atomic(lock,nr,p) \
test_and_clear_le_bit(nr, (unsigned long *)(p))
-/*
- * Minix is defined to use little-endian byte ordering.
- * These do not need to be atomic.
- */
-#define minix_set_bit(nr,p) \
- __set_le_bit(nr, (unsigned long *)(p))
-#define minix_test_bit(nr,p) \
- test_le_bit(nr, (unsigned long *)(p))
-#define minix_test_and_set_bit(nr,p) \
- __test_and_set_le_bit(nr, (unsigned long *)(p))
-#define minix_test_and_clear_bit(nr,p) \
- __test_and_clear_le_bit(nr, (unsigned long *)(p))
-#define minix_find_first_zero_bit(p,sz) \
- find_first_zero_le_bit((unsigned long *)(p), sz)
#endif /* __KERNEL__ */
diff --git a/arch/avr32/include/asm/bitops.h b/arch/avr32/include/asm/bitops.h
index 73a163a..72444d9 100644
--- a/arch/avr32/include/asm/bitops.h
+++ b/arch/avr32/include/asm/bitops.h
@@ -301,6 +301,5 @@ static inline int ffs(unsigned long word)
#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-atomic.h>
-#include <asm-generic/bitops/minix-le.h>
#endif /* __ASM_AVR32_BITOPS_H */
diff --git a/arch/blackfin/include/asm/bitops.h b/arch/blackfin/include/asm/bitops.h
index 2c549f7..68843fa 100644
--- a/arch/blackfin/include/asm/bitops.h
+++ b/arch/blackfin/include/asm/bitops.h
@@ -27,7 +27,6 @@
#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-atomic.h>
-#include <asm-generic/bitops/minix.h>
#ifndef CONFIG_SMP
#include <linux/irqflags.h>
diff --git a/arch/cris/include/asm/bitops.h b/arch/cris/include/asm/bitops.h
index 71bea40..310e0de 100644
--- a/arch/cris/include/asm/bitops.h
+++ b/arch/cris/include/asm/bitops.h
@@ -159,7 +159,6 @@ static inline int test_and_change_bit(int nr, volatile unsigned long *addr)
#define ext2_set_bit_atomic(l,n,a) test_and_set_bit(n,a)
#define ext2_clear_bit_atomic(l,n,a) test_and_clear_bit(n,a)
-#include <asm-generic/bitops/minix.h>
#include <asm-generic/bitops/sched.h>
#endif /* __KERNEL__ */
diff --git a/arch/frv/include/asm/bitops.h b/arch/frv/include/asm/bitops.h
index e3ea644..a1d00b0 100644
--- a/arch/frv/include/asm/bitops.h
+++ b/arch/frv/include/asm/bitops.h
@@ -406,8 +406,6 @@ int __ilog2_u64(u64 n)
#define ext2_set_bit_atomic(lock,nr,addr) test_and_set_bit ((nr) ^ 0x18, (addr))
#define ext2_clear_bit_atomic(lock,nr,addr) test_and_clear_bit((nr) ^ 0x18, (addr))
-#include <asm-generic/bitops/minix-le.h>
-
#endif /* __KERNEL__ */
#endif /* _ASM_BITOPS_H */
diff --git a/arch/h8300/include/asm/bitops.h b/arch/h8300/include/asm/bitops.h
index 23cea66..e856c1b 100644
--- a/arch/h8300/include/asm/bitops.h
+++ b/arch/h8300/include/asm/bitops.h
@@ -202,7 +202,6 @@ static __inline__ unsigned long __ffs(unsigned long word)
#include <asm-generic/bitops/lock.h>
#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-atomic.h>
-#include <asm-generic/bitops/minix.h>
#endif /* __KERNEL__ */
diff --git a/arch/ia64/include/asm/bitops.h b/arch/ia64/include/asm/bitops.h
index 336984a..b76f7e0 100644
--- a/arch/ia64/include/asm/bitops.h
+++ b/arch/ia64/include/asm/bitops.h
@@ -461,7 +461,6 @@ static __inline__ unsigned long __arch_hweight64(unsigned long x)
#define ext2_set_bit_atomic(l,n,a) test_and_set_bit(n,a)
#define ext2_clear_bit_atomic(l,n,a) test_and_clear_bit(n,a)
-#include <asm-generic/bitops/minix.h>
#include <asm-generic/bitops/sched.h>
#endif /* __KERNEL__ */
diff --git a/arch/m32r/include/asm/bitops.h b/arch/m32r/include/asm/bitops.h
index cdfb4c8..6300f22 100644
--- a/arch/m32r/include/asm/bitops.h
+++ b/arch/m32r/include/asm/bitops.h
@@ -268,7 +268,6 @@ static __inline__ int test_and_change_bit(int nr, volatile void * addr)
#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-atomic.h>
-#include <asm-generic/bitops/minix.h>
#endif /* __KERNEL__ */
diff --git a/arch/m68k/include/asm/bitops_mm.h b/arch/m68k/include/asm/bitops_mm.h
index f31ed5a..5f06275 100644
--- a/arch/m68k/include/asm/bitops_mm.h
+++ b/arch/m68k/include/asm/bitops_mm.h
@@ -325,36 +325,6 @@ static inline int __fls(int x)
#include <asm-generic/bitops/hweight.h>
#include <asm-generic/bitops/lock.h>
-/* Bitmap functions for the minix filesystem */
-
-static inline int minix_find_first_zero_bit(const void *vaddr, unsigned size)
-{
- const unsigned short *p = vaddr, *addr = vaddr;
- unsigned short num;
-
- if (!size)
- return 0;
-
- size = (size >> 4) + ((size & 15) > 0);
- while (*p++ == 0xffff) {
- if (--size == 0)
- return (p - addr) << 4;
- }
-
- num = *--p;
- return ((p - addr) << 4) + ffz(num);
-}
-
-#define minix_test_and_set_bit(nr, addr) __test_and_set_bit((nr) ^ 16, (unsigned long *)(addr))
-#define minix_set_bit(nr,addr) __set_bit((nr) ^ 16, (unsigned long *)(addr))
-#define minix_test_and_clear_bit(nr, addr) __test_and_clear_bit((nr) ^ 16, (unsigned long *)(addr))
-
-static inline int minix_test_bit(int nr, const void *vaddr)
-{
- const unsigned short *p = vaddr;
- return (p[nr >> 4] & (1U << (nr & 15))) != 0;
-}
-
/* Bitmap functions for little endian. */
#define __set_le_bit(nr, addr) \
diff --git a/arch/mips/include/asm/bitops.h b/arch/mips/include/asm/bitops.h
index 07ce5aa..6a2202c 100644
--- a/arch/mips/include/asm/bitops.h
+++ b/arch/mips/include/asm/bitops.h
@@ -706,7 +706,6 @@ static inline int ffs(int word)
#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-atomic.h>
-#include <asm-generic/bitops/minix.h>
#endif /* __KERNEL__ */
diff --git a/arch/mn10300/include/asm/bitops.h b/arch/mn10300/include/asm/bitops.h
index e1a9768..94ee844 100644
--- a/arch/mn10300/include/asm/bitops.h
+++ b/arch/mn10300/include/asm/bitops.h
@@ -234,7 +234,6 @@ int ffs(int x)
test_and_clear_bit((nr), (addr))
#include <asm-generic/bitops/le.h>
-#include <asm-generic/bitops/minix-le.h>
#endif /* __KERNEL__ */
#endif /* __ASM_BITOPS_H */
diff --git a/arch/parisc/include/asm/bitops.h b/arch/parisc/include/asm/bitops.h
index 919d7ed..43c516f 100644
--- a/arch/parisc/include/asm/bitops.h
+++ b/arch/parisc/include/asm/bitops.h
@@ -234,6 +234,4 @@ static __inline__ int fls(int x)
#endif /* __KERNEL__ */
-#include <asm-generic/bitops/minix-le.h>
-
#endif /* _PARISC_BITOPS_H */
diff --git a/arch/powerpc/include/asm/bitops.h b/arch/powerpc/include/asm/bitops.h
index eb9ce7f..bf5ccfc 100644
--- a/arch/powerpc/include/asm/bitops.h
+++ b/arch/powerpc/include/asm/bitops.h
@@ -308,20 +308,6 @@ unsigned long find_next_le_bit(const unsigned long *addr,
#define ext2_clear_bit_atomic(lock, nr, addr) \
test_and_clear_le_bit((nr), (unsigned long*)addr)
-/* Bitmap functions for the minix filesystem. */
-
-#define minix_test_and_set_bit(nr,addr) \
- __test_and_set_le_bit(nr, (unsigned long *)addr)
-#define minix_set_bit(nr,addr) \
- __set_le_bit(nr, (unsigned long *)addr)
-#define minix_test_and_clear_bit(nr,addr) \
- __test_and_clear_le_bit(nr, (unsigned long *)addr)
-#define minix_test_bit(nr,addr) \
- test_le_bit(nr, (unsigned long *)addr)
-
-#define minix_find_first_zero_bit(addr,size) \
- find_first_zero_le_bit((unsigned long *)addr, size)
-
#include <asm-generic/bitops/sched.h>
#endif /* __KERNEL__ */
diff --git a/arch/s390/include/asm/bitops.h b/arch/s390/include/asm/bitops.h
index 1bd1e11..e537613 100644
--- a/arch/s390/include/asm/bitops.h
+++ b/arch/s390/include/asm/bitops.h
@@ -842,7 +842,6 @@ static inline int find_next_le_bit(void *vaddr, unsigned long size,
#define ext2_clear_bit_atomic(lock, nr, addr) \
test_and_clear_le_bit((nr), (unsigned long *)(addr))
-#include <asm-generic/bitops/minix.h>
#endif /* __KERNEL__ */
diff --git a/arch/sh/include/asm/bitops.h b/arch/sh/include/asm/bitops.h
index fc5cd5b..90fa3e4 100644
--- a/arch/sh/include/asm/bitops.h
+++ b/arch/sh/include/asm/bitops.h
@@ -96,7 +96,6 @@ static inline unsigned long ffz(unsigned long word)
#include <asm-generic/bitops/sched.h>
#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-atomic.h>
-#include <asm-generic/bitops/minix.h>
#include <asm-generic/bitops/fls.h>
#include <asm-generic/bitops/__fls.h>
#include <asm-generic/bitops/fls64.h>
diff --git a/arch/sparc/include/asm/bitops_32.h b/arch/sparc/include/asm/bitops_32.h
index 75da6f8..25a6766 100644
--- a/arch/sparc/include/asm/bitops_32.h
+++ b/arch/sparc/include/asm/bitops_32.h
@@ -105,7 +105,6 @@ static inline void change_bit(unsigned long nr, volatile unsigned long *addr)
#include <asm-generic/bitops/find.h>
#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-atomic.h>
-#include <asm-generic/bitops/minix.h>
#endif /* __KERNEL__ */
diff --git a/arch/sparc/include/asm/bitops_64.h b/arch/sparc/include/asm/bitops_64.h
index 66db28e..38e9aa1 100644
--- a/arch/sparc/include/asm/bitops_64.h
+++ b/arch/sparc/include/asm/bitops_64.h
@@ -96,8 +96,6 @@ static inline unsigned int __arch_hweight8(unsigned int w)
#define ext2_clear_bit_atomic(lock,nr,addr) \
test_and_clear_bit((nr) ^ 0x38,(unsigned long *)(addr))
-#include <asm-generic/bitops/minix.h>
-
#endif /* __KERNEL__ */
#endif /* defined(_SPARC64_BITOPS_H) */
diff --git a/arch/tile/include/asm/bitops.h b/arch/tile/include/asm/bitops.h
index 5447add..132e6bb 100644
--- a/arch/tile/include/asm/bitops.h
+++ b/arch/tile/include/asm/bitops.h
@@ -123,6 +123,5 @@ static inline unsigned long __arch_hweight64(__u64 w)
#include <asm-generic/bitops/find.h>
#include <asm-generic/bitops/sched.h>
#include <asm-generic/bitops/le.h>
-#include <asm-generic/bitops/minix.h>
#endif /* _ASM_TILE_BITOPS_H */
diff --git a/arch/x86/include/asm/bitops.h b/arch/x86/include/asm/bitops.h
index 3c95e07..69d5813 100644
--- a/arch/x86/include/asm/bitops.h
+++ b/arch/x86/include/asm/bitops.h
@@ -463,7 +463,5 @@ static inline int fls(int x)
#define ext2_clear_bit_atomic(lock, nr, addr) \
test_and_clear_bit((nr), (unsigned long *)(addr))
-#include <asm-generic/bitops/minix.h>
-
#endif /* __KERNEL__ */
#endif /* _ASM_X86_BITOPS_H */
diff --git a/arch/xtensa/include/asm/bitops.h b/arch/xtensa/include/asm/bitops.h
index a56b7b5..c8fac8d 100644
--- a/arch/xtensa/include/asm/bitops.h
+++ b/arch/xtensa/include/asm/bitops.h
@@ -125,7 +125,6 @@ static inline unsigned long __fls(unsigned long word)
#include <asm-generic/bitops/hweight.h>
#include <asm-generic/bitops/lock.h>
#include <asm-generic/bitops/sched.h>
-#include <asm-generic/bitops/minix.h>
#endif /* __KERNEL__ */
diff --git a/fs/minix/Kconfig b/fs/minix/Kconfig
index 0fd7ca9..6624684 100644
--- a/fs/minix/Kconfig
+++ b/fs/minix/Kconfig
@@ -15,3 +15,11 @@ config MINIX_FS
module will be called minix. Note that the file system of your root
partition (the one containing the directory /) cannot be compiled as
a module.
+
+config MINIX_FS_NATIVE_ENDIAN
+ def_bool MINIX_FS
+ depends on H8300 || M32R || MICROBLAZE || MIPS || S390 || SUPERH || SPARC || XTENSA || (M68K && !MMU)
+
+config MINIX_FS_BIG_ENDIAN_16BIT_INDEXED
+ def_bool MINIX_FS
+ depends on M68K && MMU
diff --git a/fs/minix/minix.h b/fs/minix/minix.h
index 407b1c8..9dfd62c 100644
--- a/fs/minix/minix.h
+++ b/fs/minix/minix.h
@@ -88,4 +88,83 @@ static inline struct minix_inode_info *minix_i(struct inode *inode)
return list_entry(inode, struct minix_inode_info, vfs_inode);
}
+#if defined(CONFIG_MINIX_FS_NATIVE_ENDIAN) && \
+ defined(CONFIG_MINIX_FS_BIG_ENDIAN_16BIT_INDEXED)
+
+#error Minix file system byte order broken
+
+#elif defined(CONFIG_MINIX_FS_NATIVE_ENDIAN)
+
+/*
+ * big-endian 32 or 64 bit indexed bitmaps on big-endian system or
+ * little-endian bitmaps on little-endian system
+ */
+
+#define minix_test_and_set_bit(nr, addr) \
+ __test_and_set_bit((nr), (unsigned long *)(addr))
+#define minix_set_bit(nr, addr) \
+ __set_bit((nr), (unsigned long *)(addr))
+#define minix_test_and_clear_bit(nr, addr) \
+ __test_and_clear_bit((nr), (unsigned long *)(addr))
+#define minix_test_bit(nr, addr) \
+ test_bit((nr), (unsigned long *)(addr))
+#define minix_find_first_zero_bit(addr, size) \
+ find_first_zero_bit((unsigned long *)(addr), (size))
+
+#elif defined(CONFIG_MINIX_FS_BIG_ENDIAN_16BIT_INDEXED)
+
+/*
+ * big-endian 16bit indexed bitmaps
+ */
+
+static inline int minix_find_first_zero_bit(const void *vaddr, unsigned size)
+{
+ const unsigned short *p = vaddr, *addr = vaddr;
+ unsigned short num;
+
+ if (!size)
+ return 0;
+
+ size = (size >> 4) + ((size & 15) > 0);
+ while (*p++ == 0xffff) {
+ if (--size == 0)
+ return (p - addr) << 4;
+ }
+
+ num = *--p;
+ return ((p - addr) << 4) + ffz(num);
+}
+
+#define minix_test_and_set_bit(nr, addr) \
+ __test_and_set_bit((nr) ^ 16, (unsigned long *)(addr))
+#define minix_set_bit(nr, addr) \
+ __set_bit((nr) ^ 16, (unsigned long *)(addr))
+#define minix_test_and_clear_bit(nr, addr) \
+ __test_and_clear_bit((nr) ^ 16, (unsigned long *)(addr))
+
+static inline int minix_test_bit(int nr, const void *vaddr)
+{
+ const unsigned short *p = vaddr;
+ return (p[nr >> 4] & (1U << (nr & 15))) != 0;
+}
+
+#else
+
+/*
+ * little-endian bitmaps
+ */
+
+#define minix_test_and_set_bit(nr, addr) \
+ __test_and_set_le_bit((nr), (unsigned long *)(addr))
+#define minix_set_bit(nr, addr) \
+ __set_le_bit((nr), (unsigned long *)(addr))
+#define minix_test_and_clear_bit(nr, addr) \
+ __test_and_clear_le_bit((nr), (unsigned long *)(addr))
+#define minix_test_bit(nr, addr) \
+ test_le_bit((nr), (unsigned long *)(addr))
+#define minix_find_first_zero_bit(addr, size) \
+ find_first_zero_le_bit((unsigned long *)(addr), (size))
+
+#endif
+
#endif /* FS_MINIX_H */
diff --git a/include/asm-generic/bitops.h b/include/asm-generic/bitops.h
index dd7c014..280ca7a 100644
--- a/include/asm-generic/bitops.h
+++ b/include/asm-generic/bitops.h
@@ -40,6 +40,5 @@
#include <asm-generic/bitops/non-atomic.h>
#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-atomic.h>
-#include <asm-generic/bitops/minix.h>
#endif /* __ASM_GENERIC_BITOPS_H */
diff --git a/include/asm-generic/bitops/minix-le.h b/include/asm-generic/bitops/minix-le.h
deleted file mode 100644
index f366cfa..0000000
--- a/include/asm-generic/bitops/minix-le.h
+++ /dev/null
@@ -1,15 +0,0 @@
-#ifndef _ASM_GENERIC_BITOPS_MINIX_LE_H_
-#define _ASM_GENERIC_BITOPS_MINIX_LE_H_
-
-#define minix_test_and_set_bit(nr,addr) \
- __test_and_set_le_bit((nr), (unsigned long *)(addr))
-#define minix_set_bit(nr,addr) \
- __set_le_bit((nr), (unsigned long *)(addr))
-#define minix_test_and_clear_bit(nr,addr) \
- __test_and_clear_le_bit((nr), (unsigned long *)(addr))
-#define minix_test_bit(nr,addr) \
- test_le_bit((nr), (unsigned long *)(addr))
-#define minix_find_first_zero_bit(addr,size) \
- find_first_zero_le_bit((unsigned long *)(addr), (size))
-
-#endif /* _ASM_GENERIC_BITOPS_MINIX_LE_H_ */
diff --git a/include/asm-generic/bitops/minix.h b/include/asm-generic/bitops/minix.h
deleted file mode 100644
index 91f42e8..0000000
--- a/include/asm-generic/bitops/minix.h
+++ /dev/null
@@ -1,15 +0,0 @@
-#ifndef _ASM_GENERIC_BITOPS_MINIX_H_
-#define _ASM_GENERIC_BITOPS_MINIX_H_
-
-#define minix_test_and_set_bit(nr,addr) \
- __test_and_set_bit((nr),(unsigned long *)(addr))
-#define minix_set_bit(nr,addr) \
- __set_bit((nr),(unsigned long *)(addr))
-#define minix_test_and_clear_bit(nr,addr) \
- __test_and_clear_bit((nr),(unsigned long *)(addr))
-#define minix_test_bit(nr,addr) \
- test_bit((nr),(unsigned long *)(addr))
-#define minix_find_first_zero_bit(addr,size) \
- find_first_zero_bit((unsigned long *)(addr),(size))
-
-#endif /* _ASM_GENERIC_BITOPS_MINIX_H_ */
--
1.7.1.231.gd0b16
^ permalink raw reply related [flat|nested] 75+ messages in thread
end of thread, other threads:[~2010-10-19 15:07 UTC | newest]
Thread overview: 75+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-15 9:45 [PATCH 00/22] Introduce little endian bitops Akinobu Mita
2010-10-15 9:45 ` Akinobu Mita
2010-10-15 9:46 ` [PATCH 01/22] bitops: merge little and big endian definisions in asm-generic/bitops/le.h Akinobu Mita
2010-10-15 9:46 ` [PATCH 02/22] bitops: rename generic le bitops functions Akinobu Mita
2010-10-15 9:46 ` Akinobu Mita
2010-10-15 9:46 ` [PATCH 03/22] s390: introduce little endian bitops Akinobu Mita
2010-10-15 9:46 ` Akinobu Mita
2010-10-15 11:12 ` Arnd Bergmann
2010-10-18 4:51 ` Akinobu Mita
2010-10-15 9:46 ` [PATCH 04/22] arm: " Akinobu Mita
2010-10-18 9:26 ` Russell King - ARM Linux
2010-10-18 9:26 ` Russell King - ARM Linux
2010-10-18 13:22 ` Akinobu Mita
2010-10-18 13:22 ` Akinobu Mita
2010-10-18 13:56 ` Russell King - ARM Linux
2010-10-18 14:45 ` Arnd Bergmann
2010-10-18 15:07 ` Russell King - ARM Linux
2010-10-18 15:07 ` Russell King - ARM Linux
2010-10-18 13:58 ` Russell King - ARM Linux
2010-10-18 13:58 ` Russell King - ARM Linux
2010-10-15 9:46 ` [PATCH 05/22] m68k: introduce le bitops Akinobu Mita
2010-10-15 9:46 ` Akinobu Mita
2010-10-15 9:46 ` [PATCH 06/22] m68knommu: introduce little endian bitops Akinobu Mita
2010-10-15 9:46 ` Akinobu Mita
2010-10-15 9:46 ` [PATCH 07/22] bitops: introduce little endian bitops for most architectures Akinobu Mita
2010-10-15 9:46 ` Akinobu Mita
2010-10-15 9:46 ` [PATCH 08/22] rds: stop including asm-generic/bitops/le.h Akinobu Mita
2010-10-15 9:46 ` [PATCH 09/22] kvm: " Akinobu Mita
2010-10-15 9:46 ` [PATCH 10/22] asm-generic: use little endian bitops Akinobu Mita
2010-10-15 11:06 ` Arnd Bergmann
2010-10-15 9:46 ` [PATCH 11/22] ext3: " Akinobu Mita
2010-10-15 9:46 ` Akinobu Mita
2010-10-18 10:31 ` Jan Kara
2010-10-18 10:31 ` Jan Kara
2010-10-15 9:46 ` [PATCH 12/22] ext4: " Akinobu Mita
2010-10-15 9:46 ` Akinobu Mita
2010-10-15 9:46 ` [PATCH 13/22] ocfs2: " Akinobu Mita
2010-10-18 20:19 ` Joel Becker
2010-10-18 20:19 ` Joel Becker
2010-10-15 9:46 ` [PATCH 14/22] nilfs2: " Akinobu Mita
2010-10-15 9:46 ` Akinobu Mita
2010-10-15 9:46 ` [PATCH 15/22] reiserfs: " Akinobu Mita
2010-10-15 9:46 ` Akinobu Mita
2010-10-15 9:46 ` [PATCH 16/22] udf: " Akinobu Mita
2010-10-15 9:46 ` Akinobu Mita
2010-10-18 10:46 ` Jan Kara
2010-10-15 9:46 ` [PATCH 17/22] ufs: " Akinobu Mita
2010-10-15 9:46 ` Akinobu Mita
2010-10-15 9:46 ` [PATCH 18/22] md: use little endian bit operations Akinobu Mita
2010-10-18 2:41 ` Neil Brown
2010-10-15 9:46 ` [PATCH 19/22] dm: " Akinobu Mita
2010-10-15 9:46 ` Akinobu Mita
2010-10-15 9:46 ` [PATCH 20/22] bitops: remove ext2 non-atomic bitops from asm/bitops.h Akinobu Mita
2010-10-15 9:46 ` Akinobu Mita
2010-10-15 9:46 ` [PATCH 21/22] m68k: convert minix bitops to use little endian bitops Akinobu Mita
2010-10-15 9:46 ` Akinobu Mita
2010-10-18 8:58 ` Andreas Schwab
2010-10-18 8:58 ` Andreas Schwab
2010-10-15 9:46 ` [PATCH 22/22] bitops: remove minix bitops from asm/bitops.h Akinobu Mita
2010-10-15 10:53 ` Arnd Bergmann
2010-10-15 18:53 ` Mike Frysinger
2010-10-15 20:15 ` Arnd Bergmann
2010-10-15 20:15 ` Arnd Bergmann
2010-10-16 7:59 ` Geert Uytterhoeven
2010-10-16 7:59 ` Geert Uytterhoeven
2010-10-16 8:50 ` Andreas Schwab
2010-10-16 11:35 ` Geert Uytterhoeven
2010-10-16 12:40 ` Akinobu Mita
2010-10-16 12:57 ` Andreas Schwab
2010-10-16 12:57 ` Andreas Schwab
2010-10-16 13:47 ` Akinobu Mita
2010-10-16 13:47 ` Akinobu Mita
2010-10-16 15:58 ` Andreas Schwab
2010-10-19 15:05 ` Akinobu Mita
2010-10-15 11:14 ` [PATCH 00/22] Introduce little endian bitops Arnd Bergmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).