summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_export.c
diff options
context:
space:
mode:
authorjlemon <jlemon@FreeBSD.org>2001-02-23 20:06:01 +0000
committerjlemon <jlemon@FreeBSD.org>2001-02-23 20:06:01 +0000
commit58f9dcd6ced7e1926fc1dae75119651b0913fca2 (patch)
treef038a4ecc3cbcbcd9165f41d13c01ce15885d48c /sys/kern/vfs_export.c
parent256c4acb0bc88fef2e92bd0e4598774aa206e63c (diff)
downloadFreeBSD-src-58f9dcd6ced7e1926fc1dae75119651b0913fca2.zip
FreeBSD-src-58f9dcd6ced7e1926fc1dae75119651b0913fca2.tar.gz
Add a NOTE_REVOKE flag for vnodes, which is triggered from within vclean().
Use this to tell a filter attached to a vnode that the underlying vnode is no longer valid, by returning EV_EOF. PR: kern/25309, kern/25206
Diffstat (limited to 'sys/kern/vfs_export.c')
-rw-r--r--sys/kern/vfs_export.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/kern/vfs_export.c b/sys/kern/vfs_export.c
index 3c99779..f10edb2 100644
--- a/sys/kern/vfs_export.c
+++ b/sys/kern/vfs_export.c
@@ -53,6 +53,7 @@
#include <sys/dirent.h>
#include <sys/domain.h>
#include <sys/eventhandler.h>
+#include <sys/event.h>
#include <sys/fcntl.h>
#include <sys/kernel.h>
#include <sys/kthread.h>
@@ -2745,6 +2746,9 @@ vn_pollevent(vp, events)
mtx_unlock(&vp->v_pollinfo.vpi_lock);
}
+#define VN_KNOTE(vp, b) \
+ KNOTE((struct klist *)&vp->v_pollinfo.vpi_selinfo.si_note, (b))
+
/*
* Wake up anyone polling on vp because it is being revoked.
* This depends on dead_poll() returning POLLHUP for correct
@@ -2755,6 +2759,7 @@ vn_pollgone(vp)
struct vnode *vp;
{
mtx_lock(&vp->v_pollinfo.vpi_lock);
+ VN_KNOTE(vp, NOTE_REVOKE);
if (vp->v_pollinfo.vpi_events) {
vp->v_pollinfo.vpi_events = 0;
selwakeup(&vp->v_pollinfo.vpi_selinfo);
OpenPOWER on IntegriCloud