Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030452AbWBNFRG (ORCPT ); Tue, 14 Feb 2006 00:17:06 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1030385AbWBNFNe (ORCPT ); Tue, 14 Feb 2006 00:13:34 -0500 Received: from ns.miraclelinux.com ([219.118.163.66]:32463 "EHLO mail01.miraclelinux.com") by vger.kernel.org with ESMTP id S1030384AbWBNFFG (ORCPT ); Tue, 14 Feb 2006 00:05:06 -0500 Message-Id: <20060214050445.011576000@localhost.localdomain> References: <20060214050351.252615000@localhost.localdomain> Date: Tue, 14 Feb 2006 14:04:08 +0900 From: Akinobu Mita To: linux-kernel@vger.kernel.org Cc: akpm@osdl.org, Yoshinori Sato , Hirokazu Takata , linux-mips@linux-mips.org, linuxsh-dev@lists.sourceforge.net, linuxsh-shmedia-dev@lists.sourceforge.net, sparclinux@vger.kernel.org, Akinobu Mita Subject: [patch 17/47] generic ext2_{set,clear}_bit_atomic() Content-Disposition: inline; filename=ext2-atomic-bitops.patch Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1472 Lines: 48 This patch introduces the C-language equivalents of the functions below: int ext2_set_bit_atomic(int nr, volatile unsigned long *addr); int ext2_clear_bit_atomic(int nr, volatile unsigned long *addr); In include/asm-generic/bitops/ext2-atomic.h This code largely copied from: include/asm-sparc/bitops.h Signed-off-by: Akinobu Mita include/asm-generic/bitops/ext2-atomic.h | 22 ++++++++++++++++++++++ 1 files changed, 22 insertions(+) Index: 2.6-rc/include/asm-generic/bitops/ext2-atomic.h =================================================================== --- /dev/null +++ 2.6-rc/include/asm-generic/bitops/ext2-atomic.h @@ -0,0 +1,22 @@ +#ifndef _ASM_GENERIC_BITOPS_EXT2_ATOMIC_H_ +#define _ASM_GENERIC_BITOPS_EXT2_ATOMIC_H_ + +#define ext2_set_bit_atomic(lock, nr, addr) \ + ({ \ + int ret; \ + spin_lock(lock); \ + ret = ext2_set_bit((nr), (unsigned long *)(addr)); \ + spin_unlock(lock); \ + ret; \ + }) + +#define ext2_clear_bit_atomic(lock, nr, addr) \ + ({ \ + int ret; \ + spin_lock(lock); \ + ret = ext2_clear_bit((nr), (unsigned long *)(addr)); \ + spin_unlock(lock); \ + ret; \ + }) + +#endif /* _ASM_GENERIC_BITOPS_EXT2_ATOMIC_H_ */ -- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/