]> granicus.if.org Git - zfs/commitdiff
Check for changed gaurd macro in 2.6.28+ for rwsem implementation.
authorBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 17 Dec 2009 19:57:44 +0000 (11:57 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 17 Dec 2009 19:57:44 +0000 (11:57 -0800)
As part of the 2.6.28 cleanup which moved all the linux/include/asm/
headers in to linux/arch, the guard headers for many header files
changed.  The i386 rwsem implementation keys off this header to
ensure the internal members of the rwsem structure are interpreted
correctly.  This change checks for the new guard macro in addition
to the only one, the implementation of the rwsem has not changed
for i386 so this is safe and correct.

include/sys/rwlock.h

index 0043f3966449853305d66ec82e92fcdcd7055da3..89fdfa537e42e9e8abd44f8541a9326016880edf 100644 (file)
@@ -64,7 +64,11 @@ typedef struct {
 extern void __up_read_locked(struct rw_semaphore *);
 extern int __down_write_trylock_locked(struct rw_semaphore *);
 #else
-# ifdef _I386_RWSEM_H
+/*
+ * 2.6.x  - 2.6.27  use guard macro _I386_RWSEM_H
+ * 2.6.28 - 2.6.32+ use guard macro _ASM_X86_RWSEM_H
+ */
+# if defined(_I386_RWSEM_H) || defined(_ASM_X86_RWSEM_H)
 #  define RW_COUNT(rwp)                 ((SEM(rwp)->count < 0) ? (-1) : \
                                         (SEM(rwp)->count & RWSEM_ACTIVE_MASK))
 # else