aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2013-03-12 00:34:23 -0400
committerSage Weil <sage@inktank.com>2013-05-02 00:17:33 -0400
commit859a35d5523e8e6a5c3568c12febe2e1270bc3a1 (patch)
tree0aab4623ec39fd01e229c24a97f04a46e9179efd /net
parent643c68a4a990612720479078f3450d5b766da9f2 (diff)
libceph: kill most of ceph_msg_pos
All but one of the fields in the ceph_msg_pos structure are now never used (only assigned), so get rid of them. This allows several small blocks of code to go away. This is cleanup of old code related to: http://tracker.ceph.com/issues/4428 Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'net')
-rw-r--r--net/ceph/messenger.c22
1 files changed, 1 insertions, 21 deletions
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index 2fabf006e8f5..19f9fffc170c 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -1083,14 +1083,6 @@ static void prepare_message_data(struct ceph_msg *msg,
1083 data_len = le32_to_cpu(msg->hdr.data_len); 1083 data_len = le32_to_cpu(msg->hdr.data_len);
1084 BUG_ON(!data_len); 1084 BUG_ON(!data_len);
1085 1085
1086 /* initialize page iterator */
1087 msg_pos->page = 0;
1088 if (ceph_msg_has_data(msg))
1089 msg_pos->page_pos = msg->data.alignment;
1090 else
1091 msg_pos->page_pos = 0;
1092 msg_pos->data_pos = 0;
1093
1094 /* Initialize data cursor */ 1086 /* Initialize data cursor */
1095 1087
1096 ceph_msg_data_cursor_init(&msg->data, data_len); 1088 ceph_msg_data_cursor_init(&msg->data, data_len);
@@ -1402,8 +1394,6 @@ static void out_msg_pos_next(struct ceph_connection *con, struct page *page,
1402 BUG_ON(!msg); 1394 BUG_ON(!msg);
1403 BUG_ON(!sent); 1395 BUG_ON(!sent);
1404 1396
1405 msg_pos->data_pos += sent;
1406 msg_pos->page_pos += sent;
1407 need_crc = ceph_msg_data_advance(&msg->data, sent); 1397 need_crc = ceph_msg_data_advance(&msg->data, sent);
1408 BUG_ON(need_crc && sent != len); 1398 BUG_ON(need_crc && sent != len);
1409 1399
@@ -1411,8 +1401,6 @@ static void out_msg_pos_next(struct ceph_connection *con, struct page *page,
1411 return; 1401 return;
1412 1402
1413 BUG_ON(sent != len); 1403 BUG_ON(sent != len);
1414 msg_pos->page_pos = 0;
1415 msg_pos->page++;
1416 msg_pos->did_page_crc = false; 1404 msg_pos->did_page_crc = false;
1417} 1405}
1418 1406
@@ -1420,21 +1408,16 @@ static void in_msg_pos_next(struct ceph_connection *con, size_t len,
1420 size_t received) 1408 size_t received)
1421{ 1409{
1422 struct ceph_msg *msg = con->in_msg; 1410 struct ceph_msg *msg = con->in_msg;
1423 struct ceph_msg_pos *msg_pos = &con->in_msg_pos;
1424 1411
1425 BUG_ON(!msg); 1412 BUG_ON(!msg);
1426 BUG_ON(!received); 1413 BUG_ON(!received);
1427 1414
1428 msg_pos->data_pos += received;
1429 msg_pos->page_pos += received;
1430 (void) ceph_msg_data_advance(&msg->data, received); 1415 (void) ceph_msg_data_advance(&msg->data, received);
1431 1416
1432 if (received < len) 1417 if (received < len)
1433 return; 1418 return;
1434 1419
1435 BUG_ON(received != len); 1420 BUG_ON(received != len);
1436 msg_pos->page_pos = 0;
1437 msg_pos->page++;
1438} 1421}
1439 1422
1440static u32 ceph_crc32c_page(u32 crc, struct page *page, 1423static u32 ceph_crc32c_page(u32 crc, struct page *page,
@@ -1465,8 +1448,7 @@ static int write_partial_message_data(struct ceph_connection *con)
1465 bool do_datacrc = !con->msgr->nocrc; 1448 bool do_datacrc = !con->msgr->nocrc;
1466 int ret; 1449 int ret;
1467 1450
1468 dout("%s %p msg %p page %d offset %d\n", __func__, 1451 dout("%s %p msg %p\n", __func__, con, msg);
1469 con, msg, msg_pos->page, msg_pos->page_pos);
1470 1452
1471 if (WARN_ON(!ceph_msg_has_data(msg))) 1453 if (WARN_ON(!ceph_msg_has_data(msg)))
1472 return -EINVAL; 1454 return -EINVAL;
@@ -2159,7 +2141,6 @@ static int read_partial_msg_data(struct ceph_connection *con)
2159 struct ceph_msg *msg = con->in_msg; 2141 struct ceph_msg *msg = con->in_msg;
2160 struct ceph_msg_data_cursor *cursor = &msg->data.cursor; 2142 struct ceph_msg_data_cursor *cursor = &msg->data.cursor;
2161 const bool do_datacrc = !con->msgr->nocrc; 2143 const bool do_datacrc = !con->msgr->nocrc;
2162 unsigned int data_len;
2163 struct page *page; 2144 struct page *page;
2164 size_t page_offset; 2145 size_t page_offset;
2165 size_t length; 2146 size_t length;
@@ -2169,7 +2150,6 @@ static int read_partial_msg_data(struct ceph_connection *con)
2169 if (WARN_ON(!ceph_msg_has_data(msg))) 2150 if (WARN_ON(!ceph_msg_has_data(msg)))
2170 return -EIO; 2151 return -EIO;
2171 2152
2172 data_len = le32_to_cpu(con->in_hdr.data_len);
2173 while (cursor->resid) { 2153 while (cursor->resid) {
2174 page = ceph_msg_data_next(&msg->data, &page_offset, &length, 2154 page = ceph_msg_data_next(&msg->data, &page_offset, &length,
2175 NULL); 2155 NULL);