diff options
author | stas <stas@FreeBSD.org> | 2009-06-28 21:49:43 +0000 |
---|---|---|
committer | stas <stas@FreeBSD.org> | 2009-06-28 21:49:43 +0000 |
commit | c61e1d6988484a6875f72fcc81e34d5a1c2dccfa (patch) | |
tree | 022e59bcdde11f99bd112a6b3f3fb767e6be937c /sys/sys/event.h | |
parent | 66973f6d466a972e501c27cd4da24634b5f87f3e (diff) | |
download | FreeBSD-src-c61e1d6988484a6875f72fcc81e34d5a1c2dccfa.zip FreeBSD-src-c61e1d6988484a6875f72fcc81e34d5a1c2dccfa.tar.gz |
- Turn the third (islocked) argument of the knote call into flags parameter.
Introduce the new flag KNF_NOKQLOCK to allow event callers to be called
without KQ_LOCK mtx held.
- Modify VFS knote calls to always use KNF_NOKQLOCK flag. This is required
for ZFS as its getattr implementation may sleep.
Approved by: re (rwatson)
Reviewed by: kib
MFC after: 2 weeks
Diffstat (limited to 'sys/sys/event.h')
-rw-r--r-- | sys/sys/event.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/sys/event.h b/sys/sys/event.h index 824f084..6824152 100644 --- a/sys/sys/event.h +++ b/sys/sys/event.h @@ -136,8 +136,14 @@ struct knlist { MALLOC_DECLARE(M_KQUEUE); #endif -#define KNOTE(list, hist, lock) knote(list, hist, lock) -#define KNOTE_LOCKED(list, hint) knote(list, hint, 1) +/* + * Flags for knote call + */ +#define KNF_LISTLOCKED 0x0001 /* knlist is locked */ +#define KNF_NOKQLOCK 0x0002 /* do not keep KQ_LOCK */ + +#define KNOTE(list, hist, flags) knote(list, hist, flags) +#define KNOTE_LOCKED(list, hint) knote(list, hint, KNF_LISTLOCKED) #define KNOTE_UNLOCKED(list, hint) knote(list, hint, 0) #define KNLIST_EMPTY(list) SLIST_EMPTY(&(list)->kl_list) @@ -206,7 +212,7 @@ struct proc; struct knlist; struct mtx; -extern void knote(struct knlist *list, long hint, int islocked); +extern void knote(struct knlist *list, long hint, int lockflags); extern void knote_fork(struct knlist *list, int pid); extern void knlist_add(struct knlist *knl, struct knote *kn, int islocked); extern void knlist_remove(struct knlist *knl, struct knote *kn, int islocked); |