patch-1.3.70 linux/drivers/scsi/sd_ioctl.c

Next file: linux/drivers/scsi/seagate.c
Previous file: linux/drivers/scsi/scsi.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.69/linux/drivers/scsi/sd_ioctl.c linux/drivers/scsi/sd_ioctl.c
@@ -54,12 +54,24 @@
 	put_user(sd[MINOR(inode->i_rdev)].nr_sects,
 		 (long *) arg);
 	return 0;
+
     case BLKRASET:
-	if(!suser())  return -EACCES;
+	if (!suser())
+		return -EACCES;
 	if(!(inode->i_rdev)) return -EINVAL;
 	if(arg > 0xff) return -EINVAL;
 	read_ahead[MAJOR(inode->i_rdev)] = arg;
 	return 0;
+
+    case BLKRAGET:
+	if (!arg)
+		return -EINVAL;
+	error = verify_area(VERIFY_WRITE, (int *) arg, sizeof(int));
+	if (error)
+	    return error;
+	put_user(read_ahead[MAJOR(inode->i_rdev)], (int *) arg);
+	return 0;
+
     case BLKFLSBUF:
 	if(!suser())  return -EACCES;
 	if(!(inode->i_rdev)) return -EINVAL;

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