patch-2.1.60 linux/drivers/scsi/sg.c

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

diff -u --recursive --new-file v2.1.59/linux/drivers/scsi/sg.c linux/drivers/scsi/sg.c
@@ -200,12 +200,19 @@
  * complete semaphores to tell us whether the buffer is available for us
  * and whether the command is actually done.
  */
-static long sg_read(struct inode *inode,struct file *filp,char *buf,unsigned long count)
+static ssize_t sg_read(struct file *filp, char *buf,
+                       size_t count, loff_t *ppos)
 {
+    struct inode *inode = filp->f_dentry->d_inode;
     int dev=MINOR(inode->i_rdev);
     int i;
     unsigned long flags;
     struct scsi_generic *device=&scsi_generics[dev];
+
+    if (ppos != &filp->f_pos) {
+      /* FIXME: Hmm.  Seek to the right place, or fail?  */
+    }
+
     if ((i=verify_area(VERIFY_WRITE,buf,count)))
 	return i;
 
@@ -322,8 +329,10 @@
     wake_up(&scsi_generics[dev].read_wait);
 }
 
-static long sg_write(struct inode *inode,struct file *filp,const char *buf,unsigned long count)
+static ssize_t sg_write(struct file *filp, const char *buf, 
+                        size_t count, loff_t *ppos)
 {
+    struct inode         *inode = filp->f_dentry->d_inode;
     int			  bsize,size,amt,i;
     unsigned char	  cmnd[MAX_COMMAND_SIZE];
     kdev_t		  devt = inode->i_rdev;
@@ -332,6 +341,10 @@
     int			  input_size;
     unsigned char	  opcode;
     Scsi_Cmnd		* SCpnt;
+
+    if (ppos != &filp->f_pos) {
+      /* FIXME: Hmm.  Seek to the right place, or fail?  */
+    }
 
     if ((i=verify_area(VERIFY_READ,buf,count)))
 	return i;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov