提交 a5c126a5 编写于 作者: A Al Viro 提交者: Mike Marshall

orangefs: make precopy_buffers() take iov_iter

Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: NMike Marshall <hubcap@omnibond.com>
上级 5f0e3c95
...@@ -31,13 +31,10 @@ do { \ ...@@ -31,13 +31,10 @@ do { \
*/ */
static int precopy_buffers(struct pvfs2_bufmap *bufmap, static int precopy_buffers(struct pvfs2_bufmap *bufmap,
int buffer_index, int buffer_index,
const struct iovec *vec, struct iov_iter *iter,
unsigned long nr_segs,
size_t total_size) size_t total_size)
{ {
int ret = 0; int ret = 0;
struct iov_iter iter;
/* /*
* copy data from application/kernel by pulling it out * copy data from application/kernel by pulling it out
* of the iovec. * of the iovec.
...@@ -45,9 +42,8 @@ static int precopy_buffers(struct pvfs2_bufmap *bufmap, ...@@ -45,9 +42,8 @@ static int precopy_buffers(struct pvfs2_bufmap *bufmap,
if (total_size) { if (total_size) {
iov_iter_init(&iter, WRITE, vec, nr_segs, total_size);
ret = pvfs_bufmap_copy_from_iovec(bufmap, ret = pvfs_bufmap_copy_from_iovec(bufmap,
&iter, iter,
buffer_index, buffer_index,
total_size); total_size);
if (ret < 0) if (ret < 0)
...@@ -152,10 +148,11 @@ static ssize_t wait_for_direct_io(enum PVFS_io_type type, struct inode *inode, ...@@ -152,10 +148,11 @@ static ssize_t wait_for_direct_io(enum PVFS_io_type type, struct inode *inode,
* precopy_buffers only pertains to writes. * precopy_buffers only pertains to writes.
*/ */
if (type == PVFS_IO_WRITE) { if (type == PVFS_IO_WRITE) {
struct iov_iter iter;
iov_iter_init(&iter, WRITE, vec, nr_segs, total_size);
ret = precopy_buffers(bufmap, ret = precopy_buffers(bufmap,
buffer_index, buffer_index,
vec, &iter,
nr_segs,
total_size); total_size);
if (ret < 0) if (ret < 0)
goto out; goto out;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册