From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Subject: Re: [patch 4/6] brlock: introduce special brlocks Date: Sun, 18 Oct 2009 22:25:12 -0700 Message-ID: <20091018222512.683973f7.akpm@linux-foundation.org> References: <20091015044026.319860788@suse.de> <20091015050048.777261867@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Al Viro , linux-fsdevel@vger.kernel.org, Ian Kent , Linus Torvalds , linux-kernel@vger.kernel.org To: npiggin@suse.de Return-path: In-Reply-To: <20091015050048.777261867@suse.de> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Thu, 15 Oct 2009 15:40:30 +1100 npiggin@suse.de wrote: > +#define DECLARE_BRLOCK(name) \ This: > + DECLARE_PER_CPU(spinlock_t, name##_lock); \ > + static inline void name##_lock_init(void) { \ > + int i; \ > + for_each_possible_cpu(i) { \ > + spinlock_t *lock; \ > + lock = &per_cpu(name##_lock, i); \ > + spin_lock_init(lock); \ > + } \ > + } \ > + static inline void name##_rlock(void) { \ > + spinlock_t *lock; \ > + lock = &get_cpu_var(name##_lock); \ > + spin_lock(lock); \ > + } \ generates a definition, not a declaration. Hence DEFINE_BRLOCK.