Re: 2.6.9-rc1-mm4 sparc reiser4 build broken - undefined atomic_sub_and_test

From: William Lee Irwin III
Date: Tue Sep 14 2004 - 04:14:59 EST


On Mon, 13 Sep 2004, William Lee Irwin III wrote:
>> sparc32 is very legacy;

On Tue, Sep 14, 2004 at 11:00:50AM +0200, Roman Zippel wrote:
> Sparc is not really relevant in this case, as it basically uses
> atomic_sub_return() anyway, but i386 or m68k can benefit from avoiding
> atomic_sub_return() if it's possible and that not only in reiserfs.

The only point I had to make was that I'd rather avoid adding arch
hooks for code that will never be run on the arch. I suppose for the
sake of compiletesting...


-- wli

Add atomic_sub_and_test() to sparc32, implemented in terms of
atomic_sub_return(), so reiser4 can be simultaneously microoptimized
and made to pass compilation testing on sparc32.

Index: mm5-2.6.9-rc1/include/asm-sparc/atomic.h
===================================================================
--- mm5-2.6.9-rc1.orig/include/asm-sparc/atomic.h 2004-08-13 22:37:25.000000000 -0700
+++ mm5-2.6.9-rc1/include/asm-sparc/atomic.h 2004-09-14 01:59:51.579542880 -0700
@@ -46,6 +46,7 @@
#define atomic_inc_and_test(v) (atomic_inc_return(v) == 0)

#define atomic_dec_and_test(v) (atomic_dec_return(v) == 0)
+#define atomic_sub_and_test(v) (atomic_sub_return(v) == 0)

/* This is the old 24-bit implementation. It's still used internally
* by some sparc-specific code, notably the semaphore implementation.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/