All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Elder <elder@inktank.com>
To: Sage Weil <sage@inktank.com>
Cc: ceph-devel@vger.kernel.org
Subject: Re: [PATCH 3/3] ceph: messenger: change read_partial() to take "end" arg
Date: Mon, 14 May 2012 11:28:51 -0500	[thread overview]
Message-ID: <4FB132C3.8090306@inktank.com> (raw)
In-Reply-To: <Pine.LNX.4.64.1205121708080.21796@cobra.newdream.net>

On 05/12/2012 07:11 PM, Sage Weil wrote:
> This looks correct, but seems like a more confusing calling convention
> to me.  Before this patch it's basically a (start, len) logical
> range in the input stream.. after it's (end, len).  It also seems to be
> more code?
>
> sage
>
> On Thu, 10 May 2012, Alex Elder wrote:
>
>> Make the second argument to read_partial() be the ending input byte
>> position rather than the beginning offset it now represents.  This
>> amounts to moving the addition "to + size" into the caller.
>>
>> Signed-off-by: Alex Elder<elder@inktank.com>
>> ---

Note that this patch also left the local variable "to" in
read_partial_message() unused.  I'll delete its definition
before I commit.

Thanks for the review.

					-Alex

. . .
>> @@ -1755,8 +1771,9 @@ static int read_partial_message(struct ceph_connection
>> *con)
>>   	}
>>
>>   	/* footer */
>> -	to = sizeof (m->hdr);
>> -	ret = read_partial(con, to, sizeof (m->footer),&m->footer);
>> +	size = sizeof (m->footer);
>> +	end += size;
>> +	ret = read_partial(con, end, size,&m->footer);
>>   	if (ret<= 0)
>>   		return ret;
>>
>> --
>> 1.7.9.5
>>
>> --
>> 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
>>
>>
>


      parent reply	other threads:[~2012-05-14 16:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-10 22:56 [PATCH 0/3] ceph: messenger: read_partial() cleanups Alex Elder
2012-05-11  1:18 ` [PATCH 1/3] ceph: messenger: use read_partial() in read_partial_message() Alex Elder
2012-05-12 23:54   ` Sage Weil
2012-05-11  1:18 ` [PATCH 2/3] ceph: messenger: update "to" in read_partial() caller Alex Elder
2012-05-12 23:55   ` Sage Weil
2012-05-11  1:18 ` [PATCH 3/3] ceph: messenger: change read_partial() to take "end" arg Alex Elder
2012-05-13  0:11   ` Sage Weil
2012-05-14 16:26     ` Alex Elder
2012-05-14 16:28     ` Alex Elder [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4FB132C3.8090306@inktank.com \
    --to=elder@inktank.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=sage@inktank.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.