Skip to contentSkip to conversation

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

PATCH In review Shraddha Barke 3 participants 3 messages Oct 19, 2015 Ceph common code (libceph)

lore
Share & tools
lore
#0 lore raw

PATCH v2 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()

---
Changes in v2-
Drop incorrect use of cursor

 net/ceph/messenger.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
net/ceph/messenger.c +2 -2
index b9b0e3b..b087edd 100644
@@ -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 25 lines · Shraddha Barke

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

---
Changes in v2-
Drop incorrect use of cursor

 net/ceph/messenger.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
net/ceph/messenger.c +1 -1
index b9b0e3b..b087edd 100644
@@ -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) {

net/ceph/messenger.c static int read_partial_msg_data(struct ceph_connection *con) · line 2264

Quoted 8 lines
net/ceph/messenger.c +1 -1
@@ -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;

This looks good. I'd like you to update this patch to do the same for write_partial_message_data().

Thanks,

Ilya

#2 lore raw
In reply to Shraddha Barke
Quoted 4 lines · Shraddha Barke

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

This is a pretty minor comment, but the "Net" in your subject line is probably better *not* capitalized.

-Alex

Quoted 30 lines

---
Changes in v2-
Drop incorrect use of cursor

 net/ceph/messenger.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
net/ceph/messenger.c +2 -2
index b9b0e3b..b087edd 100644
@@ -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;