aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2013-03-08 19:51:03 -0500
committerSage Weil <sage@inktank.com>2013-05-02 00:16:32 -0400
commitb3d56fab333bbb3ac7300843d69e52d7bd8a016b (patch)
tree1d22ae5f71a1c7f3b025366e3deef4c1baa7f63d
parente1dcb128f88958e7212fdd7ceebba4f84d6bc47a (diff)
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>
-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,
1819 1819
1820#ifdef CONFIG_BLOCK 1820#ifdef CONFIG_BLOCK
1821static int read_partial_message_bio(struct ceph_connection *con, 1821static int read_partial_message_bio(struct ceph_connection *con,
1822 struct bio **bio_iter,
1823 unsigned int *bio_seg,
1824 unsigned int data_len, bool do_datacrc) 1822 unsigned int data_len, bool do_datacrc)
1825{ 1823{
1826 struct bio_vec *bv = bio_iovec_idx(*bio_iter, *bio_seg); 1824 struct ceph_msg *msg = con->in_msg;
1825 struct bio_vec *bv;
1827 void *p; 1826 void *p;
1828 int ret, left; 1827 int ret, left;
1829 1828
1829 BUG_ON(!msg);
1830 BUG_ON(!msg->bio_iter);
1831 bv = bio_iovec_idx(msg->bio_iter, msg->bio_seg);
1830 left = min((int)(data_len - con->in_msg_pos.data_pos), 1832 left = min((int)(data_len - con->in_msg_pos.data_pos),
1831 (int)(bv->bv_len - con->in_msg_pos.page_pos)); 1833 (int)(bv->bv_len - con->in_msg_pos.page_pos));
1832 1834
@@ -1845,7 +1847,7 @@ static int read_partial_message_bio(struct ceph_connection *con,
1845 con->in_msg_pos.page_pos += ret; 1847 con->in_msg_pos.page_pos += ret;
1846 if (con->in_msg_pos.page_pos == bv->bv_len) { 1848 if (con->in_msg_pos.page_pos == bv->bv_len) {
1847 con->in_msg_pos.page_pos = 0; 1849 con->in_msg_pos.page_pos = 0;
1848 iter_bio_next(bio_iter, bio_seg); 1850 iter_bio_next(&msg->bio_iter, &msg->bio_seg);
1849 } 1851 }
1850 1852
1851 return ret; 1853 return ret;
@@ -1975,9 +1977,7 @@ static int read_partial_message(struct ceph_connection *con)
1975 return ret; 1977 return ret;
1976#ifdef CONFIG_BLOCK 1978#ifdef CONFIG_BLOCK
1977 } else if (m->bio) { 1979 } else if (m->bio) {
1978 BUG_ON(!m->bio_iter);
1979 ret = read_partial_message_bio(con, 1980 ret = read_partial_message_bio(con,
1980 &m->bio_iter, &m->bio_seg,
1981 data_len, do_datacrc); 1981 data_len, do_datacrc);
1982 if (ret <= 0) 1982 if (ret <= 0)
1983 return ret; 1983 return ret;