diff options
author | bde <bde@FreeBSD.org> | 1998-10-26 08:07:00 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1998-10-26 08:07:00 +0000 |
commit | 285a46e7e4df7eec29bf44d601fe96e6c1ebd6c0 (patch) | |
tree | 82947fcf5fc1fd099d0b45210c1231ca1ee25848 /sys/kern | |
parent | 84009a09057c3d4f9473fd1c8082318a8f0b1a3f (diff) | |
download | FreeBSD-src-285a46e7e4df7eec29bf44d601fe96e6c1ebd6c0.zip FreeBSD-src-285a46e7e4df7eec29bf44d601fe96e6c1ebd6c0.tar.gz |
Updated the major number check in vfs_object_create(). It's not
clear if the check is necessary, but vfs_object_create() is called
for all vnodes and it was silly to create objects for VBLK vnodes
that don't even have a driver.
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/vfs_export.c | 5 | ||||
-rw-r--r-- | sys/kern/vfs_subr.c | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/sys/kern/vfs_export.c b/sys/kern/vfs_export.c index aa9f754..2fd7bfc 100644 --- a/sys/kern/vfs_export.c +++ b/sys/kern/vfs_export.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)vfs_subr.c 8.31 (Berkeley) 5/26/95 - * $Id: vfs_subr.c,v 1.167 1998/10/25 16:11:49 bde Exp $ + * $Id: vfs_subr.c,v 1.168 1998/10/25 17:44:52 phk Exp $ */ /* @@ -2524,7 +2524,8 @@ retry: if ((error = VOP_GETATTR(vp, &vat, cred, p)) != 0) goto retn; object = vnode_pager_alloc(vp, vat.va_size, 0, 0); - } else if (major(vp->v_rdev) < nblkdev) { + } else if (major(vp->v_rdev) < nblkdev && + bdevsw[major(vp->v_rdev)] != NULL) { /* * This simply allocates the biggest object possible * for a VBLK vnode. This should be fixed, but doesn't diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index aa9f754..2fd7bfc 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)vfs_subr.c 8.31 (Berkeley) 5/26/95 - * $Id: vfs_subr.c,v 1.167 1998/10/25 16:11:49 bde Exp $ + * $Id: vfs_subr.c,v 1.168 1998/10/25 17:44:52 phk Exp $ */ /* @@ -2524,7 +2524,8 @@ retry: if ((error = VOP_GETATTR(vp, &vat, cred, p)) != 0) goto retn; object = vnode_pager_alloc(vp, vat.va_size, 0, 0); - } else if (major(vp->v_rdev) < nblkdev) { + } else if (major(vp->v_rdev) < nblkdev && + bdevsw[major(vp->v_rdev)] != NULL) { /* * This simply allocates the biggest object possible * for a VBLK vnode. This should be fixed, but doesn't |