diff options
author | phk <phk@FreeBSD.org> | 1996-07-24 21:22:36 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1996-07-24 21:22:36 +0000 |
commit | 1e7e8dfc1ec3f059be143007b33da2cbf78f5b0e (patch) | |
tree | 6bfb0de04546877dbd4fdcfb5cfdedd511d05cda | |
parent | 3a73783c23cb882d9638b775582f7df8a02f6dcb (diff) | |
download | FreeBSD-src-1e7e8dfc1ec3f059be143007b33da2cbf78f5b0e.zip FreeBSD-src-1e7e8dfc1ec3f059be143007b33da2cbf78f5b0e.tar.gz |
DEVFS needs a special bdevvp().
I just noticed some junk in my patch. I'll remove that in a sec.
-rw-r--r-- | sys/miscfs/devfs/devfs_tree.c | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/sys/miscfs/devfs/devfs_tree.c b/sys/miscfs/devfs/devfs_tree.c index 5e550ec..0db8960 100644 --- a/sys/miscfs/devfs/devfs_tree.c +++ b/sys/miscfs/devfs/devfs_tree.c @@ -2,7 +2,7 @@ /* * Written by Julian Elischer (julian@DIALix.oz.au) * - * $Header: /home/ncvs/src/sys/miscfs/devfs/devfs_tree.c,v 1.24 1996/04/07 01:15:01 joerg Exp $ + * $Header: /home/ncvs/src/sys/miscfs/devfs/devfs_tree.c,v 1.25 1996/06/12 05:08:29 gpalmer Exp $ */ #include "param.h" @@ -783,6 +783,42 @@ DBPRINT((" vntodn ")); return(0); } +static dn_p +findbdev(dev_t dev, dn_p dir) +{ + devnm_p newfp; + dn_p dnp; + + for(newfp = dir->by.Dir.dirlist;newfp;newfp=newfp->next) { + dnp = newfp->dnp; + if (dnp->type == DEV_BDEV && dnp->by.Bdev.dev == dev) { + return (dnp); + } + if (dnp->type == DEV_DIR) { + if (dnp = findbdev(dev, dnp)) + return dnp; + } + } + return (0); +} + +/* + * Create a vnode for a block device. + * Used for root filesystem, argdev, and swap areas. + * Also used for memory file system special devices. + */ + +int +bdevvp(dev_t dev, struct vnode **vpp) +{ + dn_p dnp = 0; + + dnp= findbdev(dev, dev_root->dnp); + if (!dnp) + return (0); + return (devfs_dntovn(dnp, vpp)); +} + /***************************************************************\ * given a dev_node, find the appropriate vnode if one is already* * associated, or get a new one an associate it with the dev_node* |