Re: [PATCH 3/3] ceph: messenger: change read_partial() to take "end" arg

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx>
---

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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




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


[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux