aboutsummaryrefslogtreecommitdiff
path: root/fs/xfs/linux-2.6/xfs_lrw.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@suse.de>2006-04-11 14:57:50 +0200
committerJens Axboe <axboe@nelson.home.kernel.dk>2006-04-11 15:47:07 +0200
commitcbb7e577e732f576b9f399bc2600bdc0626c68dc (patch)
tree55e3d65c9d9fb5b0ee25d0ccabf951de6da2db7b /fs/xfs/linux-2.6/xfs_lrw.c
parent2514395ef88b46e895726a8d40966cb83de7940c (diff)
[PATCH] splice: pass offset around for ->splice_read() and ->splice_write()
We need not use ->f_pos as the offset for the file input/output. If the user passed an offset pointer in through sys_splice(), just use that and leave ->f_pos alone. Signed-off-by: Jens Axboe <axboe@suse.de>
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_lrw.c')
-rw-r--r--fs/xfs/linux-2.6/xfs_lrw.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/fs/xfs/linux-2.6/xfs_lrw.c b/fs/xfs/linux-2.6/xfs_lrw.c
index 74a52937f20..67efe330898 100644
--- a/fs/xfs/linux-2.6/xfs_lrw.c
+++ b/fs/xfs/linux-2.6/xfs_lrw.c
@@ -338,6 +338,7 @@ ssize_t
xfs_splice_read(
bhv_desc_t *bdp,
struct file *infilp,
+ loff_t *ppos,
struct pipe_inode_info *pipe,
size_t count,
int flags,
@@ -360,7 +361,7 @@ xfs_splice_read(
int error;
error = XFS_SEND_DATA(mp, DM_EVENT_READ, BHV_TO_VNODE(bdp),
- infilp->f_pos, count,
+ *ppos, count,
FILP_DELAY_FLAG(infilp), &locktype);
if (error) {
xfs_iunlock(ip, XFS_IOLOCK_SHARED);
@@ -368,8 +369,8 @@ xfs_splice_read(
}
}
xfs_rw_enter_trace(XFS_SPLICE_READ_ENTER, &ip->i_iocore,
- pipe, count, infilp->f_pos, ioflags);
- ret = generic_file_splice_read(infilp, pipe, count, flags);
+ pipe, count, *ppos, ioflags);
+ ret = generic_file_splice_read(infilp, ppos, pipe, count, flags);
if (ret > 0)
XFS_STATS_ADD(xs_read_bytes, ret);
@@ -382,6 +383,7 @@ xfs_splice_write(
bhv_desc_t *bdp,
struct pipe_inode_info *pipe,
struct file *outfilp,
+ loff_t *ppos,
size_t count,
int flags,
int ioflags,
@@ -403,7 +405,7 @@ xfs_splice_write(
int error;
error = XFS_SEND_DATA(mp, DM_EVENT_WRITE, BHV_TO_VNODE(bdp),
- outfilp->f_pos, count,
+ *ppos, count,
FILP_DELAY_FLAG(outfilp), &locktype);
if (error) {
xfs_iunlock(ip, XFS_IOLOCK_EXCL);
@@ -411,8 +413,8 @@ xfs_splice_write(
}
}
xfs_rw_enter_trace(XFS_SPLICE_WRITE_ENTER, &ip->i_iocore,
- pipe, count, outfilp->f_pos, ioflags);
- ret = generic_file_splice_write(pipe, outfilp, count, flags);
+ pipe, count, *ppos, ioflags);
+ ret = generic_file_splice_write(pipe, outfilp, ppos, count, flags);
if (ret > 0)
XFS_STATS_ADD(xs_write_bytes, ret);