Commit e1c54b64 authored by Jan Blunck's avatar Jan Blunck Committed by Linus Torvalds

osst: update ppos instead of using file->f_pos

osst_read()/osst_write() modify file->f_pos directly instead of the ppos
given to them.  The VFS later updates the file->f_pos and overwrites it
with the value of ppos.
Signed-off-by: default avatarJan Blunck <jblunck@suse.de>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Willem Riede <osst@riede.org>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent f6ae31c2
...@@ -3587,7 +3587,7 @@ if (SRpnt) printk(KERN_ERR "%s:A: Not supposed to have SRpnt at line %d\n", name ...@@ -3587,7 +3587,7 @@ if (SRpnt) printk(KERN_ERR "%s:A: Not supposed to have SRpnt at line %d\n", name
if (i == (-ENOSPC)) { if (i == (-ENOSPC)) {
transfer = STp->buffer->writing; /* FIXME -- check this logic */ transfer = STp->buffer->writing; /* FIXME -- check this logic */
if (transfer <= do_count) { if (transfer <= do_count) {
filp->f_pos += do_count - transfer; *ppos += do_count - transfer;
count -= do_count - transfer; count -= do_count - transfer;
if (STps->drv_block >= 0) { if (STps->drv_block >= 0) {
STps->drv_block += (do_count - transfer) / STp->block_size; STps->drv_block += (do_count - transfer) / STp->block_size;
...@@ -3625,7 +3625,7 @@ if (SRpnt) printk(KERN_ERR "%s:A: Not supposed to have SRpnt at line %d\n", name ...@@ -3625,7 +3625,7 @@ if (SRpnt) printk(KERN_ERR "%s:A: Not supposed to have SRpnt at line %d\n", name
goto out; goto out;
} }
filp->f_pos += do_count; *ppos += do_count;
b_point += do_count; b_point += do_count;
count -= do_count; count -= do_count;
if (STps->drv_block >= 0) { if (STps->drv_block >= 0) {
...@@ -3647,7 +3647,7 @@ if (SRpnt) printk(KERN_ERR "%s:A: Not supposed to have SRpnt at line %d\n", name ...@@ -3647,7 +3647,7 @@ if (SRpnt) printk(KERN_ERR "%s:A: Not supposed to have SRpnt at line %d\n", name
if (STps->drv_block >= 0) { if (STps->drv_block >= 0) {
STps->drv_block += blks; STps->drv_block += blks;
} }
filp->f_pos += count; *ppos += count;
count = 0; count = 0;
} }
...@@ -3823,7 +3823,7 @@ static ssize_t osst_read(struct file * filp, char __user * buf, size_t count, lo ...@@ -3823,7 +3823,7 @@ static ssize_t osst_read(struct file * filp, char __user * buf, size_t count, lo
} }
STp->logical_blk_num += transfer / STp->block_size; STp->logical_blk_num += transfer / STp->block_size;
STps->drv_block += transfer / STp->block_size; STps->drv_block += transfer / STp->block_size;
filp->f_pos += transfer; *ppos += transfer;
buf += transfer; buf += transfer;
total += transfer; total += transfer;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment