patch-1.3.28 linux/drivers/block/sbpcd.c

Next file: linux/drivers/block/sjcd.c
Previous file: linux/drivers/block/ramdisk.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.27/linux/drivers/block/sbpcd.c linux/drivers/block/sbpcd.c
@@ -434,7 +434,7 @@
 static int sbp_data(void);
 static int cmd_out(void);
 static int DiskInfo(void);
-static int sbpcd_chk_disk_change(dev_t);
+static int sbpcd_chk_disk_change(kdev_t);
 
 /*==========================================================================*/
 
@@ -4340,7 +4340,7 @@
 		
 	case BLKRASET:
 		if(!suser())  return -EACCES;
-		if(!inode->i_rdev) return -EINVAL;
+		if(!(inode->i_rdev)) return -EINVAL;
 		if(arg > 0xff) return -EINVAL;
 		read_ahead[MAJOR(inode->i_rdev)] = arg;
 		return (0);
@@ -4383,17 +4383,20 @@
 	INIT_REQUEST;
 	sti();
 	
-	if ((CURRENT==NULL)||(CURRENT->dev<0)) goto err_done;
-	if (CURRENT -> sector == -1) goto err_done;
+	if ((CURRENT == NULL) || CURRENT->rq_status == RQ_INACTIVE)
+		goto err_done;
+	if (CURRENT -> sector == -1)
+		goto err_done;
 	if (CURRENT->cmd != READ)
 	{
 		msg(DBG_INF, "bad cmd %d\n", CURRENT->cmd);
 		goto err_done;
 	}
-	i = MINOR(CURRENT->dev);
+	i = MINOR(CURRENT->rq_dev);
 	if ( (i<0) || (i>=NR_SBPCD) || (D_S[i].drv_id==-1))
 	{
-		msg(DBG_INF, "do_request: bad device: %04X\n", CURRENT->dev);
+		msg(DBG_INF, "do_request: bad device: %s\n",
+			kdevname(CURRENT->rq_dev));
 		goto err_done;
 	}
 	while (busy_audio) sbp_sleep(HZ); /* wait a bit */
@@ -5358,7 +5361,7 @@
  * used externally (isofs/inode.c, fs/buffer.c)
  * Currently disabled (has to get "synchronized").
  */
-static int sbpcd_chk_disk_change(dev_t full_dev)
+static int sbpcd_chk_disk_change(kdev_t full_dev)
 {
 	int i, st;
 	

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this