Commit 43e79be5 authored by Kai Mäkisara's avatar Kai Mäkisara Committed by James Bottomley

[PATCH] SCSI tape fixes: remove f_pos handling

This patch applies over the previous patch in this thread. The patch removes
updating filp->f_pos. It has been dead code since 2.6.8 and nobody has missed
it.
Signed-off-by: default avatarKai Makisara <kai.makisara@kolumbus.fi>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent e8ad22ba
...@@ -1156,9 +1156,7 @@ static int st_flush(struct file *filp) ...@@ -1156,9 +1156,7 @@ static int st_flush(struct file *filp)
if (STps->rw == ST_WRITING && !STp->pos_unknown) { if (STps->rw == ST_WRITING && !STp->pos_unknown) {
struct st_cmdstatus *cmdstatp = &STp->buffer->cmdstat; struct st_cmdstatus *cmdstatp = &STp->buffer->cmdstat;
DEBC(printk(ST_DEB_MSG "%s: File length %lld bytes.\n", DEBC(printk(ST_DEB_MSG "%s: Async write waits %d, finished %d.\n",
name, (long long)filp->f_pos);
printk(ST_DEB_MSG "%s: Async write waits %d, finished %d.\n",
name, STp->nbr_waits, STp->nbr_finished); name, STp->nbr_waits, STp->nbr_finished);
) )
...@@ -1520,7 +1518,6 @@ st_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos) ...@@ -1520,7 +1518,6 @@ st_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos)
} }
} }
count -= do_count; count -= do_count;
filp->f_pos += do_count;
b_point += do_count; b_point += do_count;
async_write = STp->block_size == 0 && !STbp->do_dio && async_write = STp->block_size == 0 && !STbp->do_dio &&
...@@ -1580,7 +1577,6 @@ st_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos) ...@@ -1580,7 +1577,6 @@ st_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos)
undone = 0; undone = 0;
if (STp->block_size != 0) if (STp->block_size != 0)
undone *= STp->block_size; undone *= STp->block_size;
filp->f_pos -= undone;
if (undone <= do_count) { if (undone <= do_count) {
/* Only data from this write is not written */ /* Only data from this write is not written */
count += undone; count += undone;
...@@ -1629,7 +1625,6 @@ st_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos) ...@@ -1629,7 +1625,6 @@ st_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos)
} }
} }
} else { } else {
filp->f_pos -= do_count;
count += do_count; count += do_count;
STps->drv_block = (-1); /* Too cautious? */ STps->drv_block = (-1); /* Too cautious? */
retval = (-EIO); retval = (-EIO);
...@@ -1958,7 +1953,6 @@ st_read(struct file *filp, char __user *buf, size_t count, loff_t * ppos) ...@@ -1958,7 +1953,6 @@ st_read(struct file *filp, char __user *buf, size_t count, loff_t * ppos)
goto out; goto out;
} }
} }
filp->f_pos += 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