patch-2.1.60 linux/drivers/block/floppy.c

Next file: linux/drivers/block/ide-tape.c
Previous file: linux/arch/sparc64/kernel/binfmt_aout32.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.59/linux/drivers/block/floppy.c linux/drivers/block/floppy.c
@@ -3463,20 +3463,22 @@
 		printk("\n");
 }
 
-static long floppy_read(struct inode * inode, struct file * filp,
-		       char * buf, unsigned long count)
+static ssize_t floppy_read(struct file * filp, char *buf,
+			   size_t count, loff_t *ppos)
 {
+	struct inode *inode = filp->f_dentry->d_inode;
 	int drive = DRIVE(inode->i_rdev);
 
 	check_disk_change(inode->i_rdev);
 	if (UTESTF(FD_DISK_CHANGED))
 		return -ENXIO;
-	return block_read(inode, filp, buf, count);
+	return block_read(filp, buf, count, ppos);
 }
 
-static long floppy_write(struct inode * inode, struct file * filp,
-			const char * buf, unsigned long count)
+static ssize_t floppy_write(struct file * filp, const char * buf,
+			    size_t count, loff_t *ppos)
 {
+	struct inode * inode = filp->f_dentry->d_inode;
 	int block;
 	int ret;
 	int drive = DRIVE(inode->i_rdev);
@@ -3488,9 +3490,9 @@
 		return -ENXIO;
 	if (!UTESTF(FD_DISK_WRITABLE))
 		return -EROFS;
-	block = (filp->f_pos + count) >> 9;
+	block = (*ppos + count) >> 9;
 	INFBOUND(UDRS->maxblock, block);
-	ret= block_write(inode, filp, buf, count);
+	ret= block_write(filp, buf, count, ppos);
 	return ret;
 }
 

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