aboutsummaryrefslogtreecommitdiff
path: root/sys/miscfs/specfs
diff options
context:
space:
mode:
authorJulian Elischer <julian@FreeBSD.org>1998-04-19 23:32:49 +0000
committerJulian Elischer <julian@FreeBSD.org>1998-04-19 23:32:49 +0000
commit3e425b968d4b5478e0e1edda78ca13e0e91fa7fe (patch)
treec74ebd0773f9113f68301b0820a6cf92e299233c /sys/miscfs/specfs
parent9d66d1d696cc0606cb896c261846c9fddc0b867d (diff)
downloadsrc-3e425b968d4b5478e0e1edda78ca13e0e91fa7fe.tar.gz
src-3e425b968d4b5478e0e1edda78ca13e0e91fa7fe.zip
Add changes and code to implement a functional DEVFS.
This code will be turned on with the TWO options DEVFS and SLICE. (see LINT) Two labels PRE_DEVFS_SLICE and POST_DEVFS_SLICE will deliniate these changes. /dev will be automatically mounted by init (thanks phk) on bootup. See /sys/dev/slice/slice.4 for more info. All code should act the same without these options enabled. Mike Smith, Poul Henning Kamp, Soeren, and a few dozen others This code does not support the following: bad144 handling. Persistance. (My head is still hurting from the last time we discussed this) ATAPI flopies are not handled by the SLICE code yet. When this code is running, all major numbers are arbitrary and COULD be dynamically assigned. (this is not done, for POLA only) Minor numbers for disk slices ARE arbitray and dynamically assigned.
Notes
Notes: svn path=/head/; revision=35319
Diffstat (limited to 'sys/miscfs/specfs')
-rw-r--r--sys/miscfs/specfs/spec_vnops.c11
-rw-r--r--sys/miscfs/specfs/specdev.h6
2 files changed, 13 insertions, 4 deletions
diff --git a/sys/miscfs/specfs/spec_vnops.c b/sys/miscfs/specfs/spec_vnops.c
index 666322f65609..82f001d49035 100644
--- a/sys/miscfs/specfs/spec_vnops.c
+++ b/sys/miscfs/specfs/spec_vnops.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)spec_vnops.c 8.14 (Berkeley) 5/21/95
- * $Id: spec_vnops.c,v 1.59 1998/03/08 08:46:18 dyson Exp $
+ * $Id: spec_vnops.c,v 1.60 1998/03/08 09:57:36 julian Exp $
*/
#include <sys/param.h>
@@ -761,8 +761,15 @@ spec_getpages(ap)
* Round up physical size for real devices, use the
* fundamental blocksize of the fs if possible.
*/
- if (vp && vp->v_mount)
+ if (vp && vp->v_mount) {
+ if (vp->v_type != VBLK) {
+ vprint("Non VBLK", vp);
+ }
blksiz = vp->v_mount->mnt_stat.f_bsize;
+ if (blksiz < DEV_BSIZE) {
+ blksiz = DEV_BSIZE;
+ }
+ }
else
blksiz = DEV_BSIZE;
size = (ap->a_count + blksiz - 1) & ~(blksiz - 1);
diff --git a/sys/miscfs/specfs/specdev.h b/sys/miscfs/specfs/specdev.h
index b4c6f7750458..9c225a3832be 100644
--- a/sys/miscfs/specfs/specdev.h
+++ b/sys/miscfs/specfs/specdev.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)specdev.h 8.6 (Berkeley) 5/21/95
- * $Id: specdev.h,v 1.13 1997/10/15 13:23:21 phk Exp $
+ * $Id: specdev.h,v 1.14 1998/03/08 09:57:40 julian Exp $
*/
/*
@@ -43,7 +43,8 @@ struct specinfo {
struct vnode **si_hashchain;
struct vnode *si_specnext;
struct mount *si_mountpoint;
- dev_t si_rdev;
+ dev_t si_rdev;
+ unsigned long si_blksize; /* smallest IO unit */
};
/*
* Exported shorthand
@@ -52,6 +53,7 @@ struct specinfo {
#define v_hashchain v_specinfo->si_hashchain
#define v_specnext v_specinfo->si_specnext
#define v_specmountpoint v_specinfo->si_mountpoint
+#define v_blksize v_specinfo->si_blksize
/*
* Special device management