locking/qrwlock: Rename ->lock to ->wait_lock
authorDavidlohr Bueso <[email protected]>
Mon, 14 Sep 2015 07:37:22 +0000 (00:37 -0700)
committerIngo Molnar <[email protected]>
Fri, 18 Sep 2015 07:27:29 +0000 (09:27 +0200)
... trivial, but reads a little nicer when we name our
actual primitive 'lock'.

Signed-off-by: Davidlohr Bueso <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Paul E. McKenney <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Waiman Long <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
include/asm-generic/qrwlock_types.h
kernel/locking/qrwlock.c

index 4d76f24df5182d9a2736adb987ef7f95866050e6..0abc6b6062fbb1c203bed0f025e05e82ac3eea24 100644 (file)
 
 typedef struct qrwlock {
        atomic_t                cnts;
-       arch_spinlock_t         lock;
+       arch_spinlock_t         wait_lock;
 } arch_rwlock_t;
 
 #define        __ARCH_RW_LOCK_UNLOCKED {               \
        .cnts = ATOMIC_INIT(0),                 \
-       .lock = __ARCH_SPIN_LOCK_UNLOCKED,      \
+       .wait_lock = __ARCH_SPIN_LOCK_UNLOCKED, \
 }
 
 #endif /* __ASM_GENERIC_QRWLOCK_TYPES_H */
index f17a3e3b355079b6658b55b2f21811a69e695190..fec08233866875ca1962d836b4e5d6f88d475092 100644 (file)
@@ -86,7 +86,7 @@ void queued_read_lock_slowpath(struct qrwlock *lock, u32 cnts)
        /*
         * Put the reader into the wait queue
         */
-       arch_spin_lock(&lock->lock);
+       arch_spin_lock(&lock->wait_lock);
 
        /*
         * The ACQUIRE semantics of the following spinning code ensure
@@ -99,7 +99,7 @@ void queued_read_lock_slowpath(struct qrwlock *lock, u32 cnts)
        /*
         * Signal the next one in queue to become queue head
         */
-       arch_spin_unlock(&lock->lock);
+       arch_spin_unlock(&lock->wait_lock);
 }
 EXPORT_SYMBOL(queued_read_lock_slowpath);
 
@@ -112,7 +112,7 @@ void queued_write_lock_slowpath(struct qrwlock *lock)
        u32 cnts;
 
        /* Put the writer into the wait queue */
-       arch_spin_lock(&lock->lock);
+       arch_spin_lock(&lock->wait_lock);
 
        /* Try to acquire the lock directly if no reader is present */
        if (!atomic_read(&lock->cnts) &&
@@ -144,6 +144,6 @@ void queued_write_lock_slowpath(struct qrwlock *lock)
                cpu_relax_lowlatency();
        }
 unlock:
-       arch_spin_unlock(&lock->lock);
+       arch_spin_unlock(&lock->wait_lock);
 }
 EXPORT_SYMBOL(queued_write_lock_slowpath);