diff mbox

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

Message ID 1445222975-16086-1-git-send-email-shraddha.6596@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Shraddha Barke Oct. 19, 2015, 2:49 a.m. UTC
Use local variable cursor in place of &msg->cursor in
 read_partial_msg_data()

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
---
Changes in v2-
 Drop incorrect use of cursor

 net/ceph/messenger.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Ilya Dryomov Oct. 19, 2015, 9:43 a.m. UTC | #1
On Mon, Oct 19, 2015 at 4:49 AM, Shraddha Barke <shraddha.6596@gmail.com> wrote:
> Use local variable cursor in place of &msg->cursor in
>  read_partial_msg_data()
>
> Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
> ---
> Changes in v2-
>  Drop incorrect use of cursor
>
>  net/ceph/messenger.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
> index b9b0e3b..b087edd 100644
> --- a/net/ceph/messenger.c
> +++ b/net/ceph/messenger.c
> @@ -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;

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

Thanks,

                Ilya
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Alex Elder Oct. 19, 2015, 12:22 p.m. UTC | #2
On 10/18/2015 09:49 PM, Shraddha Barke wrote:
> Use local variable cursor in place of &msg->cursor in
>  read_partial_msg_data()
> 
> Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>

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

					-Alex

> ---
> Changes in v2-
>  Drop incorrect use of cursor
> 
>  net/ceph/messenger.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
> index b9b0e3b..b087edd 100644
> --- a/net/ceph/messenger.c
> +++ b/net/ceph/messenger.c
> @@ -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;
> 

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index b9b0e3b..b087edd 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -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;