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

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

 



On Fri, Aug 26, 2011 at 12:52 PM, Christian Brunner <chb@xxxxxx> wrote:
> 2011/8/26 Yehuda Sadeh Weinraub <yehudasa@xxxxxxxxx>:
>> On Fri, Aug 26, 2011 at 11:51 AM, Christian Brunner <chb@xxxxxx> 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, you can use buf directly.
>>
>>> +  byte *tempbuf = NULL;
>>> +
>>> +  if (!buf) {
>>> +    len = ofs-lastofs;
>>
>> Why setting len here? len was already passed in.
>
> Ah - then I didn't understand what read_iterate is doing. I was
> thinking, that the callback is not called for missing objects.
>
>>
>>> +    tempbuf = (byte *) malloc(len);
>
> Do we need a memset here?
>
You can memset, or calloc instead.

Yehuda
--
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