read/write on RADOS using external buffer

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

 



Hi,

I want to use external buffer in Rados::write() and Rados::read() in
my application, I figure out the way on write() but I couldn't on
read().

I have "char *buf" as buffer, and it's length "int len".
On write(), I could do it like this:
  rados.initialize(0, NULL);
  rados.open_pool(bucket, &pool);
  bl.push_front(ceph::buffer::create_static(len, buf));
  rados.write_full(pool, oid, bl);

But on read(), I tried slimier code but fails:
  r = rados.initialize(0, NULL);
  r = rados.open_pool(bucket, &pool);
  bl.push_front(ceph::buffer::create_static(len, buf));
  rados.read(pool, oid, 0, bl, 0);

It seems new buffer allocated inside of read() operation, and the data
wrote on new buffer instead of "buf".
Where that new buffer allocated?
And is there a way to use external buffer instead of new buffer?
--
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