Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Mar 2001 17:57:58 -0500
From:      tcn <nospam@videotron.ca>
To:        John Baldwin <jhb@FreeBSD.org>
Cc:        leclercn@videotron.ca, grog@FreeBSD.org, freebsd-alpha@FreeBSD.org, Mike Smith <msmith@FreeBSD.org>
Subject:   Re: dev_t size mismatch kernel / userland
Message-ID:  <3ABD2676.2070909@videotron.ca>
References:  <XFMail.010323214917.jhb@FreeBSD.org>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]


[-- Attachment #2 --]
Only in .: org
Only in .: vinum.udev.patch2
diff -u ./vinumio.c org/vinumio.c
--- ./vinumio.c	Sat Mar 24 17:35:21 2001
+++ org/vinumio.c	Sat Mar 24 17:22:00 2001
@@ -71,7 +71,7 @@
      * moving the system to devfs.
      */
     dname = &drive->devicename[5];
-    drive->dev = ENODEV;					    /* no device yet */
+    drive->dev = NULL;					    /* no device yet */
 
     /* Find the device */
     if (bcmp(dname, "ad", 2) == 0)			    /* IDE disk */
@@ -128,16 +128,16 @@
     if ((devminor & 7) == 2)				    /* partition c */
 	return ENOTTY;					    /* not buying that */
 
-    drive->dev = dev2udev(makedev(devmajor, devminor));		    /* find the device */
-    if (drive->dev == ENODEV)				    /* didn't find anything */
+    drive->dev = makedev(devmajor, devminor);		    /* find the device */
+    if (drive->dev == NULL)				    /* didn't find anything */
 	return ENODEV;
 
-    udev2dev(drive->dev,0)->si_iosize_max = DFLTPHYS;
-    dsw = devsw(udev2dev(drive->dev,0));
+    drive->dev->si_iosize_max = DFLTPHYS;
+    dsw = devsw(drive->dev);
     if (dsw == NULL)
 	drive->lasterror = ENOENT;
     else
-	drive->lasterror = (dsw->d_open) (udev2dev(drive->dev,0), FWRITE, 0, NULL);
+	drive->lasterror = (dsw->d_open) (drive->dev, FWRITE, 0, NULL);
 
     if (drive->lasterror != 0) {			    /* failed */
 	drive->state = drive_down;			    /* just force it down */
@@ -215,7 +215,7 @@
     if (drive->lasterror)
 	return drive->lasterror;
 
-    drive->lasterror = (*devsw(udev2dev(drive->dev,0))->d_ioctl) (udev2dev(drive->dev,0),
+    drive->lasterror = (*devsw(drive->dev)->d_ioctl) (drive->dev,
 	DIOCGPART,
 	(caddr_t) & drive->partinfo,
 	FREAD,
@@ -265,7 +265,7 @@
      * the queues, which spec_close() will try to
      * do.  Get rid of them here first.
      */
-    drive->lasterror = (*devsw(udev2dev(drive->dev,0))->d_close) (udev2dev(drive->dev,0), 0, 0, NULL);
+    drive->lasterror = (*devsw(drive->dev)->d_close) (drive->dev, 0, 0, NULL);
     drive->flags &= ~VF_OPEN;				    /* no longer open */
 }
 
@@ -320,7 +320,7 @@
 
 	bp = geteblk(len);				    /* get a buffer header */
 	bp->b_flags = flag;
-	bp->b_dev = udev2dev(drive->dev,0);				    /* device */
+	bp->b_dev = drive->dev;				    /* device */
 	bp->b_blkno = offset / drive->partinfo.disklab->d_secsize; /* block number */
 	bp->b_saveaddr = bp->b_data;
 	bp->b_data = buf;
@@ -655,7 +655,7 @@
 		if ((drive->state != drive_unallocated)
 		    && (drive->state != drive_referenced)) { /* and it's a real drive */
 		    wlabel_on = 1;			    /* enable writing the label */
-		    error = (*devsw(udev2dev(drive->dev,0))->d_ioctl) (udev2dev(drive->dev,0), /* make the label writeable */
+		    error = (*devsw(drive->dev)->d_ioctl) (drive->dev, /* make the label writeable */
 			DIOCWLABEL,
 			(caddr_t) & wlabel_on,
 			FWRITE,
@@ -668,7 +668,7 @@
 			error = write_drive(drive, config, MAXCONFIG, VINUM_CONFIG_OFFSET + MAXCONFIG);	/* second copy */
 		    wlabel_on = 0;			    /* enable writing the label */
 		    if (error == 0)
-			error = (*devsw(udev2dev(drive->dev,0))->d_ioctl) (udev2dev(drive->dev,0), /* make the label non-writeable again */
+			error = (*devsw(drive->dev)->d_ioctl) (drive->dev, /* make the label non-writeable again */
 			    DIOCWLABEL,
 			    (caddr_t) & wlabel_on,
 			    FWRITE,
diff -u ./vinumrequest.c org/vinumrequest.c
--- ./vinumrequest.c	Sat Mar 24 17:39:09 2001
+++ org/vinumrequest.c	Sat Mar 24 17:21:59 2001
@@ -816,7 +816,7 @@
      * when the drive is dead.
      */
     if ((rqe->flags & XFR_BAD_SUBDISK) == 0)		    /* subdisk is accessible, */
-	bp->b_dev = udev2dev(DRIVE[rqe->driveno].dev,0);		    /* drive device */
+	bp->b_dev = DRIVE[rqe->driveno].dev;		    /* drive device */
     bp->b_blkno = rqe->sdoffset + sd->driveoffset;	    /* start address */
     bp->b_bcount = rqe->buflen << DEV_BSHIFT;		    /* number of bytes to transfer */
     bp->b_resid = bp->b_bcount;				    /* and it's still all waiting */
@@ -931,7 +931,7 @@
     sbp->b.b_bufsize = bp->b_bufsize;			    /* buffer size */
     sbp->b.b_bcount = bp->b_bcount;			    /* number of bytes to transfer */
     sbp->b.b_resid = bp->b_resid;			    /* and amount waiting */
-    sbp->b.b_dev = udev2dev(DRIVE[sd->driveno].dev,0);		    /* device */
+    sbp->b.b_dev = DRIVE[sd->driveno].dev;		    /* device */
     sbp->b.b_data = bp->b_data;				    /* data buffer */
     sbp->b.b_blkno = bp->b_blkno + sd->driveoffset;
     sbp->b.b_iodone = sdio_done;			    /* come here on completion */
diff -u ./vinumvar.h org/vinumvar.h
--- ./vinumvar.h	Sat Mar 24 17:22:09 2001
+++ org/vinumvar.h	Sat Mar 24 17:22:00 2001
@@ -406,7 +406,7 @@
 	u_int64_t sectors;				    /* and length in sectors */
     } *freelist;
     struct partinfo partinfo;				    /* partition information */
-    udev_t dev;						    /* device information */
+    dev_t dev;						    /* device information */
 #ifdef VINUMDEBUG
     char lockfilename[16];				    /* name of file from which we were locked */
     int lockline;					    /* and the line number */
home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3ABD2676.2070909>