Merge tag 'pull-iov_iter' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull iov_iter updates from Al Viro:
"iov_iter work; most of that is about getting rid of direction
misannotations and (hopefully) preventing more of the same for the
future"
* tag 'pull-iov_iter' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
use less confusing names for iov_iter direction initializers
iov_iter: saner checks for attempt to copy to/from iterator
[xen] fix "direction" argument of iov_iter_kvec()
[vhost] fix 'direction' argument of iov_iter_{init,bvec}()
[target] fix iov_iter_bvec() "direction" argument
[s390] memcpy_real(): WRITE is "data source", not destination...
[s390] zcore: WRITE is "data source", not destination...
[infiniband] READ is "data destination", not source...
[fsi] WRITE is "data source", not destination...
[s390] copy_oldmem_kernel() - WRITE is "data source", not destination
csum_and_copy_to_iter(): handle ITER_DISCARD
get rid of unlikely() on page_copy_sane() calls
This commit is contained in:
@@ -30,7 +30,7 @@ static int ceph_tcp_recvmsg(struct socket *sock, void *buf, size_t len)
|
||||
if (!buf)
|
||||
msg.msg_flags |= MSG_TRUNC;
|
||||
|
||||
iov_iter_kvec(&msg.msg_iter, READ, &iov, 1, len);
|
||||
iov_iter_kvec(&msg.msg_iter, ITER_DEST, &iov, 1, len);
|
||||
r = sock_recvmsg(sock, &msg, msg.msg_flags);
|
||||
if (r == -EAGAIN)
|
||||
r = 0;
|
||||
@@ -49,7 +49,7 @@ static int ceph_tcp_recvpage(struct socket *sock, struct page *page,
|
||||
int r;
|
||||
|
||||
BUG_ON(page_offset + length > PAGE_SIZE);
|
||||
iov_iter_bvec(&msg.msg_iter, READ, &bvec, 1, length);
|
||||
iov_iter_bvec(&msg.msg_iter, ITER_DEST, &bvec, 1, length);
|
||||
r = sock_recvmsg(sock, &msg, msg.msg_flags);
|
||||
if (r == -EAGAIN)
|
||||
r = 0;
|
||||
|
||||
@@ -168,7 +168,7 @@ static int do_try_sendpage(struct socket *sock, struct iov_iter *it)
|
||||
bv.bv_offset, bv.bv_len,
|
||||
CEPH_MSG_FLAGS);
|
||||
} else {
|
||||
iov_iter_bvec(&msg.msg_iter, WRITE, &bv, 1, bv.bv_len);
|
||||
iov_iter_bvec(&msg.msg_iter, ITER_SOURCE, &bv, 1, bv.bv_len);
|
||||
ret = sock_sendmsg(sock, &msg);
|
||||
}
|
||||
if (ret <= 0) {
|
||||
@@ -225,7 +225,7 @@ static void reset_in_kvecs(struct ceph_connection *con)
|
||||
WARN_ON(iov_iter_count(&con->v2.in_iter));
|
||||
|
||||
con->v2.in_kvec_cnt = 0;
|
||||
iov_iter_kvec(&con->v2.in_iter, READ, con->v2.in_kvecs, 0, 0);
|
||||
iov_iter_kvec(&con->v2.in_iter, ITER_DEST, con->v2.in_kvecs, 0, 0);
|
||||
}
|
||||
|
||||
static void set_in_bvec(struct ceph_connection *con, const struct bio_vec *bv)
|
||||
@@ -233,7 +233,7 @@ static void set_in_bvec(struct ceph_connection *con, const struct bio_vec *bv)
|
||||
WARN_ON(iov_iter_count(&con->v2.in_iter));
|
||||
|
||||
con->v2.in_bvec = *bv;
|
||||
iov_iter_bvec(&con->v2.in_iter, READ, &con->v2.in_bvec, 1, bv->bv_len);
|
||||
iov_iter_bvec(&con->v2.in_iter, ITER_DEST, &con->v2.in_bvec, 1, bv->bv_len);
|
||||
}
|
||||
|
||||
static void set_in_skip(struct ceph_connection *con, int len)
|
||||
@@ -241,7 +241,7 @@ static void set_in_skip(struct ceph_connection *con, int len)
|
||||
WARN_ON(iov_iter_count(&con->v2.in_iter));
|
||||
|
||||
dout("%s con %p len %d\n", __func__, con, len);
|
||||
iov_iter_discard(&con->v2.in_iter, READ, len);
|
||||
iov_iter_discard(&con->v2.in_iter, ITER_DEST, len);
|
||||
}
|
||||
|
||||
static void add_out_kvec(struct ceph_connection *con, void *buf, int len)
|
||||
@@ -265,7 +265,7 @@ static void reset_out_kvecs(struct ceph_connection *con)
|
||||
|
||||
con->v2.out_kvec_cnt = 0;
|
||||
|
||||
iov_iter_kvec(&con->v2.out_iter, WRITE, con->v2.out_kvecs, 0, 0);
|
||||
iov_iter_kvec(&con->v2.out_iter, ITER_SOURCE, con->v2.out_kvecs, 0, 0);
|
||||
con->v2.out_iter_sendpage = false;
|
||||
}
|
||||
|
||||
@@ -277,7 +277,7 @@ static void set_out_bvec(struct ceph_connection *con, const struct bio_vec *bv,
|
||||
|
||||
con->v2.out_bvec = *bv;
|
||||
con->v2.out_iter_sendpage = zerocopy;
|
||||
iov_iter_bvec(&con->v2.out_iter, WRITE, &con->v2.out_bvec, 1,
|
||||
iov_iter_bvec(&con->v2.out_iter, ITER_SOURCE, &con->v2.out_bvec, 1,
|
||||
con->v2.out_bvec.bv_len);
|
||||
}
|
||||
|
||||
@@ -290,7 +290,7 @@ static void set_out_bvec_zero(struct ceph_connection *con)
|
||||
con->v2.out_bvec.bv_offset = 0;
|
||||
con->v2.out_bvec.bv_len = min(con->v2.out_zero, (int)PAGE_SIZE);
|
||||
con->v2.out_iter_sendpage = true;
|
||||
iov_iter_bvec(&con->v2.out_iter, WRITE, &con->v2.out_bvec, 1,
|
||||
iov_iter_bvec(&con->v2.out_iter, ITER_SOURCE, &con->v2.out_bvec, 1,
|
||||
con->v2.out_bvec.bv_len);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user