summaryrefslogtreecommitdiffstats
path: root/sys/nfs/nfs_common.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1999-05-11 19:55:07 +0000
committerphk <phk@FreeBSD.org>1999-05-11 19:55:07 +0000
commit7e26ca1d1a4bb6507cb6f9241f2d35b1048eaecd (patch)
tree31ecebf331e4a644fafb96ecafe7d2b6b1a24d39 /sys/nfs/nfs_common.c
parentc783fdfffac012af2a31c3939b62a23b94680404 (diff)
downloadFreeBSD-src-7e26ca1d1a4bb6507cb6f9241f2d35b1048eaecd.zip
FreeBSD-src-7e26ca1d1a4bb6507cb6f9241f2d35b1048eaecd.tar.gz
Divorce "dev_t" from the "major|minor" bitmap, which is now called
udev_t in the kernel but still called dev_t in userland. Provide functions to manipulate both types: major() umajor() minor() uminor() makedev() umakedev() dev2udev() udev2dev() For now they're functions, they will become in-line functions after one of the next two steps in this process. Return major/minor/makedev to macro-hood for userland. Register a name in cdevsw[] for the "filedescriptor" driver. In the kernel the udev_t appears in places where we have the major/minor number combination, (ie: a potential device: we may not have the driver nor the device), like in inodes, vattr, cdevsw registration and so on, whereas the dev_t appears where we carry around a reference to a actual device. In the future the cdevsw and the aliased-from vnode will be hung directly from the dev_t, along with up to two softc pointers for the device driver and a few houskeeping bits. This will essentially replace the current "alias" check code (same buck, bigger bang). A little stunt has been provided to try to catch places where the wrong type is being used (dev_t vs udev_t), if you see something not working, #undef DEVT_FASCIST in kern/kern_conf.c and see if it makes a difference. If it does, please try to track it down (many hands make light work) or at least try to reproduce it as simply as possible, and describe how to do that. Without DEVT_FASCIST I belive this patch is a no-op. Stylistic/posixoid comments about the userland view of the <sys/*.h> files welcome now, from userland they now contain the end result. Next planned step: make all dev_t's refer to the same devsw[] which means convert BLK's to CHR's at the perimeter of the vnodes and other places where they enter the game (bootdev, mknod, sysctl).
Diffstat (limited to 'sys/nfs/nfs_common.c')
-rw-r--r--sys/nfs/nfs_common.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/nfs/nfs_common.c b/sys/nfs/nfs_common.c
index 03c20ca..9a36211 100644
--- a/sys/nfs/nfs_common.c
+++ b/sys/nfs/nfs_common.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_subs.c 8.8 (Berkeley) 5/22/95
- * $Id: nfs_subs.c,v 1.72 1999/01/27 22:42:27 dillon Exp $
+ * $Id: nfs_subs.c,v 1.73 1999/02/17 13:59:29 bde Exp $
*/
/*
@@ -1260,7 +1260,7 @@ nfs_loadattrcache(vpp, mdp, dposp, vaper)
if (v3) {
vtyp = nfsv3tov_type(fp->fa_type);
vmode = fxdr_unsigned(u_short, fp->fa_mode);
- rdev = makedev(fxdr_unsigned(int, fp->fa3_rdev.specdata1),
+ rdev = umakedev(fxdr_unsigned(int, fp->fa3_rdev.specdata1),
fxdr_unsigned(int, fp->fa3_rdev.specdata2));
fxdr_nfsv3time(&fp->fa3_mtime, &mtime);
} else {
@@ -1312,7 +1312,7 @@ nfs_loadattrcache(vpp, mdp, dposp, vaper)
}
if (vp->v_type == VCHR || vp->v_type == VBLK) {
vp->v_op = spec_nfsv2nodeop_p;
- nvp = checkalias(vp, (dev_t)rdev, vp->v_mount);
+ nvp = checkalias(vp, rdev, vp->v_mount);
if (nvp) {
/*
* Discard unneeded vnode, but save its nfsnode.
@@ -1338,7 +1338,7 @@ nfs_loadattrcache(vpp, mdp, dposp, vaper)
vap = &np->n_vattr;
vap->va_type = vtyp;
vap->va_mode = (vmode & 07777);
- vap->va_rdev = (dev_t)rdev;
+ vap->va_rdev = rdev;
vap->va_mtime = mtime;
vap->va_fsid = vp->v_mount->mnt_stat.f_fsid.val[0];
if (v3) {
@@ -1862,8 +1862,8 @@ nfsm_srvfattr(nfsd, vap, fp)
fp->fa_mode = vtonfsv3_mode(vap->va_mode);
txdr_hyper(&vap->va_size, &fp->fa3_size);
txdr_hyper(&vap->va_bytes, &fp->fa3_used);
- fp->fa3_rdev.specdata1 = txdr_unsigned(major(vap->va_rdev));
- fp->fa3_rdev.specdata2 = txdr_unsigned(minor(vap->va_rdev));
+ fp->fa3_rdev.specdata1 = txdr_unsigned(umajor(vap->va_rdev));
+ fp->fa3_rdev.specdata2 = txdr_unsigned(uminor(vap->va_rdev));
fp->fa3_fsid.nfsuquad[0] = 0;
fp->fa3_fsid.nfsuquad[1] = txdr_unsigned(vap->va_fsid);
fp->fa3_fileid.nfsuquad[0] = 0;
OpenPOWER on IntegriCloud