]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - arch/x86/include/asm/spinlock.h
lockref: implement lockless reference count updates using cmpxchg()
[mirror_ubuntu-zesty-kernel.git] / arch / x86 / include / asm / spinlock.h
index e3ddd7db723f666a98c1baefce55282632fd711b..e0e668422c7533ffc2d3b7f08f156f1ea951e33b 100644 (file)
 # define UNLOCK_LOCK_PREFIX
 #endif
 
+static __always_inline int arch_spin_value_unlocked(arch_spinlock_t lock)
+{
+       return lock.tickets.head == lock.tickets.tail;
+}
+
 /*
  * Ticket locks are conceptually two parts, one indicating the current head of
  * the queue, and the other indicating the current tail. The lock is acquired