On Fri, Aug 26, 2011 at 1:03 PM, Tommi Virtanen <tommi.virtanen@xxxxxxxxxxxxx> wrote: > On Fri, Aug 26, 2011 at 12:25, Yehuda Sadeh Weinraub <yehudasa@xxxxxxxxx> wrote: >> On Fri, Aug 26, 2011 at 12:10 PM, Tommi Virtanen >> <tommi.virtanen@xxxxxxxxxxxxx> wrote: >>> e.g. 8kB at a time. And at that point you might as well just use read >>> and not read_iterate, that'll do the memsetting etc for you, and then >>> you can use a static buffer and avoid malloc/free every round. There's >>> no shortcut to be had from "skipping" holes when you need to feed >>> bytes to a hash function. >> >> Well, when using read_iterate you avoid reading extra data over the >> network when the object (chunk) exists (and is sparse). We can >> probably have some optimization here, and only allocate and memset a >> buffer once for the case where len == objsize and reuse it later. > > Reading src/librbd.cc, I don't see the holes going over the wire in > either case. read() is just a simple wrapper on top of read_iterate(), > that memsets to 0 in case of a hole. Which in this case he was doing > manually, so why not just use read() in the first place. > Yeah, you're right.. the librbd::read() already does everything. -- 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