]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - kernel/locking/qrwlock.c
locking/qrwlock: Use 'struct qrwlock' instead of 'struct __qrwlock'
[mirror_ubuntu-artful-kernel.git] / kernel / locking / qrwlock.c
index 2655f26ec882689f42d2ba7831209f166ce45869..1af791e3734893789682b8eed1b9cdf0c2ae10da 100644 (file)
 #include <linux/spinlock.h>
 #include <asm/qrwlock.h>
 
-/*
- * This internal data structure is used for optimizing access to some of
- * the subfields within the atomic_t cnts.
- */
-struct __qrwlock {
-       union {
-               atomic_t cnts;
-               struct {
-#ifdef __LITTLE_ENDIAN
-                       u8 wmode;       /* Writer mode   */
-                       u8 rcnts[3];    /* Reader counts */
-#else
-                       u8 rcnts[3];    /* Reader counts */
-                       u8 wmode;       /* Writer mode   */
-#endif
-               };
-       };
-       arch_spinlock_t lock;
-};
-
 /**
  * rspin_until_writer_unlock - inc reader count & spin until writer is gone
  * @lock  : Pointer to queue rwlock structure
@@ -125,10 +105,8 @@ void queued_write_lock_slowpath(struct qrwlock *lock)
         * or wait for a previous writer to go away.
         */
        for (;;) {
-               struct __qrwlock *l = (struct __qrwlock *)lock;
-
-               if (!READ_ONCE(l->wmode) &&
-                  (cmpxchg_relaxed(&l->wmode, 0, _QW_WAITING) == 0))
+               if (!READ_ONCE(lock->wmode) &&
+                  (cmpxchg_relaxed(&lock->wmode, 0, _QW_WAITING) == 0))
                        break;
 
                cpu_relax();