Commit 41fc56d5 authored by Al Viro's avatar Al Viro

kill the 4th argument of __generic_file_aio_write()

It's always equal to &iocb->ki_pos, where iocb is the value of the 1st
argument.
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent b2f42cfe
...@@ -1518,7 +1518,7 @@ ssize_t blkdev_aio_write(struct kiocb *iocb, const struct iovec *iov, ...@@ -1518,7 +1518,7 @@ ssize_t blkdev_aio_write(struct kiocb *iocb, const struct iovec *iov,
BUG_ON(iocb->ki_pos != pos); BUG_ON(iocb->ki_pos != pos);
blk_start_plug(&plug); blk_start_plug(&plug);
ret = __generic_file_aio_write(iocb, iov, nr_segs, &iocb->ki_pos); ret = __generic_file_aio_write(iocb, iov, nr_segs);
if (ret > 0) { if (ret > 0) {
ssize_t err; ssize_t err;
......
...@@ -146,7 +146,7 @@ ext4_file_dio_write(struct kiocb *iocb, const struct iovec *iov, ...@@ -146,7 +146,7 @@ ext4_file_dio_write(struct kiocb *iocb, const struct iovec *iov,
overwrite = 1; overwrite = 1;
} }
ret = __generic_file_aio_write(iocb, iov, nr_segs, &iocb->ki_pos); ret = __generic_file_aio_write(iocb, iov, nr_segs);
mutex_unlock(&inode->i_mutex); mutex_unlock(&inode->i_mutex);
if (ret > 0) { if (ret > 0) {
......
...@@ -171,7 +171,7 @@ static ssize_t udf_file_aio_write(struct kiocb *iocb, const struct iovec *iov, ...@@ -171,7 +171,7 @@ static ssize_t udf_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
} else } else
up_write(&iinfo->i_data_sem); up_write(&iinfo->i_data_sem);
retval = __generic_file_aio_write(iocb, iov, nr_segs, &iocb->ki_pos); retval = __generic_file_aio_write(iocb, iov, nr_segs);
mutex_unlock(&inode->i_mutex); mutex_unlock(&inode->i_mutex);
if (retval > 0) { if (retval > 0) {
......
...@@ -2392,8 +2392,7 @@ extern int generic_file_remap_pages(struct vm_area_struct *, unsigned long addr, ...@@ -2392,8 +2392,7 @@ extern int generic_file_remap_pages(struct vm_area_struct *, unsigned long addr,
unsigned long size, pgoff_t pgoff); unsigned long size, pgoff_t pgoff);
int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk); int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk);
extern ssize_t generic_file_aio_read(struct kiocb *, const struct iovec *, unsigned long, loff_t); extern ssize_t generic_file_aio_read(struct kiocb *, const struct iovec *, unsigned long, loff_t);
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_aio_write(struct kiocb *, const struct iovec *, unsigned long, loff_t); 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 *, 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, loff_t *, size_t, size_t);
......
...@@ -2222,14 +2222,14 @@ EXPORT_SYMBOL(generic_file_buffered_write); ...@@ -2222,14 +2222,14 @@ EXPORT_SYMBOL(generic_file_buffered_write);
* avoid syncing under i_mutex. * avoid syncing under i_mutex.
*/ */
ssize_t __generic_file_aio_write(struct kiocb *iocb, const struct iovec *iov, ssize_t __generic_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
unsigned long nr_segs, loff_t *ppos) unsigned long nr_segs)
{ {
struct file *file = iocb->ki_filp; struct file *file = iocb->ki_filp;
struct address_space * mapping = file->f_mapping; struct address_space * mapping = file->f_mapping;
size_t ocount; /* original count */ size_t ocount; /* original count */
size_t count; /* after file limit checks */ size_t count; /* after file limit checks */
struct inode *inode = mapping->host; struct inode *inode = mapping->host;
loff_t pos; loff_t pos = iocb->ki_pos;
ssize_t written; ssize_t written;
ssize_t err; ssize_t err;
...@@ -2239,7 +2239,6 @@ ssize_t __generic_file_aio_write(struct kiocb *iocb, const struct iovec *iov, ...@@ -2239,7 +2239,6 @@ ssize_t __generic_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
return err; return err;
count = ocount; count = ocount;
pos = *ppos;
/* We can write back this queue in page reclaim */ /* We can write back this queue in page reclaim */
current->backing_dev_info = mapping->backing_dev_info; current->backing_dev_info = mapping->backing_dev_info;
...@@ -2266,7 +2265,7 @@ ssize_t __generic_file_aio_write(struct kiocb *iocb, const struct iovec *iov, ...@@ -2266,7 +2265,7 @@ ssize_t __generic_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
ssize_t written_buffered; ssize_t written_buffered;
written = generic_file_direct_write(iocb, iov, &nr_segs, pos, written = generic_file_direct_write(iocb, iov, &nr_segs, pos,
ppos, count, ocount); &iocb->ki_pos, count, ocount);
if (written < 0 || written == count) if (written < 0 || written == count)
goto out; goto out;
/* /*
...@@ -2276,7 +2275,7 @@ ssize_t __generic_file_aio_write(struct kiocb *iocb, const struct iovec *iov, ...@@ -2276,7 +2275,7 @@ ssize_t __generic_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
pos += written; pos += written;
count -= written; count -= written;
written_buffered = generic_file_buffered_write(iocb, iov, written_buffered = generic_file_buffered_write(iocb, iov,
nr_segs, pos, ppos, count, nr_segs, pos, &iocb->ki_pos, count,
written); written);
/* /*
* If generic_file_buffered_write() retuned a synchronous error * If generic_file_buffered_write() retuned a synchronous error
...@@ -2310,7 +2309,7 @@ ssize_t __generic_file_aio_write(struct kiocb *iocb, const struct iovec *iov, ...@@ -2310,7 +2309,7 @@ ssize_t __generic_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
} }
} else { } else {
written = generic_file_buffered_write(iocb, iov, nr_segs, written = generic_file_buffered_write(iocb, iov, nr_segs,
pos, ppos, count, written); pos, &iocb->ki_pos, count, written);
} }
out: out:
current->backing_dev_info = NULL; current->backing_dev_info = NULL;
...@@ -2339,7 +2338,7 @@ ssize_t generic_file_aio_write(struct kiocb *iocb, const struct iovec *iov, ...@@ -2339,7 +2338,7 @@ ssize_t generic_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
BUG_ON(iocb->ki_pos != pos); BUG_ON(iocb->ki_pos != pos);
mutex_lock(&inode->i_mutex); mutex_lock(&inode->i_mutex);
ret = __generic_file_aio_write(iocb, iov, nr_segs, &iocb->ki_pos); ret = __generic_file_aio_write(iocb, iov, nr_segs);
mutex_unlock(&inode->i_mutex); mutex_unlock(&inode->i_mutex);
if (ret > 0) { if (ret > 0) {
......
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