]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - include/linux/percpu-rwsem.h
percpu_rw_semaphore: kill ->writer_mutex, add ->write_ctr
[mirror_ubuntu-bionic-kernel.git] / include / linux / percpu-rwsem.h
CommitLineData
62ac665f
MP
1#ifndef _LINUX_PERCPU_RWSEM_H
2#define _LINUX_PERCPU_RWSEM_H
3
9390ef0c 4#include <linux/atomic.h>
a1fd3e24 5#include <linux/rwsem.h>
62ac665f 6#include <linux/percpu.h>
a1fd3e24 7#include <linux/wait.h>
62ac665f
MP
8
9struct percpu_rw_semaphore {
a1fd3e24 10 unsigned int __percpu *fast_read_ctr;
9390ef0c 11 atomic_t write_ctr;
a1fd3e24
ON
12 struct rw_semaphore rw_sem;
13 atomic_t slow_read_ctr;
14 wait_queue_head_t write_waitq;
62ac665f
MP
15};
16
a1fd3e24
ON
17extern void percpu_down_read(struct percpu_rw_semaphore *);
18extern void percpu_up_read(struct percpu_rw_semaphore *);
5c1eabe6 19
a1fd3e24
ON
20extern void percpu_down_write(struct percpu_rw_semaphore *);
21extern void percpu_up_write(struct percpu_rw_semaphore *);
62ac665f 22
a1fd3e24
ON
23extern int percpu_init_rwsem(struct percpu_rw_semaphore *);
24extern void percpu_free_rwsem(struct percpu_rw_semaphore *);
62ac665f
MP
25
26#endif