Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144425214
D34777.id104576.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D34777.id104576.diff
View Options
Index: sys/geom/geom_dev.c
===================================================================
--- sys/geom/geom_dev.c
+++ sys/geom/geom_dev.c
@@ -471,6 +471,7 @@
atomic_clear_int(&sc->sc_active, SC_A_OPEN);
else
atomic_set_int(&sc->sc_active, SC_A_OPEN);
+ KNOTE_LOCKED(&sc->sc_selinfo.si_note, NOTE_OPEN);
mtx_unlock(&sc->sc_mtx);
}
return (error);
@@ -517,6 +518,7 @@
atomic_set_int(&sc->sc_active, SC_A_OPEN);
while (sc->sc_open == 0 && (sc->sc_active & SC_A_ACTIVE) != 0)
msleep(&sc->sc_active, &sc->sc_mtx, 0, "g_dev_close", hz / 10);
+ KNOTE_LOCKED(&sc->sc_selinfo.si_note, NOTE_CLOSE | (w ? NOTE_CLOSE_WRITE : 0));
mtx_unlock(&sc->sc_mtx);
g_topology_lock();
error = g_access(cp, r, w, e);
@@ -774,6 +776,10 @@
bp2, bp2->bio_error);
bp->bio_flags |= BIO_ERROR;
} else {
+ if (bp->bio_cmd == BIO_READ)
+ KNOTE_UNLOCKED(&sc->sc_selinfo.si_note, NOTE_READ);
+ if (bp->bio_cmd == BIO_WRITE)
+ KNOTE_UNLOCKED(&sc->sc_selinfo.si_note, NOTE_WRITE);
g_trace(G_T_BIO, "g_dev_done(%p/%p) resid %ld completed %jd",
bp2, bp, bp2->bio_resid, (intmax_t)bp2->bio_completed);
}
@@ -931,9 +937,9 @@
if (kn->kn_filter != EVFILT_VNODE)
return (EINVAL);
- /* XXX: extend support for other NOTE_* events */
- if (kn->kn_sfflags != NOTE_ATTRIB)
- return (EINVAL);
+#define SUPPORTED_EVENTS (NOTE_ATTRIB | NOTE_OPEN | NOTE_CLOSE | NOTE_CLOSE_WRITE | NOTE_READ | NOTE_WRITE)
+ if (kn->kn_sfflags & ~SUPPORTED_EVENTS)
+ return (EOPNOTSUPP);
kn->kn_fop = &gdev_filterops_vnode;
kn->kn_hook = sc;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Feb 9, 9:19 AM (13 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28562451
Default Alt Text
D34777.id104576.diff (1 KB)
Attached To
Mode
D34777: geom_dev: extend kevent support for geom dev
Attached
Detach File
Event Timeline
Log In to Comment