patch-2.3.3 linux/drivers/scsi/sd_ioctl.c
Next file: linux/drivers/scsi/sr_ioctl.c
Previous file: linux/drivers/sbus/char/pcikbd.c
Back to the patch index
Back to the overall index
- Lines: 56
- Date:
Sat May 15 23:43:04 1999
- Orig file:
v2.3.2/linux/drivers/scsi/sd_ioctl.c
- Orig date:
Wed Feb 24 16:27:54 1999
diff -u --recursive --new-file v2.3.2/linux/drivers/scsi/sd_ioctl.c linux/drivers/scsi/sd_ioctl.c
@@ -15,6 +15,7 @@
#define MAJOR_NR SCSI_DISK0_MAJOR
#include <linux/blk.h>
+#include <linux/blkpg.h>
#include "scsi.h"
#include <scsi/scsi_ioctl.h>
#include "hosts.h"
@@ -79,41 +80,19 @@
(long *) arg);
return 0;
+ case BLKROSET:
+ case BLKROGET:
case BLKRASET:
- if (!capable(CAP_SYS_ADMIN))
- 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, (long *) arg, sizeof(long));
- if (error)
- return error;
- put_user(read_ahead[MAJOR(inode->i_rdev)], (long *) arg);
- return 0;
-
case BLKFLSBUF:
- if(!capable(CAP_SYS_ADMIN)) return -EACCES;
- if(!(inode->i_rdev)) return -EINVAL;
- fsync_dev(inode->i_rdev);
- invalidate_buffers(inode->i_rdev);
- return 0;
-
+ case BLKSSZGET:
+ case BLKPG:
+ return blk_ioctl(inode->i_rdev, cmd, arg);
+
case BLKRRPART: /* Re-read partition tables */
if (!capable(CAP_SYS_ADMIN))
return -EACCES;
return revalidate_scsidisk(dev, 1);
-
- case BLKSSZGET:
- /* Block size of media */
- return put_user(blksize_size[MAJOR(dev)][MINOR(dev)&0x0F],
- (int *)arg);
-
- RO_IOCTLS(dev, arg);
default:
return scsi_ioctl(rscsi_disks[DEVICE_NR(dev)].device , cmd, (void *) arg);
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)