All of lore.kernel.org
 help / color / mirror / Atom feed
* using librbd in my application
@ 2011-05-20 17:22 Simon Tian
  2011-05-24  1:58 ` Simon Tian
  2011-05-24 23:44 ` Josh Durgin
  0 siblings, 2 replies; 4+ messages in thread
From: Simon Tian @ 2011-05-20 17:22 UTC (permalink / raw)
  To: ceph-devel

Hi Sage,

      I have two question about using librbd:
 1. There always two clients, Client A and B are both developed with
librbd, and running on different hosts.
Scenario (1): Client A open an image for read and write, Client B open
the same image for read.
Scenario (2): Client A and client B both open the same image for read and write.

For scenario (1), I did some test today, glad to tell that two client
are both working safely.
I didn't do a test for scenario (2).  I am not very familiar with the
librbd code yet.
I want to know, would clients in scenario (2) working safely? Will
data writing at the same object be serialized?
And reading delayed? Seem that the phd thesis mentioned that multi
client write will be serialized by rados.
Hope I got the right understanding.

2.  I need to use the callback of aio_write and aio_read in my client:
  typedef void (*callback_t)(completion_t cb, void *arg);
  At here, what is the completion_t cb mean? how to utilize it?
  I need to use the return value in the callback function other than
call get_return_value() after wait_for_complete(). How can I get the
value?
I guess maybe I can do this in the callback function:
callback_t my_cb(completion_t cb, void *arg)
{
  librbd::RBD::AioCompletion *comp = (librbd::RBD::AioCompletion *)c;
  int ret = comp->get_return_value();

}
Hmm, Is it right?


Thanks!
Simon

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-05-24 23:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-20 17:22 using librbd in my application Simon Tian
2011-05-24  1:58 ` Simon Tian
2011-05-24 23:44   ` Josh Durgin
2011-05-24 23:44 ` Josh Durgin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.