Skip to content

Commit

Permalink
generic_file_direct_write(): get rid of ppos argument
Browse files Browse the repository at this point in the history
always equal to &iocb->ki_pos.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Apr 2, 2014
1 parent 867c4f9 commit 5cb6c6c
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion fs/btrfs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -1640,7 +1640,7 @@ static ssize_t __btrfs_direct_write(struct kiocb *iocb,
loff_t endbyte;
int err;

written = generic_file_direct_write(iocb, iov, &nr_segs, pos, &iocb->ki_pos,
written = generic_file_direct_write(iocb, iov, &nr_segs, pos,
count, ocount);

if (written < 0 || written == count)
Expand Down
3 changes: 1 addition & 2 deletions fs/fuse/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -1143,8 +1143,7 @@ static ssize_t fuse_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
goto out;

if (file->f_flags & O_DIRECT) {
written = generic_file_direct_write(iocb, iov, &nr_segs,
pos, &iocb->ki_pos,
written = generic_file_direct_write(iocb, iov, &nr_segs, pos,
count, ocount);
if (written < 0 || written == count)
goto out;
Expand Down
2 changes: 1 addition & 1 deletion fs/ocfs2/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -2375,7 +2375,7 @@ static ssize_t ocfs2_file_aio_write(struct kiocb *iocb,

if (direct_io) {
written = generic_file_direct_write(iocb, iov, &nr_segs, *ppos,
ppos, count, ocount);
count, ocount);
if (written < 0) {
ret = written;
goto out_dio;
Expand Down
2 changes: 1 addition & 1 deletion fs/xfs/xfs_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ xfs_file_dio_aio_write(

trace_xfs_file_direct_write(ip, count, iocb->ki_pos, 0);
ret = generic_file_direct_write(iocb, iovp,
&nr_segs, pos, &iocb->ki_pos, count, ocount);
&nr_segs, pos, count, ocount);

out:
xfs_rw_iunlock(ip, iolock);
Expand Down
2 changes: 1 addition & 1 deletion include/linux/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -2395,7 +2395,7 @@ extern ssize_t generic_file_aio_read(struct kiocb *, const struct iovec *, unsig
extern ssize_t __generic_file_aio_write(struct kiocb *, const struct iovec *, unsigned long);
extern ssize_t generic_file_aio_write(struct kiocb *, const struct iovec *, unsigned long, loff_t);
extern ssize_t generic_file_direct_write(struct kiocb *, const struct iovec *,
unsigned long *, loff_t, loff_t *, size_t, size_t);
unsigned long *, loff_t, size_t, size_t);
extern ssize_t generic_file_buffered_write(struct kiocb *, const struct iovec *,
unsigned long, loff_t, size_t, ssize_t);
extern ssize_t do_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos);
Expand Down
6 changes: 3 additions & 3 deletions mm/filemap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1985,7 +1985,7 @@ EXPORT_SYMBOL(pagecache_write_end);

ssize_t
generic_file_direct_write(struct kiocb *iocb, const struct iovec *iov,
unsigned long *nr_segs, loff_t pos, loff_t *ppos,
unsigned long *nr_segs, loff_t pos,
size_t count, size_t ocount)
{
struct file *file = iocb->ki_filp;
Expand Down Expand Up @@ -2046,7 +2046,7 @@ generic_file_direct_write(struct kiocb *iocb, const struct iovec *iov,
i_size_write(inode, pos);
mark_inode_dirty(inode);
}
*ppos = pos;
iocb->ki_pos = pos;
}
out:
return written;
Expand Down Expand Up @@ -2265,7 +2265,7 @@ ssize_t __generic_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
ssize_t written_buffered;

written = generic_file_direct_write(iocb, iov, &nr_segs, pos,
&iocb->ki_pos, count, ocount);
count, ocount);
if (written < 0 || written == count)
goto out;
/*
Expand Down

0 comments on commit 5cb6c6c

Please sign in to comment.