Commit fc276122 authored by David Howells's avatar David Howells

afs: Switch the naming of call->iter and call->_iter

Change the name of call->iter to call->def_iter to represent the default
iterator.

Change the name of call->_iter to call->iter to represent the iterator
actually being used.
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
parent 1b87b025
...@@ -342,14 +342,14 @@ static int afs_deliver_cb_callback(struct afs_call *call) ...@@ -342,14 +342,14 @@ static int afs_deliver_cb_callback(struct afs_call *call)
if (call->count2 != call->count && call->count2 != 0) if (call->count2 != call->count && call->count2 != 0)
return afs_protocol_error(call, -EBADMSG, return afs_protocol_error(call, -EBADMSG,
afs_eproto_cb_count); afs_eproto_cb_count);
call->_iter = &call->iter; call->iter = &call->def_iter;
iov_iter_discard(&call->iter, READ, call->count2 * 3 * 4); iov_iter_discard(&call->def_iter, READ, call->count2 * 3 * 4);
call->unmarshall++; call->unmarshall++;
/* Fall through */ /* Fall through */
case 4: case 4:
_debug("extract discard %zu/%u", _debug("extract discard %zu/%u",
iov_iter_count(&call->iter), call->count2 * 3 * 4); iov_iter_count(call->iter), call->count2 * 3 * 4);
ret = afs_extract_data(call, false); ret = afs_extract_data(call, false);
if (ret < 0) if (ret < 0)
......
...@@ -323,7 +323,7 @@ static int afs_deliver_fs_fetch_data(struct afs_call *call) ...@@ -323,7 +323,7 @@ static int afs_deliver_fs_fetch_data(struct afs_call *call)
int ret; int ret;
_enter("{%u,%zu/%llu}", _enter("{%u,%zu/%llu}",
call->unmarshall, iov_iter_count(call->_iter), req->actual_len); call->unmarshall, iov_iter_count(call->iter), req->actual_len);
switch (call->unmarshall) { switch (call->unmarshall) {
case 0: case 0:
...@@ -363,14 +363,14 @@ static int afs_deliver_fs_fetch_data(struct afs_call *call) ...@@ -363,14 +363,14 @@ static int afs_deliver_fs_fetch_data(struct afs_call *call)
call->bvec[0].bv_len = size; call->bvec[0].bv_len = size;
call->bvec[0].bv_offset = req->offset; call->bvec[0].bv_offset = req->offset;
call->bvec[0].bv_page = req->pages[req->index]; call->bvec[0].bv_page = req->pages[req->index];
iov_iter_bvec(&call->iter, READ, call->bvec, 1, size); iov_iter_bvec(&call->def_iter, READ, call->bvec, 1, size);
ASSERTCMP(size, <=, PAGE_SIZE); ASSERTCMP(size, <=, PAGE_SIZE);
/* Fall through */ /* Fall through */
/* extract the returned data */ /* extract the returned data */
case 2: case 2:
_debug("extract data %zu/%llu", _debug("extract data %zu/%llu",
iov_iter_count(call->_iter), req->remain); iov_iter_count(call->iter), req->remain);
ret = afs_extract_data(call, true); ret = afs_extract_data(call, true);
if (ret < 0) if (ret < 0)
...@@ -398,7 +398,7 @@ static int afs_deliver_fs_fetch_data(struct afs_call *call) ...@@ -398,7 +398,7 @@ static int afs_deliver_fs_fetch_data(struct afs_call *call)
case 3: case 3:
_debug("extract discard %zu/%llu", _debug("extract discard %zu/%llu",
iov_iter_count(call->_iter), req->actual_len - req->len); iov_iter_count(call->iter), req->actual_len - req->len);
ret = afs_extract_data(call, true); ret = afs_extract_data(call, true);
if (ret < 0) if (ret < 0)
...@@ -1852,7 +1852,7 @@ static int afs_deliver_fs_get_capabilities(struct afs_call *call) ...@@ -1852,7 +1852,7 @@ static int afs_deliver_fs_get_capabilities(struct afs_call *call)
u32 count; u32 count;
int ret; int ret;
_enter("{%u,%zu}", call->unmarshall, iov_iter_count(call->_iter)); _enter("{%u,%zu}", call->unmarshall, iov_iter_count(call->iter));
switch (call->unmarshall) { switch (call->unmarshall) {
case 0: case 0:
......
...@@ -115,9 +115,9 @@ struct afs_call { ...@@ -115,9 +115,9 @@ struct afs_call {
struct afs_vnode *lvnode; /* vnode being locked */ struct afs_vnode *lvnode; /* vnode being locked */
void *request; /* request data (first part) */ void *request; /* request data (first part) */
struct address_space *mapping; /* Pages being written from */ struct address_space *mapping; /* Pages being written from */
struct iov_iter iter; /* Buffer iterator */ struct iov_iter def_iter; /* Default buffer/data iterator */
struct iov_iter *_iter; /* Iterator currently in use */ struct iov_iter *iter; /* Iterator currently in use */
union { /* Convenience for ->iter */ union { /* Convenience for ->def_iter */
struct kvec kvec[1]; struct kvec kvec[1];
struct bio_vec bvec[1]; struct bio_vec bvec[1];
}; };
...@@ -1136,7 +1136,7 @@ static inline void afs_extract_begin(struct afs_call *call, void *buf, size_t si ...@@ -1136,7 +1136,7 @@ static inline void afs_extract_begin(struct afs_call *call, void *buf, size_t si
{ {
call->kvec[0].iov_base = buf; call->kvec[0].iov_base = buf;
call->kvec[0].iov_len = size; call->kvec[0].iov_len = size;
iov_iter_kvec(&call->iter, READ, call->kvec, 1, size); iov_iter_kvec(&call->def_iter, READ, call->kvec, 1, size);
} }
static inline void afs_extract_to_tmp(struct afs_call *call) static inline void afs_extract_to_tmp(struct afs_call *call)
...@@ -1151,7 +1151,7 @@ static inline void afs_extract_to_tmp64(struct afs_call *call) ...@@ -1151,7 +1151,7 @@ static inline void afs_extract_to_tmp64(struct afs_call *call)
static inline void afs_extract_discard(struct afs_call *call, size_t size) static inline void afs_extract_discard(struct afs_call *call, size_t size)
{ {
iov_iter_discard(&call->iter, READ, size); iov_iter_discard(&call->def_iter, READ, size);
} }
static inline void afs_extract_to_buf(struct afs_call *call, size_t size) static inline void afs_extract_to_buf(struct afs_call *call, size_t size)
......
...@@ -152,7 +152,7 @@ static struct afs_call *afs_alloc_call(struct afs_net *net, ...@@ -152,7 +152,7 @@ static struct afs_call *afs_alloc_call(struct afs_net *net,
INIT_WORK(&call->async_work, afs_process_async_call); INIT_WORK(&call->async_work, afs_process_async_call);
init_waitqueue_head(&call->waitq); init_waitqueue_head(&call->waitq);
spin_lock_init(&call->state_lock); spin_lock_init(&call->state_lock);
call->_iter = &call->iter; call->iter = &call->def_iter;
o = atomic_inc_return(&net->nr_outstanding_calls); o = atomic_inc_return(&net->nr_outstanding_calls);
trace_afs_call(call, afs_call_trace_alloc, 1, o, trace_afs_call(call, afs_call_trace_alloc, 1, o,
...@@ -513,12 +513,12 @@ static void afs_deliver_to_call(struct afs_call *call) ...@@ -513,12 +513,12 @@ static void afs_deliver_to_call(struct afs_call *call)
state == AFS_CALL_SV_AWAIT_ACK state == AFS_CALL_SV_AWAIT_ACK
) { ) {
if (state == AFS_CALL_SV_AWAIT_ACK) { if (state == AFS_CALL_SV_AWAIT_ACK) {
iov_iter_kvec(&call->iter, READ, NULL, 0, 0); iov_iter_kvec(&call->def_iter, READ, NULL, 0, 0);
ret = rxrpc_kernel_recv_data(call->net->socket, ret = rxrpc_kernel_recv_data(call->net->socket,
call->rxcall, &call->iter, call->rxcall, &call->def_iter,
false, &remote_abort, false, &remote_abort,
&call->service_id); &call->service_id);
trace_afs_receive_data(call, &call->iter, false, ret); trace_afs_receive_data(call, &call->def_iter, false, ret);
if (ret == -EINPROGRESS || ret == -EAGAIN) if (ret == -EINPROGRESS || ret == -EAGAIN)
return; return;
...@@ -858,7 +858,7 @@ static int afs_deliver_cm_op_id(struct afs_call *call) ...@@ -858,7 +858,7 @@ static int afs_deliver_cm_op_id(struct afs_call *call)
{ {
int ret; int ret;
_enter("{%zu}", iov_iter_count(call->_iter)); _enter("{%zu}", iov_iter_count(call->iter));
/* the operation ID forms the first four bytes of the request data */ /* the operation ID forms the first four bytes of the request data */
ret = afs_extract_data(call, true); ret = afs_extract_data(call, true);
...@@ -974,7 +974,7 @@ void afs_send_simple_reply(struct afs_call *call, const void *buf, size_t len) ...@@ -974,7 +974,7 @@ void afs_send_simple_reply(struct afs_call *call, const void *buf, size_t len)
int afs_extract_data(struct afs_call *call, bool want_more) int afs_extract_data(struct afs_call *call, bool want_more)
{ {
struct afs_net *net = call->net; struct afs_net *net = call->net;
struct iov_iter *iter = call->_iter; struct iov_iter *iter = call->iter;
enum afs_call_state state; enum afs_call_state state;
u32 remote_abort = 0; u32 remote_abort = 0;
int ret; int ret;
......
...@@ -185,7 +185,7 @@ static int afs_deliver_vl_get_addrs_u(struct afs_call *call) ...@@ -185,7 +185,7 @@ static int afs_deliver_vl_get_addrs_u(struct afs_call *call)
int i, ret; int i, ret;
_enter("{%u,%zu/%u}", _enter("{%u,%zu/%u}",
call->unmarshall, iov_iter_count(call->_iter), call->count); call->unmarshall, iov_iter_count(call->iter), call->count);
switch (call->unmarshall) { switch (call->unmarshall) {
case 0: case 0:
...@@ -316,7 +316,7 @@ static int afs_deliver_vl_get_capabilities(struct afs_call *call) ...@@ -316,7 +316,7 @@ static int afs_deliver_vl_get_capabilities(struct afs_call *call)
int ret; int ret;
_enter("{%u,%zu/%u}", _enter("{%u,%zu/%u}",
call->unmarshall, iov_iter_count(call->_iter), call->count); call->unmarshall, iov_iter_count(call->iter), call->count);
switch (call->unmarshall) { switch (call->unmarshall) {
case 0: case 0:
...@@ -425,7 +425,7 @@ static int afs_deliver_yfsvl_get_endpoints(struct afs_call *call) ...@@ -425,7 +425,7 @@ static int afs_deliver_yfsvl_get_endpoints(struct afs_call *call)
int ret; int ret;
_enter("{%u,%zu,%u}", _enter("{%u,%zu,%u}",
call->unmarshall, iov_iter_count(call->_iter), call->count2); call->unmarshall, iov_iter_count(call->iter), call->count2);
switch (call->unmarshall) { switch (call->unmarshall) {
case 0: case 0:
......
...@@ -441,7 +441,7 @@ static int yfs_deliver_fs_fetch_data64(struct afs_call *call) ...@@ -441,7 +441,7 @@ static int yfs_deliver_fs_fetch_data64(struct afs_call *call)
int ret; int ret;
_enter("{%u,%zu/%llu}", _enter("{%u,%zu/%llu}",
call->unmarshall, iov_iter_count(call->_iter), req->actual_len); call->unmarshall, iov_iter_count(call->iter), req->actual_len);
switch (call->unmarshall) { switch (call->unmarshall) {
case 0: case 0:
...@@ -476,14 +476,14 @@ static int yfs_deliver_fs_fetch_data64(struct afs_call *call) ...@@ -476,14 +476,14 @@ static int yfs_deliver_fs_fetch_data64(struct afs_call *call)
call->bvec[0].bv_len = size; call->bvec[0].bv_len = size;
call->bvec[0].bv_offset = req->offset; call->bvec[0].bv_offset = req->offset;
call->bvec[0].bv_page = req->pages[req->index]; call->bvec[0].bv_page = req->pages[req->index];
iov_iter_bvec(&call->iter, READ, call->bvec, 1, size); iov_iter_bvec(&call->def_iter, READ, call->bvec, 1, size);
ASSERTCMP(size, <=, PAGE_SIZE); ASSERTCMP(size, <=, PAGE_SIZE);
/* Fall through */ /* Fall through */
/* extract the returned data */ /* extract the returned data */
case 2: case 2:
_debug("extract data %zu/%llu", _debug("extract data %zu/%llu",
iov_iter_count(call->_iter), req->remain); iov_iter_count(call->iter), req->remain);
ret = afs_extract_data(call, true); ret = afs_extract_data(call, true);
if (ret < 0) if (ret < 0)
...@@ -511,7 +511,7 @@ static int yfs_deliver_fs_fetch_data64(struct afs_call *call) ...@@ -511,7 +511,7 @@ static int yfs_deliver_fs_fetch_data64(struct afs_call *call)
case 3: case 3:
_debug("extract discard %zu/%llu", _debug("extract discard %zu/%llu",
iov_iter_count(call->_iter), req->actual_len - req->len); iov_iter_count(call->iter), req->actual_len - req->len);
ret = afs_extract_data(call, true); ret = afs_extract_data(call, true);
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