diff options
author | phk <phk@FreeBSD.org> | 2003-10-20 07:04:09 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2003-10-20 07:04:09 +0000 |
commit | c096f8aa94a31dd415cd6bd49e3c71223305df46 (patch) | |
tree | a90fac68bfcd15a4bafe05b66db240b51564f147 /sys/fs/devfs | |
parent | ba669f61995f85d29944a6d89b25a6fc37c8e77a (diff) | |
download | FreeBSD-src-c096f8aa94a31dd415cd6bd49e3c71223305df46.zip FreeBSD-src-c096f8aa94a31dd415cd6bd49e3c71223305df46.tar.gz |
When a driver successfully created a device on demand, we can directly
pick up the DEVFS inode number from the dev_t and find our directory
entry from that, we don't need to scan the directory to find it.
This also solves an issue with on-demand devices in subdirectories.
Submitted by: cognet
Diffstat (limited to 'sys/fs/devfs')
-rw-r--r-- | sys/fs/devfs/devfs_vnops.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c index 49ea181..7f57e7c 100644 --- a/sys/fs/devfs/devfs_vnops.c +++ b/sys/fs/devfs/devfs_vnops.c @@ -297,8 +297,9 @@ devfs_lookupx(ap) struct vnode *dvp, **vpp; struct thread *td; struct devfs_dirent *de, *dd; + struct devfs_dirent **dde; struct devfs_mount *dmp; - dev_t cdev, *cpdev; + dev_t cdev; int error, flags, nameiop; char specname[SPECNAMELEN + 1], *pname; @@ -382,13 +383,11 @@ devfs_lookupx(ap) goto notfound; devfs_populate(dmp); - dd = dvp->v_data; - TAILQ_FOREACH(de, &dd->de_dlist, de_list) { - cpdev = devfs_itod(de->de_inode); - if (cpdev != NULL && cdev == *cpdev) - goto found; - continue; + dde = devfs_itode(dmp, cdev->si_inode); + if (dde != NULL && *dde != DE_DELETED && *dde != NULL) { + de = *dde; + goto found; } notfound: |