locking/qrwlock: Use 'struct qrwlock' instead of 'struct __qrwlock'
There's no good reason to keep the internal structure of struct qrwlock hidden from qrwlock.h, particularly as it's actually needed for unlock and ends up being abstracted independently behind the __qrwlock_write_byte() function. Stop pretending we can hide this stuff, and move the __qrwlock definition into qrwlock, removing the __qrwlock_write_byte() nastiness and using the same struct definition everywhere instead. Signed-off-by: Will Deacon <will.deacon@arm.com> Acked-by: Peter Zijlstra <peterz@infradead.org> Cc: Boqun Feng <boqun.feng@gmail.com> Cc: Jeremy.Linton@arm.com Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Waiman Long <longman@redhat.com> Cc: linux-arm-kernel@lists.infradead.org Link: http://lkml.kernel.org/r/1507810851-306-2-git-send-email-will.deacon@arm.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
@@ -128,23 +128,13 @@ static inline void queued_read_unlock(struct qrwlock *lock)
|
||||
(void)atomic_sub_return_release(_QR_BIAS, &lock->cnts);
|
||||
}
|
||||
|
||||
/**
|
||||
* __qrwlock_write_byte - retrieve the write byte address of a queue rwlock
|
||||
* @lock : Pointer to queue rwlock structure
|
||||
* Return: the write byte address of a queue rwlock
|
||||
*/
|
||||
static inline u8 *__qrwlock_write_byte(struct qrwlock *lock)
|
||||
{
|
||||
return (u8 *)lock + 3 * IS_BUILTIN(CONFIG_CPU_BIG_ENDIAN);
|
||||
}
|
||||
|
||||
/**
|
||||
* queued_write_unlock - release write lock of a queue rwlock
|
||||
* @lock : Pointer to queue rwlock structure
|
||||
*/
|
||||
static inline void queued_write_unlock(struct qrwlock *lock)
|
||||
{
|
||||
smp_store_release(__qrwlock_write_byte(lock), 0);
|
||||
smp_store_release(&lock->wmode, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user