Add a catchall to set default blocksize values for disk like devices.

Submitted by:	phk@freebsd.org
This commit is contained in:
Julian Elischer 1999-09-03 08:26:46 +00:00
parent 48adcae922
commit c5d6480694
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=50835
2 changed files with 26 additions and 10 deletions

View File

@ -203,8 +203,7 @@ spec_open(ap)
VOP_UNLOCK(vp, 0, p);
error = (*dsw->d_open)(dev, ap->a_mode, S_IFCHR, p);
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p);
return (error);
/* NOT REACHED */
break;
case VBLK:
dsw = devsw(dev);
if ( (dsw == NULL) || (dsw->d_open == NULL))
@ -225,12 +224,21 @@ spec_open(ap)
error = vfs_mountedon(vp);
if (error)
return (error);
return ((*dsw->d_open)(dev, ap->a_mode, S_IFBLK, p));
/* NOT REACHED */
error = (*dsw->d_open)(dev, ap->a_mode, S_IFBLK, p);
break;
default:
break;
}
return (0);
if (vn_isdisk(vp)) {
if (!dev->si_bsize_phys)
dev->si_bsize_phys = DEV_BSIZE;
if (dev->si_bsize_best < dev->si_bsize_phys)
dev->si_bsize_best = BLKDEV_IOSIZE;
if (!dev->si_bsize_max)
dev->si_bsize_max = MAXBSIZE;
}
return (error);
}
/*

View File

@ -203,8 +203,7 @@ spec_open(ap)
VOP_UNLOCK(vp, 0, p);
error = (*dsw->d_open)(dev, ap->a_mode, S_IFCHR, p);
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p);
return (error);
/* NOT REACHED */
break;
case VBLK:
dsw = devsw(dev);
if ( (dsw == NULL) || (dsw->d_open == NULL))
@ -225,12 +224,21 @@ spec_open(ap)
error = vfs_mountedon(vp);
if (error)
return (error);
return ((*dsw->d_open)(dev, ap->a_mode, S_IFBLK, p));
/* NOT REACHED */
error = (*dsw->d_open)(dev, ap->a_mode, S_IFBLK, p);
break;
default:
break;
}
return (0);
if (vn_isdisk(vp)) {
if (!dev->si_bsize_phys)
dev->si_bsize_phys = DEV_BSIZE;
if (dev->si_bsize_best < dev->si_bsize_phys)
dev->si_bsize_best = BLKDEV_IOSIZE;
if (!dev->si_bsize_max)
dev->si_bsize_max = MAXBSIZE;
}
return (error);
}
/*