mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Replace cv_{timed}wait_sig with cv_{timed}wait_idle where appropriate
There are a number of places where cv_?_sig is used simply for accounting purposes but the surrounding code has no ability to cope with actually receiving a signal. On FreeBSD it is possible to send signals to individual kernel threads so this could enable undesirable behavior. This patch adds routines on Linux that will do the same idle accounting as _sig without making the task interruptible. On FreeBSD cv_*_idle are all aliases for cv_* Reviewed-by: Alexander Motin <mav@FreeBSD.org> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Matt Macy <mmacy@FreeBSD.org> Closes #10843
This commit is contained in:
committed by
Brian Behlendorf
parent
fd20a81b9a
commit
36f36610c3
@@ -80,15 +80,19 @@ extern void __cv_init(kcondvar_t *, char *, kcv_type_t, void *);
|
||||
extern void __cv_destroy(kcondvar_t *);
|
||||
extern void __cv_wait(kcondvar_t *, kmutex_t *);
|
||||
extern void __cv_wait_io(kcondvar_t *, kmutex_t *);
|
||||
extern void __cv_wait_idle(kcondvar_t *, kmutex_t *);
|
||||
extern int __cv_wait_io_sig(kcondvar_t *, kmutex_t *);
|
||||
extern int __cv_wait_sig(kcondvar_t *, kmutex_t *);
|
||||
extern int __cv_timedwait(kcondvar_t *, kmutex_t *, clock_t);
|
||||
extern int __cv_timedwait_io(kcondvar_t *, kmutex_t *, clock_t);
|
||||
extern int __cv_timedwait_sig(kcondvar_t *, kmutex_t *, clock_t);
|
||||
extern int __cv_timedwait_idle(kcondvar_t *, kmutex_t *, clock_t);
|
||||
extern int cv_timedwait_hires(kcondvar_t *, kmutex_t *, hrtime_t,
|
||||
hrtime_t res, int flag);
|
||||
extern int cv_timedwait_sig_hires(kcondvar_t *, kmutex_t *, hrtime_t,
|
||||
hrtime_t res, int flag);
|
||||
extern int cv_timedwait_idle_hires(kcondvar_t *, kmutex_t *, hrtime_t,
|
||||
hrtime_t res, int flag);
|
||||
extern void __cv_signal(kcondvar_t *);
|
||||
extern void __cv_broadcast(kcondvar_t *c);
|
||||
|
||||
@@ -96,6 +100,7 @@ extern void __cv_broadcast(kcondvar_t *c);
|
||||
#define cv_destroy(cvp) __cv_destroy(cvp)
|
||||
#define cv_wait(cvp, mp) __cv_wait(cvp, mp)
|
||||
#define cv_wait_io(cvp, mp) __cv_wait_io(cvp, mp)
|
||||
#define cv_wait_idle(cvp, mp) __cv_wait_idle(cvp, mp)
|
||||
#define cv_wait_io_sig(cvp, mp) __cv_wait_io_sig(cvp, mp)
|
||||
#define cv_wait_sig(cvp, mp) __cv_wait_sig(cvp, mp)
|
||||
#define cv_signal(cvp) __cv_signal(cvp)
|
||||
@@ -109,5 +114,7 @@ extern void __cv_broadcast(kcondvar_t *c);
|
||||
#define cv_timedwait(cvp, mp, t) __cv_timedwait(cvp, mp, t)
|
||||
#define cv_timedwait_io(cvp, mp, t) __cv_timedwait_io(cvp, mp, t)
|
||||
#define cv_timedwait_sig(cvp, mp, t) __cv_timedwait_sig(cvp, mp, t)
|
||||
#define cv_timedwait_idle(cvp, mp, t) __cv_timedwait_idle(cvp, mp, t)
|
||||
|
||||
|
||||
#endif /* _SPL_CONDVAR_H */
|
||||
|
||||
Reference in New Issue
Block a user