From 7f6a56eff721db67a3723108ff53e93ded499ebc Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Mon, 28 Oct 1996 11:36:06 +0000 Subject: [PATCH] devfs_tree.c: improve our bdevvp() function. devfs_vnops.c: move a debug printf to be consistent. --- sys/miscfs/devfs/devfs_tree.c | 8 ++++++-- sys/miscfs/devfs/devfs_vnops.c | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/sys/miscfs/devfs/devfs_tree.c b/sys/miscfs/devfs/devfs_tree.c index f4110f919418..9b7859e5db09 100644 --- a/sys/miscfs/devfs/devfs_tree.c +++ b/sys/miscfs/devfs/devfs_tree.c @@ -2,9 +2,11 @@ /* * Written by Julian Elischer (julian@DIALix.oz.au) * - * $Header: /home/ncvs/src/sys/miscfs/devfs/devfs_tree.c,v 1.30 1996/09/10 08:27:33 bde Exp $ + * $Header: /home/ncvs/src/sys/miscfs/devfs/devfs_tree.c,v 1.31 1996/09/29 15:00:37 bde Exp $ */ +#include "opt_devfs.h" + #include #include #include @@ -841,9 +843,11 @@ bdevvp(dev_t dev, struct vnode **vpp) { dn_p dnp = 0; + if (dev == NODEV) + return(0); dnp= findbdev(dev, dev_root->dnp); if (!dnp) - return (0); + return (ENOENT); return (devfs_dntovn(dnp, vpp)); } #endif /* DEVFS_ROOT */ diff --git a/sys/miscfs/devfs/devfs_vnops.c b/sys/miscfs/devfs/devfs_vnops.c index aba42ce2e9ef..5ed728178972 100644 --- a/sys/miscfs/devfs/devfs_vnops.c +++ b/sys/miscfs/devfs/devfs_vnops.c @@ -1,7 +1,7 @@ /* * Written by Julian Elischer (julian@DIALix.oz.au) * - * $Header: /home/ncvs/src/sys/miscfs/devfs/devfs_vnops.c,v 1.30 1996/10/16 23:14:00 julian Exp $ + * $Header: /home/ncvs/src/sys/miscfs/devfs/devfs_vnops.c,v 1.31 1996/10/17 22:47:23 julian Exp $ * * symlinks can wait 'til later. */ @@ -781,6 +781,7 @@ devfs_write(struct vop_write_args *ap) dn_p file_node; int error; +DBPRINT(("write\n")); if (error = devfs_vntodn(ap->a_vp,&file_node)) { printf("devfs_vntodn returned %d ",error); @@ -788,7 +789,6 @@ devfs_write(struct vop_write_args *ap) } -DBPRINT(("write\n")); switch (ap->a_vp->v_type) { case VREG: return(EINVAL);