diff options
author | Akinobu Mita <mita@miraclelinux.com> | 2006-03-26 01:39:05 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-26 08:57:10 -0800 |
commit | 67b0ad574b5ee90f8ea58196ff8a7f3780b75365 (patch) | |
tree | ca9bc212f6efa8f5170185ef1fa21f75de0684fd /include/asm-sh/bitops.h | |
parent | 72b61a3cfd80d1321eb898be8ceae2064f0fbea1 (diff) | |
download | kernel_samsung_smdk4412-67b0ad574b5ee90f8ea58196ff8a7f3780b75365.zip kernel_samsung_smdk4412-67b0ad574b5ee90f8ea58196ff8a7f3780b75365.tar.gz kernel_samsung_smdk4412-67b0ad574b5ee90f8ea58196ff8a7f3780b75365.tar.bz2 |
[PATCH] bitops: use non atomic operations for minix_*_bit() and ext2_*_bit()
Bitmap functions for the minix filesystem and the ext2 filesystem except
ext2_set_bit_atomic() and ext2_clear_bit_atomic() do not require the atomic
guarantees.
But these are defined by using atomic bit operations on several architectures.
(cris, frv, h8300, ia64, m32r, m68k, m68knommu, mips, s390, sh, sh64, sparc,
sparc64, v850, and xtensa)
This patch switches to non atomic bit operation.
Signed-off-by: Akinobu Mita <mita@miraclelinux.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-sh/bitops.h')
-rw-r--r-- | include/asm-sh/bitops.h | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/include/asm-sh/bitops.h b/include/asm-sh/bitops.h index 1c52608..f8d504e 100644 --- a/include/asm-sh/bitops.h +++ b/include/asm-sh/bitops.h @@ -339,8 +339,8 @@ static inline int sched_find_first_bit(const unsigned long *b) } #ifdef __LITTLE_ENDIAN__ -#define ext2_set_bit(nr, addr) test_and_set_bit((nr), (addr)) -#define ext2_clear_bit(nr, addr) test_and_clear_bit((nr), (addr)) +#define ext2_set_bit(nr, addr) __test_and_set_bit((nr), (addr)) +#define ext2_clear_bit(nr, addr) __test_and_clear_bit((nr), (addr)) #define ext2_test_bit(nr, addr) test_bit((nr), (addr)) #define ext2_find_first_zero_bit(addr, size) find_first_zero_bit((addr), (size)) #define ext2_find_next_zero_bit(addr, size, offset) \ @@ -349,30 +349,24 @@ static inline int sched_find_first_bit(const unsigned long *b) static __inline__ int ext2_set_bit(int nr, volatile void * addr) { int mask, retval; - unsigned long flags; volatile unsigned char *ADDR = (unsigned char *) addr; ADDR += nr >> 3; mask = 1 << (nr & 0x07); - local_irq_save(flags); retval = (mask & *ADDR) != 0; *ADDR |= mask; - local_irq_restore(flags); return retval; } static __inline__ int ext2_clear_bit(int nr, volatile void * addr) { int mask, retval; - unsigned long flags; volatile unsigned char *ADDR = (unsigned char *) addr; ADDR += nr >> 3; mask = 1 << (nr & 0x07); - local_irq_save(flags); retval = (mask & *ADDR) != 0; *ADDR &= ~mask; - local_irq_restore(flags); return retval; } @@ -459,9 +453,9 @@ found_middle: }) /* Bitmap functions for the minix filesystem. */ -#define minix_test_and_set_bit(nr,addr) test_and_set_bit(nr,addr) -#define minix_set_bit(nr,addr) set_bit(nr,addr) -#define minix_test_and_clear_bit(nr,addr) test_and_clear_bit(nr,addr) +#define minix_test_and_set_bit(nr,addr) __test_and_set_bit(nr,addr) +#define minix_set_bit(nr,addr) __set_bit(nr,addr) +#define minix_test_and_clear_bit(nr,addr) __test_and_clear_bit(nr,addr) #define minix_test_bit(nr,addr) test_bit(nr,addr) #define minix_find_first_zero_bit(addr,size) find_first_zero_bit(addr,size) |