diff options
author | Shraddha Barke <shraddha.6596@gmail.com> | 2015-10-19 12:29:00 -0400 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2015-11-02 17:36:47 -0500 |
commit | 343128ce91836d4131ead74b53d83b72e93d55b2 (patch) | |
tree | d20fca67a6182ab68af92e6e1ddbd810403ead35 /net/ceph/messenger.c | |
parent | 70cf052d0c4b60b6fbb981380660893306b9f172 (diff) |
libceph: use local variable cursor instead of &msg->cursor
Use local variable cursor in place of &msg->cursor in
read_partial_msg_data() and write_partial_msg_data().
Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'net/ceph/messenger.c')
-rw-r--r-- | net/ceph/messenger.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index b9b0e3b5da49..fce6ad636613 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c | |||
@@ -1552,8 +1552,8 @@ static int write_partial_message_data(struct ceph_connection *con) | |||
1552 | bool need_crc; | 1552 | bool need_crc; |
1553 | int ret; | 1553 | int ret; |
1554 | 1554 | ||
1555 | page = ceph_msg_data_next(&msg->cursor, &page_offset, &length, | 1555 | page = ceph_msg_data_next(cursor, &page_offset, &length, |
1556 | &last_piece); | 1556 | &last_piece); |
1557 | ret = ceph_tcp_sendpage(con->sock, page, page_offset, | 1557 | ret = ceph_tcp_sendpage(con->sock, page, page_offset, |
1558 | length, !last_piece); | 1558 | length, !last_piece); |
1559 | if (ret <= 0) { | 1559 | if (ret <= 0) { |
@@ -1564,7 +1564,7 @@ static int write_partial_message_data(struct ceph_connection *con) | |||
1564 | } | 1564 | } |
1565 | if (do_datacrc && cursor->need_crc) | 1565 | if (do_datacrc && cursor->need_crc) |
1566 | crc = ceph_crc32c_page(crc, page, page_offset, length); | 1566 | crc = ceph_crc32c_page(crc, page, page_offset, length); |
1567 | need_crc = ceph_msg_data_advance(&msg->cursor, (size_t)ret); | 1567 | need_crc = ceph_msg_data_advance(cursor, (size_t)ret); |
1568 | } | 1568 | } |
1569 | 1569 | ||
1570 | dout("%s %p msg %p done\n", __func__, con, msg); | 1570 | dout("%s %p msg %p done\n", __func__, con, msg); |
@@ -2246,8 +2246,7 @@ static int read_partial_msg_data(struct ceph_connection *con) | |||
2246 | if (do_datacrc) | 2246 | if (do_datacrc) |
2247 | crc = con->in_data_crc; | 2247 | crc = con->in_data_crc; |
2248 | while (cursor->resid) { | 2248 | while (cursor->resid) { |
2249 | page = ceph_msg_data_next(&msg->cursor, &page_offset, &length, | 2249 | page = ceph_msg_data_next(cursor, &page_offset, &length, NULL); |
2250 | NULL); | ||
2251 | ret = ceph_tcp_recvpage(con->sock, page, page_offset, length); | 2250 | ret = ceph_tcp_recvpage(con->sock, page, page_offset, length); |
2252 | if (ret <= 0) { | 2251 | if (ret <= 0) { |
2253 | if (do_datacrc) | 2252 | if (do_datacrc) |
@@ -2258,7 +2257,7 @@ static int read_partial_msg_data(struct ceph_connection *con) | |||
2258 | 2257 | ||
2259 | if (do_datacrc) | 2258 | if (do_datacrc) |
2260 | crc = ceph_crc32c_page(crc, page, page_offset, ret); | 2259 | crc = ceph_crc32c_page(crc, page, page_offset, ret); |
2261 | (void) ceph_msg_data_advance(&msg->cursor, (size_t)ret); | 2260 | (void) ceph_msg_data_advance(cursor, (size_t)ret); |
2262 | } | 2261 | } |
2263 | if (do_datacrc) | 2262 | if (do_datacrc) |
2264 | con->in_data_crc = crc; | 2263 | con->in_data_crc = crc; |