aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2011-03-23 19:42:16 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-03-23 22:46:22 -0400
commit61f2e7b0f474225b4226772830ae4b29a3a21f8d (patch)
tree52f880fe6feec8efe5e5e028a3e0637629a500b7 /arch
parent3fca5af7860f87eb2cd706c2d7dda4ad03230a07 (diff)
bitops: remove minix bitops from asm/bitops.h
minix bit operations are only used by minix filesystem and useless by other modules. Because byte order of inode and block bitmaps is different on each architecture like below: m68k: big-endian 16bit indexed bitmaps h8300, microblaze, s390, sparc, m68knommu: big-endian 32 or 64bit indexed bitmaps m32r, mips, sh, xtensa: big-endian 32 or 64bit indexed bitmaps for big-endian mode little-endian bitmaps for little-endian mode Others: little-endian bitmaps In order to move minix bit operations from asm/bitops.h to architecture independent code in minix filesystem, this provides two config options. CONFIG_MINIX_FS_BIG_ENDIAN_16BIT_INDEXED is only selected by m68k. CONFIG_MINIX_FS_NATIVE_ENDIAN is selected by the architectures which use native byte order bitmaps (h8300, microblaze, s390, sparc, m68knommu, m32r, mips, sh, xtensa). The architectures which always use little-endian bitmaps do not select these options. Finally, we can remove minix bit operations from asm/bitops.h for all architectures. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Greg Ungerer <gerg@uclinux.org> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Roman Zippel <zippel@linux-m68k.org> Cc: Andreas Schwab <schwab@linux-m68k.org> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: Yoshinori Sato <ysato@users.sourceforge.jp> Cc: Michal Simek <monstr@monstr.eu> Cc: "David S. Miller" <davem@davemloft.net> Cc: Hirokazu Takata <takata@linux-m32r.org> Acked-by: Ralf Baechle <ralf@linux-mips.org> Acked-by: Paul Mundt <lethal@linux-sh.org> Cc: Chris Zankel <chris@zankel.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/alpha/include/asm/bitops.h2
-rw-r--r--arch/arm/include/asm/bitops.h10
-rw-r--r--arch/avr32/include/asm/bitops.h1
-rw-r--r--arch/blackfin/include/asm/bitops.h1
-rw-r--r--arch/cris/include/asm/bitops.h1
-rw-r--r--arch/frv/include/asm/bitops.h2
-rw-r--r--arch/h8300/include/asm/bitops.h1
-rw-r--r--arch/ia64/include/asm/bitops.h1
-rw-r--r--arch/m32r/include/asm/bitops.h1
-rw-r--r--arch/m68k/include/asm/bitops_mm.h30
-rw-r--r--arch/m68k/include/asm/bitops_no.h2
-rw-r--r--arch/mips/include/asm/bitops.h1
-rw-r--r--arch/mn10300/include/asm/bitops.h1
-rw-r--r--arch/parisc/include/asm/bitops.h2
-rw-r--r--arch/powerpc/include/asm/bitops.h14
-rw-r--r--arch/s390/include/asm/bitops.h1
-rw-r--r--arch/sh/include/asm/bitops.h1
-rw-r--r--arch/sparc/include/asm/bitops_32.h1
-rw-r--r--arch/sparc/include/asm/bitops_64.h2
-rw-r--r--arch/tile/include/asm/bitops.h1
-rw-r--r--arch/x86/include/asm/bitops.h2
-rw-r--r--arch/xtensa/include/asm/bitops.h1
22 files changed, 0 insertions, 79 deletions
diff --git a/arch/alpha/include/asm/bitops.h b/arch/alpha/include/asm/bitops.h
index 822433a00c6..85b81521577 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])
459#define ext2_set_bit_atomic(l,n,a) test_and_set_bit(n,a) 459#define ext2_set_bit_atomic(l,n,a) test_and_set_bit(n,a)
460#define ext2_clear_bit_atomic(l,n,a) test_and_clear_bit(n,a) 460#define ext2_clear_bit_atomic(l,n,a) test_and_clear_bit(n,a)
461 461
462#include <asm-generic/bitops/minix.h>
463
464#endif /* __KERNEL__ */ 462#endif /* __KERNEL__ */
465 463
466#endif /* _ALPHA_BITOPS_H */ 464#endif /* _ALPHA_BITOPS_H */
diff --git a/arch/arm/include/asm/bitops.h b/arch/arm/include/asm/bitops.h
index f68f1fb6b38..6b7403fd8f5 100644
--- a/arch/arm/include/asm/bitops.h
+++ b/arch/arm/include/asm/bitops.h
@@ -345,16 +345,6 @@ static inline int find_next_bit_le(const void *p, int size, int offset)
345#define ext2_clear_bit_atomic(lock, nr, p) \ 345#define ext2_clear_bit_atomic(lock, nr, p) \
346 test_and_clear_bit_le(nr, p) 346 test_and_clear_bit_le(nr, p)
347 347
348/*
349 * Minix is defined to use little-endian byte ordering.
350 * These do not need to be atomic.
351 */
352#define minix_set_bit __set_bit_le
353#define minix_test_bit test_bit_le
354#define minix_test_and_set_bit __test_and_set_bit_le
355#define minix_test_and_clear_bit __test_and_clear_bit_le
356#define minix_find_first_zero_bit find_first_zero_bit_le
357
358#endif /* __KERNEL__ */ 348#endif /* __KERNEL__ */
359 349
360#endif /* _ARM_BITOPS_H */ 350#endif /* _ARM_BITOPS_H */
diff --git a/arch/avr32/include/asm/bitops.h b/arch/avr32/include/asm/bitops.h
index 73a163a71f1..72444d97f80 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)
301 301
302#include <asm-generic/bitops/le.h> 302#include <asm-generic/bitops/le.h>
303#include <asm-generic/bitops/ext2-atomic.h> 303#include <asm-generic/bitops/ext2-atomic.h>
304#include <asm-generic/bitops/minix-le.h>
305 304
306#endif /* __ASM_AVR32_BITOPS_H */ 305#endif /* __ASM_AVR32_BITOPS_H */
diff --git a/arch/blackfin/include/asm/bitops.h b/arch/blackfin/include/asm/bitops.h
index 6a69690bd46..49762c6bb0d 100644
--- a/arch/blackfin/include/asm/bitops.h
+++ b/arch/blackfin/include/asm/bitops.h
@@ -27,7 +27,6 @@
27 27
28#include <asm-generic/bitops/le.h> 28#include <asm-generic/bitops/le.h>
29#include <asm-generic/bitops/ext2-atomic.h> 29#include <asm-generic/bitops/ext2-atomic.h>
30#include <asm-generic/bitops/minix.h>
31 30
32#ifndef CONFIG_SMP 31#ifndef CONFIG_SMP
33#include <linux/irqflags.h> 32#include <linux/irqflags.h>
diff --git a/arch/cris/include/asm/bitops.h b/arch/cris/include/asm/bitops.h
index 71bea4032eb..310e0de67aa 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)
159#define ext2_set_bit_atomic(l,n,a) test_and_set_bit(n,a) 159#define ext2_set_bit_atomic(l,n,a) test_and_set_bit(n,a)
160#define ext2_clear_bit_atomic(l,n,a) test_and_clear_bit(n,a) 160#define ext2_clear_bit_atomic(l,n,a) test_and_clear_bit(n,a)
161 161
162#include <asm-generic/bitops/minix.h>
163#include <asm-generic/bitops/sched.h> 162#include <asm-generic/bitops/sched.h>
164 163
165#endif /* __KERNEL__ */ 164#endif /* __KERNEL__ */
diff --git a/arch/frv/include/asm/bitops.h b/arch/frv/include/asm/bitops.h
index e3ea644108c..a1d00b0c6ed 100644
--- a/arch/frv/include/asm/bitops.h
+++ b/arch/frv/include/asm/bitops.h
@@ -406,8 +406,6 @@ int __ilog2_u64(u64 n)
406#define ext2_set_bit_atomic(lock,nr,addr) test_and_set_bit ((nr) ^ 0x18, (addr)) 406#define ext2_set_bit_atomic(lock,nr,addr) test_and_set_bit ((nr) ^ 0x18, (addr))
407#define ext2_clear_bit_atomic(lock,nr,addr) test_and_clear_bit((nr) ^ 0x18, (addr)) 407#define ext2_clear_bit_atomic(lock,nr,addr) test_and_clear_bit((nr) ^ 0x18, (addr))
408 408
409#include <asm-generic/bitops/minix-le.h>
410
411#endif /* __KERNEL__ */ 409#endif /* __KERNEL__ */
412 410
413#endif /* _ASM_BITOPS_H */ 411#endif /* _ASM_BITOPS_H */
diff --git a/arch/h8300/include/asm/bitops.h b/arch/h8300/include/asm/bitops.h
index 23cea666898..e856c1bb341 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)
202#include <asm-generic/bitops/lock.h> 202#include <asm-generic/bitops/lock.h>
203#include <asm-generic/bitops/le.h> 203#include <asm-generic/bitops/le.h>
204#include <asm-generic/bitops/ext2-atomic.h> 204#include <asm-generic/bitops/ext2-atomic.h>
205#include <asm-generic/bitops/minix.h>
206 205
207#endif /* __KERNEL__ */ 206#endif /* __KERNEL__ */
208 207
diff --git a/arch/ia64/include/asm/bitops.h b/arch/ia64/include/asm/bitops.h
index 336984acc8c..b76f7e00921 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)
461#define ext2_set_bit_atomic(l,n,a) test_and_set_bit(n,a) 461#define ext2_set_bit_atomic(l,n,a) test_and_set_bit(n,a)
462#define ext2_clear_bit_atomic(l,n,a) test_and_clear_bit(n,a) 462#define ext2_clear_bit_atomic(l,n,a) test_and_clear_bit(n,a)
463 463
464#include <asm-generic/bitops/minix.h>
465#include <asm-generic/bitops/sched.h> 464#include <asm-generic/bitops/sched.h>
466 465
467#endif /* __KERNEL__ */ 466#endif /* __KERNEL__ */
diff --git a/arch/m32r/include/asm/bitops.h b/arch/m32r/include/asm/bitops.h
index cdfb4c82fb8..6300f22cdbd 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)
268 268
269#include <asm-generic/bitops/le.h> 269#include <asm-generic/bitops/le.h>
270#include <asm-generic/bitops/ext2-atomic.h> 270#include <asm-generic/bitops/ext2-atomic.h>
271#include <asm-generic/bitops/minix.h>
272 271
273#endif /* __KERNEL__ */ 272#endif /* __KERNEL__ */
274 273
diff --git a/arch/m68k/include/asm/bitops_mm.h b/arch/m68k/include/asm/bitops_mm.h
index a403b5e69aa..9d69f6e6236 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)
325#include <asm-generic/bitops/hweight.h> 325#include <asm-generic/bitops/hweight.h>
326#include <asm-generic/bitops/lock.h> 326#include <asm-generic/bitops/lock.h>
327 327
328/* Bitmap functions for the minix filesystem */
329
330static inline int minix_find_first_zero_bit(const void *vaddr, unsigned size)
331{
332 const unsigned short *p = vaddr, *addr = vaddr;
333 unsigned short num;
334
335 if (!size)
336 return 0;
337
338 size = (size >> 4) + ((size & 15) > 0);
339 while (*p++ == 0xffff) {
340 if (--size == 0)
341 return (p - addr) << 4;
342 }
343
344 num = *--p;
345 return ((p - addr) << 4) + ffz(num);
346}
347
348#define minix_test_and_set_bit(nr, addr) __test_and_set_bit((nr) ^ 16, (unsigned long *)(addr))
349#define minix_set_bit(nr,addr) __set_bit((nr) ^ 16, (unsigned long *)(addr))
350#define minix_test_and_clear_bit(nr, addr) __test_and_clear_bit((nr) ^ 16, (unsigned long *)(addr))
351
352static inline int minix_test_bit(int nr, const void *vaddr)
353{
354 const unsigned short *p = vaddr;
355 return (p[nr >> 4] & (1U << (nr & 15))) != 0;
356}
357
358/* Bitmap functions for the little endian bitmap. */ 328/* Bitmap functions for the little endian bitmap. */
359 329
360static inline void __set_bit_le(int nr, void *addr) 330static inline void __set_bit_le(int nr, void *addr)
diff --git a/arch/m68k/include/asm/bitops_no.h b/arch/m68k/include/asm/bitops_no.h
index 8db5fef8631..7d3779fdc5b 100644
--- a/arch/m68k/include/asm/bitops_no.h
+++ b/arch/m68k/include/asm/bitops_no.h
@@ -336,8 +336,6 @@ found_middle:
336 return result + ffz(__swab32(tmp)); 336 return result + ffz(__swab32(tmp));
337} 337}
338 338
339#include <asm-generic/bitops/minix.h>
340
341#endif /* __KERNEL__ */ 339#endif /* __KERNEL__ */
342 340
343#include <asm-generic/bitops/fls.h> 341#include <asm-generic/bitops/fls.h>
diff --git a/arch/mips/include/asm/bitops.h b/arch/mips/include/asm/bitops.h
index e062718a3fe..2e1ad4c652b 100644
--- a/arch/mips/include/asm/bitops.h
+++ b/arch/mips/include/asm/bitops.h
@@ -678,7 +678,6 @@ static inline int ffs(int word)
678 678
679#include <asm-generic/bitops/le.h> 679#include <asm-generic/bitops/le.h>
680#include <asm-generic/bitops/ext2-atomic.h> 680#include <asm-generic/bitops/ext2-atomic.h>
681#include <asm-generic/bitops/minix.h>
682 681
683#endif /* __KERNEL__ */ 682#endif /* __KERNEL__ */
684 683
diff --git a/arch/mn10300/include/asm/bitops.h b/arch/mn10300/include/asm/bitops.h
index a5f460cb834..0939462967e 100644
--- a/arch/mn10300/include/asm/bitops.h
+++ b/arch/mn10300/include/asm/bitops.h
@@ -234,7 +234,6 @@ int ffs(int x)
234 test_and_clear_bit((nr), (addr)) 234 test_and_clear_bit((nr), (addr))
235 235
236#include <asm-generic/bitops/le.h> 236#include <asm-generic/bitops/le.h>
237#include <asm-generic/bitops/minix-le.h>
238 237
239#endif /* __KERNEL__ */ 238#endif /* __KERNEL__ */
240#endif /* __ASM_BITOPS_H */ 239#endif /* __ASM_BITOPS_H */
diff --git a/arch/parisc/include/asm/bitops.h b/arch/parisc/include/asm/bitops.h
index 919d7ed155e..43c516fa17f 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)
234 234
235#endif /* __KERNEL__ */ 235#endif /* __KERNEL__ */
236 236
237#include <asm-generic/bitops/minix-le.h>
238
239#endif /* _PARISC_BITOPS_H */ 237#endif /* _PARISC_BITOPS_H */
diff --git a/arch/powerpc/include/asm/bitops.h b/arch/powerpc/include/asm/bitops.h
index e3bd9a3bcb4..2e561876fc8 100644
--- a/arch/powerpc/include/asm/bitops.h
+++ b/arch/powerpc/include/asm/bitops.h
@@ -332,20 +332,6 @@ unsigned long find_next_bit_le(const void *addr,
332#define ext2_clear_bit_atomic(lock, nr, addr) \ 332#define ext2_clear_bit_atomic(lock, nr, addr) \
333 test_and_clear_bit_le((nr), (unsigned long*)addr) 333 test_and_clear_bit_le((nr), (unsigned long*)addr)
334 334
335/* Bitmap functions for the minix filesystem. */
336
337#define minix_test_and_set_bit(nr,addr) \
338 __test_and_set_bit_le(nr, (unsigned long *)addr)
339#define minix_set_bit(nr,addr) \
340 __set_bit_le(nr, (unsigned long *)addr)
341#define minix_test_and_clear_bit(nr,addr) \
342 __test_and_clear_bit_le(nr, (unsigned long *)addr)
343#define minix_test_bit(nr,addr) \
344 test_bit_le(nr, (unsigned long *)addr)
345
346#define minix_find_first_zero_bit(addr,size) \
347 find_first_zero_bit_le((unsigned long *)addr, size)
348
349#include <asm-generic/bitops/sched.h> 335#include <asm-generic/bitops/sched.h>
350 336
351#endif /* __KERNEL__ */ 337#endif /* __KERNEL__ */
diff --git a/arch/s390/include/asm/bitops.h b/arch/s390/include/asm/bitops.h
index 2dd32bba47e..e1c8f3a4988 100644
--- a/arch/s390/include/asm/bitops.h
+++ b/arch/s390/include/asm/bitops.h
@@ -862,7 +862,6 @@ static inline int find_next_bit_le(void *vaddr, unsigned long size,
862#define ext2_clear_bit_atomic(lock, nr, addr) \ 862#define ext2_clear_bit_atomic(lock, nr, addr) \
863 test_and_clear_bit_le(nr, addr) 863 test_and_clear_bit_le(nr, addr)
864 864
865#include <asm-generic/bitops/minix.h>
866 865
867#endif /* __KERNEL__ */ 866#endif /* __KERNEL__ */
868 867
diff --git a/arch/sh/include/asm/bitops.h b/arch/sh/include/asm/bitops.h
index fc5cd5b9b44..90fa3e48b4d 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)
96#include <asm-generic/bitops/sched.h> 96#include <asm-generic/bitops/sched.h>
97#include <asm-generic/bitops/le.h> 97#include <asm-generic/bitops/le.h>
98#include <asm-generic/bitops/ext2-atomic.h> 98#include <asm-generic/bitops/ext2-atomic.h>
99#include <asm-generic/bitops/minix.h>
100#include <asm-generic/bitops/fls.h> 99#include <asm-generic/bitops/fls.h>
101#include <asm-generic/bitops/__fls.h> 100#include <asm-generic/bitops/__fls.h>
102#include <asm-generic/bitops/fls64.h> 101#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 75da6f82a12..25a676653d4 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)
105#include <asm-generic/bitops/find.h> 105#include <asm-generic/bitops/find.h>
106#include <asm-generic/bitops/le.h> 106#include <asm-generic/bitops/le.h>
107#include <asm-generic/bitops/ext2-atomic.h> 107#include <asm-generic/bitops/ext2-atomic.h>
108#include <asm-generic/bitops/minix.h>
109 108
110#endif /* __KERNEL__ */ 109#endif /* __KERNEL__ */
111 110
diff --git a/arch/sparc/include/asm/bitops_64.h b/arch/sparc/include/asm/bitops_64.h
index 66db28e6bbf..38e9aa1b2ce 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)
96#define ext2_clear_bit_atomic(lock,nr,addr) \ 96#define ext2_clear_bit_atomic(lock,nr,addr) \
97 test_and_clear_bit((nr) ^ 0x38,(unsigned long *)(addr)) 97 test_and_clear_bit((nr) ^ 0x38,(unsigned long *)(addr))
98 98
99#include <asm-generic/bitops/minix.h>
100
101#endif /* __KERNEL__ */ 99#endif /* __KERNEL__ */
102 100
103#endif /* defined(_SPARC64_BITOPS_H) */ 101#endif /* defined(_SPARC64_BITOPS_H) */
diff --git a/arch/tile/include/asm/bitops.h b/arch/tile/include/asm/bitops.h
index 5447addafca..132e6bbd07e 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)
123#include <asm-generic/bitops/find.h> 123#include <asm-generic/bitops/find.h>
124#include <asm-generic/bitops/sched.h> 124#include <asm-generic/bitops/sched.h>
125#include <asm-generic/bitops/le.h> 125#include <asm-generic/bitops/le.h>
126#include <asm-generic/bitops/minix.h>
127 126
128#endif /* _ASM_TILE_BITOPS_H */ 127#endif /* _ASM_TILE_BITOPS_H */
diff --git a/arch/x86/include/asm/bitops.h b/arch/x86/include/asm/bitops.h
index 3c95e072c17..69d58131bc8 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)
463#define ext2_clear_bit_atomic(lock, nr, addr) \ 463#define ext2_clear_bit_atomic(lock, nr, addr) \
464 test_and_clear_bit((nr), (unsigned long *)(addr)) 464 test_and_clear_bit((nr), (unsigned long *)(addr))
465 465
466#include <asm-generic/bitops/minix.h>
467
468#endif /* __KERNEL__ */ 466#endif /* __KERNEL__ */
469#endif /* _ASM_X86_BITOPS_H */ 467#endif /* _ASM_X86_BITOPS_H */
diff --git a/arch/xtensa/include/asm/bitops.h b/arch/xtensa/include/asm/bitops.h
index a56b7b577f0..c8fac8d8190 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)
125#include <asm-generic/bitops/hweight.h> 125#include <asm-generic/bitops/hweight.h>
126#include <asm-generic/bitops/lock.h> 126#include <asm-generic/bitops/lock.h>
127#include <asm-generic/bitops/sched.h> 127#include <asm-generic/bitops/sched.h>
128#include <asm-generic/bitops/minix.h>
129 128
130#endif /* __KERNEL__ */ 129#endif /* __KERNEL__ */
131 130