summaryrefslogtreecommitdiffstats
path: root/sys/fs/devfs/devfs_vfsops.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2000-09-06 11:26:43 +0000
committerphk <phk@FreeBSD.org>2000-09-06 11:26:43 +0000
commitc9cb5c289d5aaaea9a1cb017bd8b2f24c3483f8e (patch)
treef3e131458b74087067e30359371eb0ee0414890b /sys/fs/devfs/devfs_vfsops.c
parent6c07bccbf798848cb394146e35ef94c64121accd (diff)
downloadFreeBSD-src-c9cb5c289d5aaaea9a1cb017bd8b2f24c3483f8e.zip
FreeBSD-src-c9cb5c289d5aaaea9a1cb017bd8b2f24c3483f8e.tar.gz
Add refcounts to the "global" DEVFS inode slots, this allows us
to recycle inodes after a destroy_dev() but not until all mounts have picked up the change. Add support for an overflow table for DEVFS inodes. The static table defaults to 1024 inodes, if that fills, an overflow table of 32k inodes is allocated. Both numbers can be changed at compile time, the size of the overflow table also with the sysctl vfs.devfs.noverflow. Use atomic instructions to barrier between make_dev()/destroy_dev() and the mounts. Add lockmgr() locking of directories for operations accessing or modifying the directory TAILQs. Various nitpicking here and there.
Diffstat (limited to 'sys/fs/devfs/devfs_vfsops.c')
-rw-r--r--sys/fs/devfs/devfs_vfsops.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/fs/devfs/devfs_vfsops.c b/sys/fs/devfs/devfs_vfsops.c
index 72f2630..131fd47 100644
--- a/sys/fs/devfs/devfs_vfsops.c
+++ b/sys/fs/devfs/devfs_vfsops.c
@@ -34,6 +34,8 @@
* $FreeBSD$
*/
+#include "opt_devfs.h"
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
@@ -41,9 +43,7 @@
#include <sys/vnode.h>
#include <sys/mount.h>
#include <sys/malloc.h>
-#include <sys/eventhandler.h>
-#define DEVFS_INTERN
#include <fs/devfs/devfs.h>
MALLOC_DEFINE(M_DEVFS, "DEVFS", "DEVFS data");
@@ -82,12 +82,13 @@ devfs_mount(mp, path, data, ndp, p)
MALLOC(fmp, struct devfs_mount *, sizeof(struct devfs_mount),
M_DEVFS, M_WAITOK);
bzero(fmp, sizeof(*fmp));
+ lockinit(&fmp->dm_lock, PVFS, "devfs", 0, LK_NOPAUSE);
mp->mnt_flag |= MNT_LOCAL;
mp->mnt_data = (qaddr_t) fmp;
vfs_getnewfsid(mp);
- fmp->dm_inode = NDEVINO;
+ fmp->dm_inode = DEVFSINOMOUNT;
fmp->dm_rootdir = devfs_vmkdir("(root)", 6, NULL);
fmp->dm_rootdir->de_inode = 2;
@@ -110,7 +111,6 @@ devfs_mount(mp, path, data, ndp, p)
bzero(mp->mnt_stat.f_mntfromname, MNAMELEN);
bcopy("devfs", mp->mnt_stat.f_mntfromname, sizeof("devfs"));
(void)devfs_statfs(mp, &mp->mnt_stat, p);
- devfs_populate(fmp);
return (0);
}
OpenPOWER on IntegriCloud