2011/8/25 Yehuda Sadeh Weinraub :
> + if (buf) {
> + dif = ofs-lastofs;
> + if (dif > 0) {
> + byte *tempbuf = (byte *) malloc(dif);
> + memset(tempbuf, 0, dif);
> + Hash->Update((const byte *) tempbuf, dif);
> + free(tempbuf);
> + }
>>>
We needed to get an md5 checksum of an rbd image. Since librbd is using a
lot of sparse operations, this was not possible without writing an image
to a local disk.
With this patch exporting the image is no longer needed. You can do
"rbd md5 image" and you will get the same output as you would call
On Fri, Aug 26, 2011 at 11:51, Christian Brunner wrote:
> + if (!buf) {
> + len = ofs-lastofs;
> + tempbuf = (byte *) malloc(len);
> + if (!tempbuf)
> + return -ENOMEM;
> + hashbuf = tempbuf;
> + }
> + Hash->Update((const byte *) hashbuf, len);
That'll still try to allocate 10
On Fri, Aug 26, 2011 at 11:51 AM, Christian Brunner wrote:
> +static int hash_read_cb(uint64_t ofs, size_t len, const char *buf, void *arg)
> +{
> + ceph::crypto::Digest *Hash = (ceph::crypto::Digest *)arg;
> + byte *hashbuf = (byte *) buf;
Looking at it again, hashbuf is pretty much useless, y
On Fri, Aug 26, 2011 at 12:10 PM, Tommi Virtanen
wrote:
> On Fri, Aug 26, 2011 at 11:51, Christian Brunner wrote:
>> + if (!buf) {
>> + len = ofs-lastofs;
>> + tempbuf = (byte *) malloc(len);
>> + if (!tempbuf)
>> + return -ENOMEM;
>> + hashbuf = tempbuf;
>> + }
>> + Hash->Upd
2011/8/26 Yehuda Sadeh Weinraub :
> On Fri, Aug 26, 2011 at 11:51 AM, Christian Brunner wrote:
>> +static int hash_read_cb(uint64_t ofs, size_t len, const char *buf, void
>> *arg)
>> +{
>> + ceph::crypto::Digest *Hash = (ceph::crypto::Digest *)arg;
>> + byte *hashbuf = (byte *) buf;
>
> Looking
On Fri, Aug 26, 2011 at 12:52 PM, Christian Brunner wrote:
> 2011/8/26 Yehuda Sadeh Weinraub :
>> On Fri, Aug 26, 2011 at 11:51 AM, Christian Brunner wrote:
>>> +static int hash_read_cb(uint64_t ofs, size_t len, const char *buf, void
>>> *arg)
>>> +{
>>> + ceph::crypto::Digest *Hash = (ceph::cr
On Fri, Aug 26, 2011 at 12:25, Yehuda Sadeh Weinraub wrote:
> On Fri, Aug 26, 2011 at 12:10 PM, Tommi Virtanen
> 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
2011/8/26 Tommi Virtanen :
> On Fri, Aug 26, 2011 at 12:25, Yehuda Sadeh Weinraub
> wrote:
>> On Fri, Aug 26, 2011 at 12:10 PM, Tommi Virtanen
>> 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
On Fri, Aug 26, 2011 at 1:03 PM, Tommi Virtanen
wrote:
> On Fri, Aug 26, 2011 at 12:25, Yehuda Sadeh Weinraub
> wrote:
>> On Fri, Aug 26, 2011 at 12:10 PM, Tommi Virtanen
>> 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
We needed to get an md5 checksum of an rbd image. Since librbd is using a
lot of sparse operations, this was not possible without writing an image
to a local disk.
With this patch exporting the image is no longer needed. You can do
"rbd md5 image" and you will get the same output as you would call
I applied the patches to the client's existing kernel version, here
are the results with respect to the pre-patch:
seq char write 100.60%
seq blk write 97.18%
seq blk rewrite 120.07%
seq char read 161.52%
seq blk read162.30%
seeks 141.93%
seq create 76.02%
seq read186.78%
s
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
13 matches
Mail list logo