summaryrefslogtreecommitdiffstats
path: root/sys/fs/devfs/devfs_vfsops.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2005-09-24 07:03:09 +0000
committerphk <phk@FreeBSD.org>2005-09-24 07:03:09 +0000
commita951e327e625708d60d649c19b21d217d9325f91 (patch)
treed0b4460b68d3350b91dc217d61ac6168b4077b02 /sys/fs/devfs/devfs_vfsops.c
parent07adfc3d98d69f8a0bc6828588bde6785f3d08b4 (diff)
downloadFreeBSD-src-a951e327e625708d60d649c19b21d217d9325f91.zip
FreeBSD-src-a951e327e625708d60d649c19b21d217d9325f91.tar.gz
Make rule zero really magical, that way we don't have to do anything
when we mount and get zero cost if no rules are used in a mountpoint. Add code to deref rules on unmount. Switch from SLIST to TAILQ. Drop SYSINIT, use SX_SYSINIT and static initializer of TAILQ instead. Drop goto, a break will do. Reduce double pointers to single pointers. Combine reaping and destroying rulesets. Avoid memory leaks in a some error cases.
Diffstat (limited to 'sys/fs/devfs/devfs_vfsops.c')
-rw-r--r--sys/fs/devfs/devfs_vfsops.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/fs/devfs/devfs_vfsops.c b/sys/fs/devfs/devfs_vfsops.c
index 6aad2b0..bb34586 100644
--- a/sys/fs/devfs/devfs_vfsops.c
+++ b/sys/fs/devfs/devfs_vfsops.c
@@ -92,7 +92,6 @@ devfs_mount(struct mount *mp, struct thread *td)
vfs_getnewfsid(mp);
fmp->dm_rootdir = devfs_vmkdir(fmp, NULL, 0, NULL, DEVFS_ROOTINO);
- devfs_rules_newmount(fmp, td);
error = devfs_root(mp, LK_EXCLUSIVE, &rvp, td);
if (error) {
@@ -123,6 +122,7 @@ devfs_unmount(struct mount *mp, int mntflags, struct thread *td)
return (error);
sx_xlock(&fmp->dm_lock);
devfs_cleanup(fmp);
+ devfs_rules_cleanup(fmp);
sx_xunlock(&fmp->dm_lock);
mp->mnt_data = NULL;
sx_destroy(&fmp->dm_lock);
OpenPOWER on IntegriCloud