The last time lockmeter was ported to 2.5, it was getting a little messy. There were separate declarations for spin_*lock() for each combination of lockmeter and preemption, which made four, plus the no-smp definition. While lockmeter's mess isn't the kernel's fault, we noticed some some simplifications which could be made to the generic spinlock code. This patch uses a single definition for each of the macros, eliminating some redundant code. In the preemption-off case, spin lock is changed from this: _raw_spin_lock(lock) to this: do { preempt_disable(); _raw_spin_lock(lock) } while (0) The preemption-on case is unchanged. Since preempt_disable() is a do{}while(0) with preemption off anyway, it gets back to the same effective result as before, with a little extra work from the compiler. The preempt_disable() macro just had to be moved up in the file a bit. Thanks to Adam Litke , who has been doing the lockmeter port and who initially wrote this patch. Compiles in all combinations of SMP and preempt. -- Dave Hansen haveblue@us.ibm.com