summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_mount.c
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2013-06-09 23:51:26 +0000
committermarcel <marcel@FreeBSD.org>2013-06-09 23:51:26 +0000
commitac0545a5fe5499c5778d468bbe69f9267b5cfeec (patch)
tree7031120680c0404d0dd6f70a81f063c0f4269cbf /sys/kern/vfs_mount.c
parent6bae06c63f1840d83bcfab67740917e869efab33 (diff)
downloadFreeBSD-src-ac0545a5fe5499c5778d468bbe69f9267b5cfeec.zip
FreeBSD-src-ac0545a5fe5499c5778d468bbe69f9267b5cfeec.tar.gz
Add vfs_mounted and vfs_unmounted events so that components can be informed
about mount and unmount events. This is used by Juniper to implement a more optimal implementation of NetBSD's veriexec. Submitted by: stevek@juniper.net Obtained from: Juniper Networks, Inc
Diffstat (limited to 'sys/kern/vfs_mount.c')
-rw-r--r--sys/kern/vfs_mount.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c
index 448fdbb..2e5d12f 100644
--- a/sys/kern/vfs_mount.c
+++ b/sys/kern/vfs_mount.c
@@ -864,6 +864,7 @@ vfs_domount_first(
VOP_UNLOCK(newdp, 0);
VOP_UNLOCK(vp, 0);
mountcheckdirs(vp, newdp);
+ EVENTHANDLER_INVOKE(vfs_mounted, mp, newdp, td);
vrele(newdp);
if ((mp->mnt_flag & MNT_RDONLY) == 0)
vfs_allocate_syncvnode(mp);
@@ -1355,6 +1356,7 @@ dounmount(mp, flags, td)
mtx_lock(&mountlist_mtx);
TAILQ_REMOVE(&mountlist, mp, mnt_list);
mtx_unlock(&mountlist_mtx);
+ EVENTHANDLER_INVOKE(vfs_unmounted, mp, td);
if (coveredvp != NULL) {
coveredvp->v_mountedhere = NULL;
vput(coveredvp);
OpenPOWER on IntegriCloud