Index: src/sys/gnu/ext2fs/ext2_vnops.c =================================================================== --- src/sys/gnu/ext2fs/ext2_vnops.c (revision 168) +++ src/sys/gnu/ext2fs/ext2_vnops.c (working copy) @@ -108,9 +108,9 @@ static vop_write_t ext2_write; static vop_close_t ext2fifo_close; static vop_kqfilter_t ext2fifo_kqfilter; -static int filt_ext2read(struct knote *kn, long hint); -static int filt_ext2write(struct knote *kn, long hint); -static int filt_ext2vnode(struct knote *kn, long hint); +static int filt_ext2read(struct knote *kn, long hint, void *data); +static int filt_ext2write(struct knote *kn, long hint, void *data); +static int filt_ext2vnode(struct knote *kn, long hint, void *data); static void filt_ext2detach(struct knote *kn); /* Global vfs data structures for ext2. */ @@ -1693,7 +1693,7 @@ /*ARGSUSED*/ static int -filt_ext2read(struct knote *kn, long hint) +filt_ext2read(struct knote *kn, long hint, void *data __unused) { struct vnode *vp = (struct vnode *)kn->kn_hook; struct inode *ip = VTOI(vp); @@ -1713,7 +1713,7 @@ /*ARGSUSED*/ static int -filt_ext2write(struct knote *kn, long hint) +filt_ext2write(struct knote *kn, long hint, void *data __unused) { /* @@ -1728,7 +1728,7 @@ } static int -filt_ext2vnode(struct knote *kn, long hint) +filt_ext2vnode(struct knote *kn, long hint, void *data __unused) { if (kn->kn_sfflags & hint) Index: src/sys/kern/uipc_socket2.c =================================================================== --- src/sys/kern/uipc_socket2.c (revision 168) +++ src/sys/kern/uipc_socket2.c (working copy) @@ -405,7 +405,7 @@ sb->sb_flags &= ~SB_WAIT; wakeup(&sb->sb_cc); } - KNOTE_LOCKED(&sb->sb_sel.si_note, 0); + KNOTE_LOCKED(&sb->sb_sel.si_note, 0, NULL); SOCKBUF_UNLOCK(sb); if ((so->so_state & SS_ASYNC) && so->so_sigio != NULL) pgsigio(&so->so_sigio, SIGIO, 0); Index: src/sys/kern/uipc_syscalls.c =================================================================== --- src/sys/kern/uipc_syscalls.c (revision 168) +++ src/sys/kern/uipc_syscalls.c (working copy) @@ -367,7 +367,7 @@ td->td_retval[0] = fd; /* connection has been removed from the listen queue */ - KNOTE_UNLOCKED(&head->so_rcv.sb_sel.si_note, 0); + KNOTE_UNLOCKED(&head->so_rcv.sb_sel.si_note, 0, NULL); pgid = fgetown(&head->so_sigio); if (pgid != 0) Index: src/sys/kern/kern_sig.c =================================================================== --- src/sys/kern/kern_sig.c (revision 168) +++ src/sys/kern/kern_sig.c (working copy) @@ -89,7 +89,7 @@ static void tdsigwakeup(struct thread *td, int sig, sig_t action); static int filt_sigattach(struct knote *kn); static void filt_sigdetach(struct knote *kn); -static int filt_signal(struct knote *kn, long hint); +static int filt_signal(struct knote *kn, long hint, void *data); static struct thread *sigtd(struct proc *p, int sig, int prop); static int kern_sigtimedwait(struct thread *td, sigset_t set, siginfo_t *info, struct timespec *timeout); @@ -1672,7 +1672,7 @@ ps = p->p_sigacts; PROC_LOCK_ASSERT(p, MA_OWNED); - KNOTE_LOCKED(&p->p_klist, NOTE_SIGNAL | sig); + KNOTE_LOCKED(&p->p_klist, NOTE_SIGNAL | sig, NULL); prop = sigprop(sig); @@ -2748,7 +2748,7 @@ * isn't worth the trouble. */ static int -filt_signal(struct knote *kn, long hint) +filt_signal(struct knote *kn, long hint, void *data __unused) { if (hint & NOTE_SIGNAL) { Index: src/sys/kern/uipc_socket.c =================================================================== --- src/sys/kern/uipc_socket.c (revision 168) +++ src/sys/kern/uipc_socket.c (working copy) @@ -69,10 +69,10 @@ int flags); static void filt_sordetach(struct knote *kn); -static int filt_soread(struct knote *kn, long hint); +static int filt_soread(struct knote *kn, long hint, void *data); static void filt_sowdetach(struct knote *kn); -static int filt_sowrite(struct knote *kn, long hint); -static int filt_solisten(struct knote *kn, long hint); +static int filt_sowrite(struct knote *kn, long hint, void *data); +static int filt_solisten(struct knote *kn, long hint, void *data); static struct filterops solisten_filtops = { 1, NULL, filt_sordetach, filt_solisten }; @@ -2068,7 +2068,7 @@ /*ARGSUSED*/ static int -filt_soread(struct knote *kn, long hint) +filt_soread(struct knote *kn, long hint, void *data __unused) { struct socket *so; @@ -2102,7 +2102,7 @@ /*ARGSUSED*/ static int -filt_sowrite(struct knote *kn, long hint) +filt_sowrite(struct knote *kn, long hint, void *data __unused) { struct socket *so; @@ -2126,7 +2126,7 @@ /*ARGSUSED*/ static int -filt_solisten(struct knote *kn, long hint) +filt_solisten(struct knote *kn, long hint, void *data __unused) { struct socket *so = kn->kn_fp->f_data; Index: src/sys/kern/tty.c =================================================================== --- src/sys/kern/tty.c (revision 168) +++ src/sys/kern/tty.c (working copy) @@ -158,9 +158,9 @@ static void ttyrubo(struct tty *tp, int cnt); static void ttyunblock(struct tty *tp); static int ttywflush(struct tty *tp); -static int filt_ttyread(struct knote *kn, long hint); +static int filt_ttyread(struct knote *kn, long hint, void *data); static void filt_ttyrdetach(struct knote *kn); -static int filt_ttywrite(struct knote *kn, long hint); +static int filt_ttywrite(struct knote *kn, long hint, void *data); static void filt_ttywdetach(struct knote *kn); /* @@ -1357,7 +1357,7 @@ } static int -filt_ttyread(struct knote *kn, long hint) +filt_ttyread(struct knote *kn, long hint, void *data __unused) { struct tty *tp = ((struct cdev *)kn->kn_hook)->si_tty; @@ -1380,7 +1380,7 @@ } static int -filt_ttywrite(struct knote *kn, long hint) +filt_ttywrite(struct knote *kn, long hint, void *data) { struct tty *tp = ((struct cdev *)kn->kn_hook)->si_tty; @@ -2423,7 +2423,7 @@ if (ISSET(tp->t_state, TS_ASYNC) && tp->t_sigio != NULL) pgsigio(&tp->t_sigio, SIGIO, (tp->t_session != NULL)); wakeup(TSA_HUP_OR_INPUT(tp)); - KNOTE_UNLOCKED(&tp->t_rsel.si_note, 0); + KNOTE_UNLOCKED(&tp->t_rsel.si_note, 0, NULL); } /* @@ -2447,7 +2447,7 @@ CLR(tp->t_state, TS_SO_OLOWAT); wakeup(TSA_OLOWAT(tp)); } - KNOTE_UNLOCKED(&tp->t_wsel.si_note, 0); + KNOTE_UNLOCKED(&tp->t_wsel.si_note, 0, NULL); } /* Index: src/sys/kern/kern_exit.c =================================================================== --- src/sys/kern/kern_exit.c (revision 168) +++ src/sys/kern/kern_exit.c (working copy) @@ -431,7 +431,7 @@ /* * Notify interested parties of our demise. */ - KNOTE_LOCKED(&p->p_klist, NOTE_EXIT); + KNOTE_LOCKED(&p->p_klist, NOTE_EXIT, NULL); /* * Just delete all entries in the p_klist. At this point we won't Index: src/sys/kern/kern_event.c =================================================================== --- src/sys/kern/kern_event.c (revision 168) +++ src/sys/kern/kern_event.c (working copy) @@ -123,15 +123,15 @@ static void knote_free(struct knote *kn); static void filt_kqdetach(struct knote *kn); -static int filt_kqueue(struct knote *kn, long hint); +static int filt_kqueue(struct knote *kn, long hint, void *data); static int filt_procattach(struct knote *kn); static void filt_procdetach(struct knote *kn); -static int filt_proc(struct knote *kn, long hint); +static int filt_proc(struct knote *kn, long hint, void *data); static int filt_fileattach(struct knote *kn); static void filt_timerexpire(void *knx); static int filt_timerattach(struct knote *kn); static void filt_timerdetach(struct knote *kn); -static int filt_timer(struct knote *kn, long hint); +static int filt_timer(struct knote *kn, long hint, void *data); static struct filterops file_filtops = { 1, filt_fileattach, NULL, NULL }; @@ -208,6 +208,7 @@ /* XXX - make SYSINIT to add these, and move into respective modules. */ extern struct filterops sig_filtops; extern struct filterops fs_filtops; +extern struct filterops avnode_filtops; /* * Table for for all system-defined filters. @@ -228,6 +229,7 @@ { &timer_filtops }, /* EVFILT_TIMER */ { &file_filtops }, /* EVFILT_NETDEV */ { &fs_filtops }, /* EVFILT_FS */ + { &avnode_filtops }, /* EVFILT_AVNODE */ }; /* @@ -267,7 +269,7 @@ /*ARGSUSED*/ static int -filt_kqueue(struct knote *kn, long hint) +filt_kqueue(struct knote *kn, long hint, void *data __unused) { struct kqueue *kq = kn->kn_fp->f_data; @@ -317,7 +319,7 @@ * zombie. This is necessary to handle the case where the target * process, e.g. a child, dies before the kevent is registered. */ - if (immediate && filt_proc(kn, NOTE_EXIT)) + if (immediate && filt_proc(kn, NOTE_EXIT, NULL)) KNOTE_ACTIVATE(kn, 0); PROC_UNLOCK(p); @@ -346,7 +348,7 @@ /* XXX - move to kern_proc.c? */ static int -filt_proc(struct knote *kn, long hint) +filt_proc(struct knote *kn, long hint, void *data __unused) { struct proc *p = kn->kn_ptr.p_proc; u_int event; @@ -472,7 +474,7 @@ /* XXX - move to kern_timeout.c? */ static int -filt_timer(struct knote *kn, long hint) +filt_timer(struct knote *kn, long hint, void *data __unused) { return (kn->kn_data != 0); @@ -891,7 +893,7 @@ * is called on a zombie process. It will call filt_proc * which will remove it from the list, and NULL kn_knlist. */ - event = kn->kn_fop->f_event(kn, 0); + event = kn->kn_fop->f_event(kn, 0, NULL); KN_LIST_UNLOCK(kn); KQ_LOCK(kq); if (event) @@ -1072,7 +1074,7 @@ KQ_GLOBAL_LOCK(&kq_global, haskqglobal); KQ_LOCK(kq); - KNOTE_LOCKED(&kq->kq_sel.si_note, 0); + KNOTE_LOCKED(&kq->kq_sel.si_note, 0, NULL); kq->kq_state &= ~KQ_TASKSCHED; if ((kq->kq_state & KQ_TASKDRAIN) == KQ_TASKDRAIN) { @@ -1214,7 +1216,7 @@ if ((kn->kn_status & KN_KQUEUE) == KN_KQUEUE) KQ_GLOBAL_LOCK(&kq_global, haskqglobal); KN_LIST_LOCK(kn); - if (kn->kn_fop->f_event(kn, 0) == 0) { + if (kn->kn_fop->f_event(kn, 0, NULL) == 0) { KN_LIST_UNLOCK(kn); KQ_LOCK(kq); kn->kn_status &= @@ -1483,7 +1485,7 @@ * first. */ void -knote(struct knlist *list, long hint, int islocked) +knote(struct knlist *list, long hint, void *data, int islocked) { struct kqueue *kq; struct knote *kn; @@ -1508,7 +1510,7 @@ KQ_LOCK(kq); if ((kn->kn_status & KN_INFLUX) != KN_INFLUX) { kn->kn_status |= KN_HASKQLOCK; - if (kn->kn_fop->f_event(kn, hint)) + if (kn->kn_fop->f_event(kn, hint, data)) KNOTE_ACTIVATE(kn, 1); kn->kn_status &= ~KN_HASKQLOCK; } Index: src/sys/kern/kern_exec.c =================================================================== --- src/sys/kern/kern_exec.c (revision 168) +++ src/sys/kern/kern_exec.c (working copy) @@ -635,7 +635,7 @@ * Notify others that we exec'd, and clear the P_INEXEC flag * as we're now a bona fide freshly-execed process. */ - KNOTE_LOCKED(&p->p_klist, NOTE_EXEC); + KNOTE_LOCKED(&p->p_klist, NOTE_EXEC, NULL); p->p_flag &= ~P_INEXEC; /* Index: src/sys/kern/kern_fork.c =================================================================== --- src/sys/kern/kern_fork.c (revision 168) +++ src/sys/kern/kern_fork.c (working copy) @@ -692,7 +692,7 @@ /* * Tell any interested parties about the new process. */ - KNOTE_LOCKED(&p1->p_klist, NOTE_FORK | p2->p_pid); + KNOTE_LOCKED(&p1->p_klist, NOTE_FORK | p2->p_pid, NULL); PROC_UNLOCK(p1); Index: src/sys/kern/vfs_aio.c =================================================================== --- src/sys/kern/vfs_aio.c (revision 168) +++ src/sys/kern/vfs_aio.c (working copy) @@ -266,7 +266,7 @@ static void process_signal(void *aioj); static int filt_aioattach(struct knote *kn); static void filt_aiodetach(struct knote *kn); -static int filt_aio(struct knote *kn, long hint); +static int filt_aio(struct knote *kn, long hint, void *data); /* * Zones for: @@ -939,7 +939,7 @@ TAILQ_REMOVE(&ki->kaio_jobqueue, aiocbe, plist); TAILQ_INSERT_TAIL(&ki->kaio_jobdone, aiocbe, plist); splx(s); - KNOTE_UNLOCKED(&aiocbe->klist, 0); + KNOTE_UNLOCKED(&aiocbe->klist, 0, NULL); if (aiocbe->jobflags & AIOCBLIST_RUNDOWN) { wakeup(aiocbe); @@ -1176,7 +1176,7 @@ } splx(s); if (notify) - KNOTE_UNLOCKED(&aiocbe->klist, 0); + KNOTE_UNLOCKED(&aiocbe->klist, 0, NULL); return (0); doerror: @@ -2193,7 +2193,7 @@ TAILQ_REMOVE(&ki->kaio_bufqueue, aiocbe, plist); TAILQ_INSERT_TAIL(&ki->kaio_bufdone, aiocbe, plist); - KNOTE_UNLOCKED(&aiocbe->klist, 0); + KNOTE_UNLOCKED(&aiocbe->klist, 0, NULL); /* Do the wakeup. */ if (ki->kaio_flags & (KAIO_RUNDOWN|KAIO_WAKEUP)) { ki->kaio_flags &= ~KAIO_WAKEUP; @@ -2312,7 +2312,7 @@ /* kqueue filter function */ /*ARGSUSED*/ static int -filt_aio(struct knote *kn, long hint) +filt_aio(struct knote *kn, long hint, void *data __unused) { struct aiocblist *aiocbe = (struct aiocblist *)kn->kn_sdata; Index: src/sys/kern/sys_pipe.c =================================================================== --- src/sys/kern/sys_pipe.c (revision 168) +++ src/sys/kern/sys_pipe.c (working copy) @@ -157,8 +157,8 @@ }; static void filt_pipedetach(struct knote *kn); -static int filt_piperead(struct knote *kn, long hint); -static int filt_pipewrite(struct knote *kn, long hint); +static int filt_piperead(struct knote *kn, long hint, void *data); +static int filt_pipewrite(struct knote *kn, long hint, void *data); static struct filterops pipe_rfiltops = { 1, NULL, filt_pipedetach, filt_piperead }; @@ -545,7 +545,7 @@ } if ((cpipe->pipe_state & PIPE_ASYNC) && cpipe->pipe_sigio) pgsigio(&cpipe->pipe_sigio, SIGIO, 0); - KNOTE_LOCKED(&cpipe->pipe_sel.si_note, 0); + KNOTE_LOCKED(&cpipe->pipe_sel.si_note, 0, NULL); } /* @@ -1500,7 +1500,7 @@ ppipe->pipe_state |= PIPE_EOF; wakeup(ppipe); - KNOTE_LOCKED(&ppipe->pipe_sel.si_note, 0); + KNOTE_LOCKED(&ppipe->pipe_sel.si_note, 0, NULL); } /* @@ -1581,7 +1581,7 @@ /*ARGSUSED*/ static int -filt_piperead(struct knote *kn, long hint) +filt_piperead(struct knote *kn, long hint, void *data __unused) { struct pipe *rpipe = kn->kn_fp->f_data; struct pipe *wpipe = rpipe->pipe_peer; @@ -1605,7 +1605,7 @@ /*ARGSUSED*/ static int -filt_pipewrite(struct knote *kn, long hint) +filt_pipewrite(struct knote *kn, long hint, void *data __unused) { struct pipe *rpipe = kn->kn_fp->f_data; struct pipe *wpipe = rpipe->pipe_peer; Index: src/sys/kern/vfs_subr.c =================================================================== --- src/sys/kern/vfs_subr.c (revision 168) +++ src/sys/kern/vfs_subr.c (working copy) @@ -3501,11 +3501,13 @@ } static struct knlist fs_knlist; +struct knlist avn_knlist; static void vfs_event_init(void *arg) { knlist_init(&fs_knlist, NULL); + knlist_init(&avn_knlist, NULL); } /* XXX - correct order? */ SYSINIT(vfs_knlist, SI_SUB_VFS, SI_ORDER_ANY, vfs_event_init, NULL); @@ -3514,12 +3516,12 @@ vfs_event_signal(fsid_t *fsid, u_int32_t event, intptr_t data __unused) { - KNOTE_UNLOCKED(&fs_knlist, event); + KNOTE_UNLOCKED(&fs_knlist, event, NULL); } static int filt_fsattach(struct knote *kn); static void filt_fsdetach(struct knote *kn); -static int filt_fsevent(struct knote *kn, long hint); +static int filt_fsevent(struct knote *kn, long hint, void *data); struct filterops fs_filtops = { 0, filt_fsattach, filt_fsdetach, filt_fsevent }; @@ -3541,7 +3543,7 @@ } static int -filt_fsevent(struct knote *kn, long hint) +filt_fsevent(struct knote *kn, long hint, void *data __unused) { kn->kn_fflags |= hint; @@ -3588,9 +3590,9 @@ return (((u_quad_t)bt.sec << 32LL) | (bt.frac >> 32LL)); } -static int filt_vfsread(struct knote *kn, long hint); -static int filt_vfswrite(struct knote *kn, long hint); -static int filt_vfsvnode(struct knote *kn, long hint); +static int filt_vfsread(struct knote *kn, long hint, void *data); +static int filt_vfswrite(struct knote *kn, long hint, void *data); +static int filt_vfsvnode(struct knote *kn, long hint, void *data); static void filt_vfsdetach(struct knote *kn); static struct filterops vfsread_filtops = @@ -3645,7 +3647,7 @@ /*ARGSUSED*/ static int -filt_vfsread(struct knote *kn, long hint) +filt_vfsread(struct knote *kn, long hint, void *data __unused) { struct vnode *vp = (struct vnode *)kn->kn_hook; struct vattr va; @@ -3668,7 +3670,7 @@ /*ARGSUSED*/ static int -filt_vfswrite(struct knote *kn, long hint) +filt_vfswrite(struct knote *kn, long hint, void *data __unused) { /* * filesystem is gone, so set the EOF flag and schedule @@ -3682,7 +3684,7 @@ } static int -filt_vfsvnode(struct knote *kn, long hint) +filt_vfsvnode(struct knote *kn, long hint, void *data __unused) { if (kn->kn_sfflags & hint) kn->kn_fflags |= hint; @@ -3692,3 +3694,45 @@ } return (kn->kn_fflags != 0); } + +static int filt_avnode(struct knote *kn, long hint, void *data); +static void filt_avndetach(struct knote *kn); +static int filt_avnattach(struct knote *kn); + +struct filterops avnode_filtops = + { 0, filt_avnattach, filt_avndetach, filt_avnode }; + +static int +filt_avnattach(struct knote *kn) +{ + printf("adding %p to avn_knlist\n", kn); + knlist_add(&avn_knlist, kn, 0); + + return (0); +} + +static int +filt_avnode(struct knote *kn, long hint, void *data) +{ + struct vnode *vp; + struct vattr va; + + printf("got hint %ld for %p with data %p\n", hint, kn, data); + if (kn->kn_sfflags & hint) + kn->kn_fflags |= hint; + if (data != NULL) { + vp = (struct vnode *)data; + if (VOP_GETATTR(vp, &va, curthread->td_ucred, curthread)) + return (0); + + kn->kn_data = (intptr_t)va.va_fileid; + } + + return (kn->kn_fflags != 0); +} + +static void +filt_avndetach(struct knote *kn) +{ + printf("detaching %p\n", kn); +} Index: src/sys/cam/scsi/scsi_target.c =================================================================== --- src/sys/cam/scsi/scsi_target.c (revision 168) +++ src/sys/cam/scsi/scsi_target.c (working copy) @@ -100,7 +100,7 @@ static d_poll_t targpoll; static d_kqfilter_t targkqfilter; static void targreadfiltdetach(struct knote *kn); -static int targreadfilt(struct knote *kn, long hint); +static int targreadfilt(struct knote *kn, long hint, void *data); static struct filterops targread_filtops = { 1, NULL, targreadfiltdetach, targreadfilt }; @@ -352,7 +352,7 @@ /* Notify the user's kqueue when the user queue or abort queue gets a CCB */ static int -targreadfilt(struct knote *kn, long hint) +targreadfilt(struct knote *kn, long hint, void *data __unused) { struct targ_softc *softc; int retval; @@ -1104,7 +1104,7 @@ * blocking read(). */ selwakeuppri(&softc->read_select, PRIBIO); - KNOTE_LOCKED(&softc->read_select.si_note, 0); + KNOTE_LOCKED(&softc->read_select.si_note, 0, NULL); wakeup(&softc->user_ccb_queue); } Index: src/sys/fs/fifofs/fifo_vnops.c =================================================================== --- src/sys/fs/fifofs/fifo_vnops.c (revision 168) +++ src/sys/fs/fifofs/fifo_vnops.c (working copy) @@ -91,9 +91,9 @@ static vop_advlock_t fifo_advlock; static void filt_fifordetach(struct knote *kn); -static int filt_fiforead(struct knote *kn, long hint); +static int filt_fiforead(struct knote *kn, long hint, void *data); static void filt_fifowdetach(struct knote *kn); -static int filt_fifowrite(struct knote *kn, long hint); +static int filt_fifowrite(struct knote *kn, long hint, void *data); static struct filterops fiforead_filtops = { 1, NULL, filt_fifordetach, filt_fiforead }; @@ -378,7 +378,7 @@ } static int -filt_fiforead(struct knote *kn, long hint) +filt_fiforead(struct knote *kn, long hint, void *data __unused) { struct socket *so = (struct socket *)kn->kn_hook; int need_lock, result; @@ -412,7 +412,7 @@ } static int -filt_fifowrite(struct knote *kn, long hint) +filt_fifowrite(struct knote *kn, long hint, void *data __unused) { struct socket *so = (struct socket *)kn->kn_hook; int need_lock, result; Index: src/sys/net/if.c =================================================================== --- src/sys/net/if.c (revision 168) +++ src/sys/net/if.c (working copy) @@ -130,7 +130,7 @@ static struct knlist ifklist; static void filt_netdetach(struct knote *kn); -static int filt_netdev(struct knote *kn, long hint); +static int filt_netdev(struct knote *kn, long hint, void *data); static struct filterops netdev_filtops = { 1, NULL, filt_netdetach, filt_netdev }; @@ -241,7 +241,7 @@ } static int -filt_netdev(struct knote *kn, long hint) +filt_netdev(struct knote *kn, long hint, void *data __unused) { struct knlist *klist = (struct knlist *)kn->kn_hook; @@ -648,7 +648,7 @@ #ifdef MAC mac_destroy_ifnet(ifp); #endif /* MAC */ - KNOTE_UNLOCKED(&ifp->if_klist, NOTE_EXIT); + KNOTE_UNLOCKED(&ifp->if_klist, NOTE_EXIT, NULL); knlist_clear(&ifp->if_klist, 0); knlist_destroy(&ifp->if_klist); IFNET_WLOCK(); @@ -1009,7 +1009,7 @@ link = NOTE_LINKDOWN; else link = NOTE_LINKINV; - KNOTE_UNLOCKED(&ifp->if_klist, link); + KNOTE_UNLOCKED(&ifp->if_klist, link, NULL); if (ifp->if_nvlans != 0) (*vlan_link_state_p)(ifp, link); Index: src/sys/net/bpf.c =================================================================== --- src/sys/net/bpf.c (revision 168) +++ src/sys/net/bpf.c (working copy) @@ -115,7 +115,7 @@ static int bpf_getdltlist(struct bpf_d *, struct bpf_dltlist *); static int bpf_setdlt(struct bpf_d *, u_int); static void filt_bpfdetach(struct knote *); -static int filt_bpfread(struct knote *, long); +static int filt_bpfread(struct knote *, long, void *); static d_open_t bpfopen; static d_close_t bpfclose; @@ -532,7 +532,7 @@ pgsigio(&d->bd_sigio, d->bd_sig, 0); selwakeuppri(&d->bd_sel, PRINET); - KNOTE_LOCKED(&d->bd_sel.si_note, 0); + KNOTE_LOCKED(&d->bd_sel.si_note, 0, NULL); } static void @@ -1113,9 +1113,10 @@ } static int -filt_bpfread(kn, hint) +filt_bpfread(kn, hint, data) struct knote *kn; long hint; + void *data __unused; { struct bpf_d *d = (struct bpf_d *)kn->kn_hook; int ready; Index: src/sys/net/if_vlan.c =================================================================== --- src/sys/net/if_vlan.c (revision 168) +++ src/sys/net/if_vlan.c (working copy) @@ -822,7 +822,7 @@ if (ifv->ifv_p == ifp) { ifv->ifv_if.if_link_state = ifv->ifv_p->if_link_state; rt_ifmsg(&(ifv->ifv_if)); - KNOTE_UNLOCKED(&ifp->if_klist, link); + KNOTE_UNLOCKED(&ifp->if_klist, link, NULL); } } VLAN_UNLOCK(); Index: src/sys/sys/mount.h =================================================================== --- src/sys/sys/mount.h (revision 168) +++ src/sys/sys/mount.h (working copy) @@ -550,11 +550,14 @@ mtx_assert(&Giant, MA_OWNED); \ } while (0) +extern struct knlist avn_knlist; + #define VFS_SEND_KNOTE(vp, hint) do \ { \ if ((vp)->v_mount && \ ((vp)->v_mount->mnt_kern_flag & MNTK_NOKNOTE) == 0) \ VN_KNOTE_UNLOCKED((vp), (hint)); \ + KNOTE_UNLOCKED(&avn_knlist, (hint), (void *)(vp)); \ } while (0) #include Index: src/sys/sys/event.h =================================================================== --- src/sys/sys/event.h (revision 168) +++ src/sys/sys/event.h (working copy) @@ -38,8 +38,9 @@ #define EVFILT_TIMER (-7) /* timers */ #define EVFILT_NETDEV (-8) /* network devices */ #define EVFILT_FS (-9) /* filesystem events */ +#define EVFILT_ANYFILE (-10) -#define EVFILT_SYSCOUNT 9 +#define EVFILT_SYSCOUNT 10 #define EV_SET(kevp_, a, b, c, d, e, f) do { \ struct kevent *kevp = (kevp_); \ @@ -137,9 +138,9 @@ MALLOC_DECLARE(M_KQUEUE); #endif -#define KNOTE(list, hist, lock) knote(list, hist, lock) -#define KNOTE_LOCKED(list, hint) knote(list, hint, 1) -#define KNOTE_UNLOCKED(list, hint) knote(list, hint, 0) +#define KNOTE(list, hist, data, lock) knote(list, hist, data, lock) +#define KNOTE_LOCKED(list, hint, data) knote(list, hint, data, 1) +#define KNOTE_UNLOCKED(list, hint, data) knote(list, hint, data, 0) /* * Flag indicating hint is a signal. Used by EVFILT_SIGNAL, and also @@ -151,7 +152,7 @@ int f_isfd; /* true if ident == filedescriptor */ int (*f_attach)(struct knote *kn); void (*f_detach)(struct knote *kn); - int (*f_event)(struct knote *kn, long hint); + int (*f_event)(struct knote *kn, long hint, void *data); }; /* @@ -197,7 +198,7 @@ struct proc; struct knlist; -extern void knote(struct knlist *list, long hint, int islocked); +extern void knote(struct knlist *list, long hint, void *data, int islocked); extern void knlist_add(struct knlist *knl, struct knote *kn, int islocked); extern void knlist_remove(struct knlist *knl, struct knote *kn, int islocked); extern void knlist_remove_inevent(struct knlist *knl, struct knote *kn); Index: src/sys/sys/vnode.h =================================================================== --- src/sys/sys/vnode.h (revision 168) +++ src/sys/sys/vnode.h (working copy) @@ -224,9 +224,10 @@ #define xv_ino xv_un.xv_uns.xvu_ino #define VN_KNOTE(vp, b, a) \ - do { \ - if ((vp)->v_pollinfo != NULL) \ - KNOTE(&vp->v_pollinfo->vpi_selinfo.si_note, (b), (a)); \ + do { \ + if ((vp)->v_pollinfo != NULL) \ + KNOTE(&vp->v_pollinfo->vpi_selinfo.si_note, (b),\ + NULL, (a)); \ } while (0) #define VN_KNOTE_LOCKED(vp, b) VN_KNOTE(vp, b, 1) #define VN_KNOTE_UNLOCKED(vp, b) VN_KNOTE(vp, b, 0)