Skip to contentSkip to conversation

Net: ceph: messenger: Use local variable cursor in read_partial_msg_data()

PATCH Superseded Shraddha Barke 2 participants 2 messages Oct 18, 2015 Ceph common code (libceph)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Net: ceph: messenger: Use local variable cursor in read_partial_msg_data()

Use local variable cursor in place of &msg->cursor in
read_partial_msg_data()

---
 net/ceph/messenger.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
net/ceph/messenger.c +3 -3
index b9b0e3b..b3d1973 100644
@@ -2231,7 +2231,7 @@ static int read_partial_message_section(struct ceph_connection *con,
 static int read_partial_msg_data(struct ceph_connection *con)
 {
 	struct ceph_msg *msg = con->in_msg;
-	struct ceph_msg_data_cursor *cursor = &msg->cursor;
+	struct ceph_msg_data_cursor *cursor = cursor;
 	const bool do_datacrc = !con->msgr->nocrc;
 	struct page *page;
 	size_t page_offset;
@@ -2246,7 +2246,7 @@ static int read_partial_msg_data(struct ceph_connection *con)
 	if (do_datacrc)
 		crc = con->in_data_crc;
 	while (cursor->resid) {
-		page = ceph_msg_data_next(&msg->cursor, &page_offset, &length,
+		page = ceph_msg_data_next(cursor, &page_offset, &length,
 							NULL);
 		ret = ceph_tcp_recvpage(con->sock, page, page_offset, length);
 		if (ret <= 0) {
@@ -2258,7 +2258,7 @@ static int read_partial_msg_data(struct ceph_connection *con)
 
 		if (do_datacrc)
 			crc = ceph_crc32c_page(crc, page, page_offset, ret);
-		(void) ceph_msg_data_advance(&msg->cursor, (size_t)ret);
+		(void) ceph_msg_data_advance(cursor, (size_t)ret);
 	}
 	if (do_datacrc)
 		con->in_data_crc = crc;
Signature · 1 line
2.1.4
maintainer
#1 lore raw
Quoted 13 lines · Shraddha Barke

Use local variable cursor in place of &msg->cursor in
read_partial_msg_data()

---
 net/ceph/messenger.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
net/ceph/messenger.c +0 -0
index b9b0e3b..b3d1973 100644

net/ceph/messenger.c static int read_partial_message_section(struct ceph_connection *con, · line 2234

Quoted 5 lines
net/ceph/messenger.c +1 -1
@@ -2231,7 +2231,7 @@ static int read_partial_message_section(struct ceph_connection *con,
 static int read_partial_msg_data(struct ceph_connection *con)
 {
        struct ceph_msg *msg = con->in_msg;
-       struct ceph_msg_data_cursor *cursor = &msg->cursor;
+       struct ceph_msg_data_cursor *cursor = cursor;
                                      ^^^^^^^^^^^^^^^^

This is not going to work...

Thanks,

Ilya