Removed redundant bitrotted checks for major numbers instead of updating

them.
This commit is contained in:
bde 1998-10-26 08:53:13 +00:00
parent 285a46e7e4
commit 873d7be484
5 changed files with 12 additions and 20 deletions

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)spec_vnops.c 8.14 (Berkeley) 5/21/95
* $Id: spec_vnops.c,v 1.73 1998/09/05 14:13:12 phk Exp $
* $Id: spec_vnops.c,v 1.74 1998/09/12 20:21:54 phk Exp $
*/
#include <sys/param.h>
@ -257,7 +257,7 @@ spec_read(ap)
daddr_t bn, nextbn;
long bsize, bscale;
struct partinfo dpart;
int n, on, majordev;
int n, on;
d_ioctl_t *ioctl;
int error = 0;
dev_t dev;
@ -285,8 +285,7 @@ spec_read(ap)
return (EINVAL);
bsize = BLKDEV_IOSIZE;
dev = vp->v_rdev;
if ((majordev = major(dev)) < nblkdev &&
(ioctl = bdevsw[majordev]->d_ioctl) != NULL &&
if ((ioctl = bdevsw[major(dev)]->d_ioctl) != NULL &&
(*ioctl)(dev, DIOCGPART, (caddr_t)&dpart, FREAD, p) == 0 &&
dpart.part->p_fstype == FS_BSDFFS &&
dpart.part->p_frag != 0 && dpart.part->p_fsize != 0)

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)ufs_bmap.c 8.7 (Berkeley) 3/21/95
* $Id: ufs_bmap.c,v 1.21 1998/07/04 20:45:39 julian Exp $
* $Id: ufs_bmap.c,v 1.22 1998/08/18 03:54:39 bde Exp $
*/
#include <sys/param.h>
@ -149,9 +149,7 @@ ufs_bmaparray(vp, bn, bnp, ap, nump, runp, runb)
*/
devvp = ip->i_devvp;
if (devvp && devvp->v_type == VBLK &&
(devvp->v_rdev != NODEV) &&
(major(devvp->v_rdev) < nblkdev)) {
if (devvp != NULL && devvp->v_type == VBLK) {
if (bdevsw[major(devvp->v_rdev)]->d_maxio > MAXPHYS) {
maxrun = MAXPHYS;
vp->v_maxio = MAXPHYS;

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)ufs_bmap.c 8.7 (Berkeley) 3/21/95
* $Id: ufs_bmap.c,v 1.21 1998/07/04 20:45:39 julian Exp $
* $Id: ufs_bmap.c,v 1.22 1998/08/18 03:54:39 bde Exp $
*/
#include <sys/param.h>
@ -149,9 +149,7 @@ ufs_bmaparray(vp, bn, bnp, ap, nump, runp, runb)
*/
devvp = ip->i_devvp;
if (devvp && devvp->v_type == VBLK &&
(devvp->v_rdev != NODEV) &&
(major(devvp->v_rdev) < nblkdev)) {
if (devvp != NULL && devvp->v_type == VBLK) {
if (bdevsw[major(devvp->v_rdev)]->d_maxio > MAXPHYS) {
maxrun = MAXPHYS;
vp->v_maxio = MAXPHYS;

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)spec_vnops.c 8.14 (Berkeley) 5/21/95
* $Id: spec_vnops.c,v 1.73 1998/09/05 14:13:12 phk Exp $
* $Id: spec_vnops.c,v 1.74 1998/09/12 20:21:54 phk Exp $
*/
#include <sys/param.h>
@ -257,7 +257,7 @@ spec_read(ap)
daddr_t bn, nextbn;
long bsize, bscale;
struct partinfo dpart;
int n, on, majordev;
int n, on;
d_ioctl_t *ioctl;
int error = 0;
dev_t dev;
@ -285,8 +285,7 @@ spec_read(ap)
return (EINVAL);
bsize = BLKDEV_IOSIZE;
dev = vp->v_rdev;
if ((majordev = major(dev)) < nblkdev &&
(ioctl = bdevsw[majordev]->d_ioctl) != NULL &&
if ((ioctl = bdevsw[major(dev)]->d_ioctl) != NULL &&
(*ioctl)(dev, DIOCGPART, (caddr_t)&dpart, FREAD, p) == 0 &&
dpart.part->p_fstype == FS_BSDFFS &&
dpart.part->p_frag != 0 && dpart.part->p_fsize != 0)

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)ufs_bmap.c 8.7 (Berkeley) 3/21/95
* $Id: ufs_bmap.c,v 1.21 1998/07/04 20:45:39 julian Exp $
* $Id: ufs_bmap.c,v 1.22 1998/08/18 03:54:39 bde Exp $
*/
#include <sys/param.h>
@ -149,9 +149,7 @@ ufs_bmaparray(vp, bn, bnp, ap, nump, runp, runb)
*/
devvp = ip->i_devvp;
if (devvp && devvp->v_type == VBLK &&
(devvp->v_rdev != NODEV) &&
(major(devvp->v_rdev) < nblkdev)) {
if (devvp != NULL && devvp->v_type == VBLK) {
if (bdevsw[major(devvp->v_rdev)]->d_maxio > MAXPHYS) {
maxrun = MAXPHYS;
vp->v_maxio = MAXPHYS;