memcpy() avoidance using decode(bufferlist)

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

 



Hi,

A question regarding bufferlist usage:

I'm working on the cmpext librados C API, and want to decode the OSD
response directly into a (char *buf/size_t len) buffer provided by the
caller.

I figured this would be straightforward via:
  bl.push_back(buffer::create_static(buf, len));
  ...
  ::decode_nohead(iter.get_remaining(), bl, iter);

However, the decoded data doesn't make it into buf, unless an extra copy
occurs via:
  bl.copy(0, bl.length(), buf);

Any suggestions on a clean way to avoid the extra copy here?

Cheers, David
--
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