summaryrefslogtreecommitdiffstats
path: root/net/ceph/messenger.c
diff options
context:
space:
mode:
authorAlex Elder2013-03-09 01:51:03 +0100
committerSage Weil2013-05-02 06:16:32 +0200
commitb3d56fab333bbb3ac7300843d69e52d7bd8a016b (patch)
tree1d22ae5f71a1c7f3b025366e3deef4c1baa7f63d /net/ceph/messenger.c
parentlibceph: change type of ceph_tcp_sendpage() "more" (diff)
downloadkernel-qcow2-linux-b3d56fab333bbb3ac7300843d69e52d7bd8a016b.tar.gz
kernel-qcow2-linux-b3d56fab333bbb3ac7300843d69e52d7bd8a016b.tar.xz
kernel-qcow2-linux-b3d56fab333bbb3ac7300843d69e52d7bd8a016b.zip
libceph: kill args in read_partial_message_bio()
There is only one caller for read_partial_message_bio(), and it always passes &msg->bio_iter and &bio_seg as the second and third arguments. Furthermore, the message in question is always the connection's in_msg, and we can get that inside the called function. So drop those two parameters and use their derived equivalents. Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'net/ceph/messenger.c')
-rw-r--r--net/ceph/messenger.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index 962b2cd10f43..2017b8833baa 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -1819,14 +1819,16 @@ static int read_partial_message_pages(struct ceph_connection *con,
#ifdef CONFIG_BLOCK
static int read_partial_message_bio(struct ceph_connection *con,
- struct bio **bio_iter,
- unsigned int *bio_seg,
unsigned int data_len, bool do_datacrc)
{
- struct bio_vec *bv = bio_iovec_idx(*bio_iter, *bio_seg);
+ struct ceph_msg *msg = con->in_msg;
+ struct bio_vec *bv;
void *p;
int ret, left;
+ BUG_ON(!msg);
+ BUG_ON(!msg->bio_iter);
+ bv = bio_iovec_idx(msg->bio_iter, msg->bio_seg);
left = min((int)(data_len - con->in_msg_pos.data_pos),
(int)(bv->bv_len - con->in_msg_pos.page_pos));
@@ -1845,7 +1847,7 @@ static int read_partial_message_bio(struct ceph_connection *con,
con->in_msg_pos.page_pos += ret;
if (con->in_msg_pos.page_pos == bv->bv_len) {
con->in_msg_pos.page_pos = 0;
- iter_bio_next(bio_iter, bio_seg);
+ iter_bio_next(&msg->bio_iter, &msg->bio_seg);
}
return ret;
@@ -1975,9 +1977,7 @@ static int read_partial_message(struct ceph_connection *con)
return ret;
#ifdef CONFIG_BLOCK
} else if (m->bio) {
- BUG_ON(!m->bio_iter);
ret = read_partial_message_bio(con,
- &m->bio_iter, &m->bio_seg,
data_len, do_datacrc);
if (ret <= 0)
return ret;