mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Linux 4.8 compat: rw_semaphore atomic_long_t count
For non-rwsem-spinlocks the "count" member was changed from a "long" to "atomic_long_t" type. A configure check has been added to detect this change along with new versions of the _rwsem_tryupgrade() function and RWSEM_COUNT() macro. See https://github.com/torvalds/linux/commit/8ee62b18 for complete details. Signed-off-by: Tim Chase <tim@chase2k.com> Signed-off-by: Chunwei Chen <david.chen@osnexus.com> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #563
This commit is contained in:
@@ -35,9 +35,12 @@
|
||||
#define SPL_RWSEM_SINGLE_WRITER_VALUE (RWSEM_ACTIVE_WRITE_BIAS)
|
||||
#endif
|
||||
|
||||
/* Linux 3.16 change activity to count for rwsem-spinlock */
|
||||
#ifdef HAVE_RWSEM_ACTIVITY
|
||||
/* Linux 3.16 changed activity to count for rwsem-spinlock */
|
||||
#if defined(HAVE_RWSEM_ACTIVITY)
|
||||
#define RWSEM_COUNT(sem) sem->activity
|
||||
/* Linux 4.8 changed count to an atomic_long_t for !rwsem-spinlock */
|
||||
#elif defined(HAVE_RWSEM_ATOMIC_LONG_COUNT)
|
||||
#define RWSEM_COUNT(sem) atomic_long_read(&(sem)->count)
|
||||
#else
|
||||
#define RWSEM_COUNT(sem) sem->count
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user