Re: [PATCH 2/2] rbd: add an option for md5 checksumming (v2)

2011-08-26 Thread Christian Brunner
2011/8/25 Yehuda Sadeh Weinraub yehuda.sa...@dreamhost.com: +  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); +    } + +    

Re: [PATCH 2/2] rbd: add an option for md5 checksumming (v3)

2011-08-26 Thread Tommi Virtanen
On Fri, Aug 26, 2011 at 11:51, Christian Brunner c...@muc.de 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

Re: [PATCH 2/2] rbd: add an option for md5 checksumming (v3)

2011-08-26 Thread Yehuda Sadeh Weinraub
On Fri, Aug 26, 2011 at 11:51 AM, Christian Brunner c...@muc.de 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

Re: [PATCH 2/2] rbd: add an option for md5 checksumming (v3)

2011-08-26 Thread Yehuda Sadeh Weinraub
On Fri, Aug 26, 2011 at 12:10 PM, Tommi Virtanen tommi.virta...@dreamhost.com wrote: On Fri, Aug 26, 2011 at 11:51, Christian Brunner c...@muc.de wrote: +  if (!buf) { +    len = ofs-lastofs; +    tempbuf = (byte *) malloc(len); +    if (!tempbuf) +      return -ENOMEM; +    hashbuf =

Re: [PATCH 2/2] rbd: add an option for md5 checksumming (v3)

2011-08-26 Thread Christian Brunner
2011/8/26 Yehuda Sadeh Weinraub yehud...@gmail.com: On Fri, Aug 26, 2011 at 11:51 AM, Christian Brunner c...@muc.de 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

Re: [PATCH 2/2] rbd: add an option for md5 checksumming (v3)

2011-08-26 Thread Yehuda Sadeh Weinraub
On Fri, Aug 26, 2011 at 12:52 PM, Christian Brunner c...@muc.de wrote: 2011/8/26 Yehuda Sadeh Weinraub yehud...@gmail.com: On Fri, Aug 26, 2011 at 11:51 AM, Christian Brunner c...@muc.de wrote: +static int hash_read_cb(uint64_t ofs, size_t len, const char *buf, void *arg) +{ +  

Re: [PATCH 2/2] rbd: add an option for md5 checksumming (v3)

2011-08-26 Thread Tommi Virtanen
On Fri, Aug 26, 2011 at 12:25, Yehuda Sadeh Weinraub yehud...@gmail.com wrote: On Fri, Aug 26, 2011 at 12:10 PM, Tommi Virtanen tommi.virta...@dreamhost.com 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,

Re: [PATCH 2/2] rbd: add an option for md5 checksumming (v3)

2011-08-26 Thread Christian Brunner
2011/8/26 Tommi Virtanen tommi.virta...@dreamhost.com: On Fri, Aug 26, 2011 at 12:25, Yehuda Sadeh Weinraub yehud...@gmail.com wrote: On Fri, Aug 26, 2011 at 12:10 PM, Tommi Virtanen tommi.virta...@dreamhost.com wrote: e.g. 8kB at a time. And at that point you might as well just use read

Re: [PATCH 2/2] rbd: add an option for md5 checksumming (v3)

2011-08-26 Thread Yehuda Sadeh Weinraub
On Fri, Aug 26, 2011 at 1:03 PM, Tommi Virtanen tommi.virta...@dreamhost.com wrote: On Fri, Aug 26, 2011 at 12:25, Yehuda Sadeh Weinraub yehud...@gmail.com wrote: On Fri, Aug 26, 2011 at 12:10 PM, Tommi Virtanen tommi.virta...@dreamhost.com wrote: e.g. 8kB at a time. And at that point you

[PATCH 2/2] rbd: add an option for md5 checksumming (v4)

2011-08-26 Thread Christian Brunner
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

suscribe

2011-08-26 Thread XMundo Networks - Soporte Tecnico
-- 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