patch-2.1.60 linux/drivers/block/ide-tape.c
Next file: linux/drivers/block/md.c
Previous file: linux/drivers/block/floppy.c
Back to the patch index
Back to the overall index
- Lines: 42
- Date:
Tue Oct 21 08:57:28 1997
- Orig file:
v2.1.59/linux/drivers/block/ide-tape.c
- Orig date:
Tue May 13 22:41:05 1997
diff -u --recursive --new-file v2.1.59/linux/drivers/block/ide-tape.c linux/drivers/block/ide-tape.c
@@ -2883,11 +2883,18 @@
* size will only result in a (slightly) increased driver overhead, but
* will no longer hit performance.
*/
-static long idetape_chrdev_read (struct inode *inode, struct file *file, char *buf, unsigned long count)
+static ssize_t idetape_chrdev_read (struct file *file, char *buf,
+ size_t count, loff_t *ppos)
{
+ struct inode *inode = file->f_dentry->d_inode;
ide_drive_t *drive = get_drive_ptr (inode->i_rdev);
idetape_tape_t *tape = drive->driver_data;
- int bytes_read,temp,actually_read=0;
+ ssize_t bytes_read,temp,actually_read=0;
+
+ if (ppos != &file->f_pos) {
+ /* "A request was outside the capabilities of the device." */
+ return -ENXIO;
+ }
#if IDETAPE_DEBUG_LOG
printk (KERN_INFO "Reached idetape_chrdev_read\n");
@@ -2953,11 +2960,18 @@
return (actually_read);
}
-static long idetape_chrdev_write (struct inode *inode, struct file *file, const char *buf, unsigned long count)
+static ssize_t idetape_chrdev_write (struct file *file, const char *buf,
+ size_t count, loff_t *ppos)
{
+ struct inode *inode = file->f_dentry->d_inode;
ide_drive_t *drive = get_drive_ptr (inode->i_rdev);
idetape_tape_t *tape = drive->driver_data;
- int retval,actually_written=0;
+ ssize_t retval,actually_written=0;
+
+ if (ppos != &file->f_pos) {
+ /* "A request was outside the capabilities of the device." */
+ return -ENXIO;
+ }
#if IDETAPE_DEBUG_LOG
printk (KERN_INFO "Reached idetape_chrdev_write\n");
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov