diff options
author | kib <kib@FreeBSD.org> | 2016-05-16 02:42:53 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2016-05-16 02:42:53 +0000 |
commit | c3971ff45cd2cfdce3fb7e151d6c2542f2cb675d (patch) | |
tree | 27cd211b2bcf4651c2394561e46636dd4194d41d /sys/kern/vfs_subr.c | |
parent | 1dad0c227ac26ad77961f062129537b9bceefc2f (diff) | |
download | FreeBSD-src-c3971ff45cd2cfdce3fb7e151d6c2542f2cb675d.zip FreeBSD-src-c3971ff45cd2cfdce3fb7e151d6c2542f2cb675d.tar.gz |
MFC r298982:
Add EVFILT_VNODE open, read and close notifications.
MFC r298984:
Correct wording.
Diffstat (limited to 'sys/kern/vfs_subr.c')
-rw-r--r-- | sys/kern/vfs_subr.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 63574d8..674876d 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -4446,6 +4446,45 @@ vop_symlink_post(void *ap, int rc) VFS_KNOTE_LOCKED(a->a_dvp, NOTE_WRITE); } +void +vop_open_post(void *ap, int rc) +{ + struct vop_open_args *a = ap; + + if (!rc) + VFS_KNOTE_LOCKED(a->a_vp, NOTE_OPEN); +} + +void +vop_close_post(void *ap, int rc) +{ + struct vop_close_args *a = ap; + + if (!rc && (a->a_cred != NOCRED || /* filter out revokes */ + (a->a_vp->v_iflag & VI_DOOMED) == 0)) { + VFS_KNOTE_LOCKED(a->a_vp, (a->a_fflag & FWRITE) != 0 ? + NOTE_CLOSE_WRITE : NOTE_CLOSE); + } +} + +void +vop_read_post(void *ap, int rc) +{ + struct vop_read_args *a = ap; + + if (!rc) + VFS_KNOTE_LOCKED(a->a_vp, NOTE_READ); +} + +void +vop_readdir_post(void *ap, int rc) +{ + struct vop_readdir_args *a = ap; + + if (!rc) + VFS_KNOTE_LOCKED(a->a_vp, NOTE_READ); +} + static struct knlist fs_knlist; static void |