Re: blueprint: consistency groups

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

 



You can use the explicit constructor of librados::Rados to convert
from a librados::IoCtx [1].  Once you have the Rados object, use
librados::Rados::ioctx_create2 to create a new librados::IoCtx [2].
Here is the example from the snap unprotect state machine [3].

[1] https://github.com/ceph/ceph/blob/master/src/include/rados/librados.hpp#L1145
[2] https://github.com/ceph/ceph/blob/master/src/include/rados/librados.hpp#L1187
[3] https://github.com/ceph/ceph/blob/master/src/librbd/operation/SnapshotUnprotectRequest.cc#L73

On Tue, May 3, 2016 at 5:48 PM, Victor Denisov <vdenisov@xxxxxxxxxxxx> wrote:
> Jason,
>
> Can you point me to a specific line of code where you reuse Rados?
> I see that IoCtx only has reference to RadosClient not to Rados itself.
>
> On Tue, May 3, 2016 at 5:05 AM, Jason Dillaman <jdillama@xxxxxxxxxx> wrote:
>> On Mon, May 2, 2016 at 8:26 PM, Victor Denisov <vdenisov@xxxxxxxxxxxx> wrote:
>>> As such, I can't open another ioctx when I'm already inside rbd
>>> class.
>>
>> You actually can open a new IoCtx against a new pool -- we do this
>> internally for journaling handling, scanning pools for children during
>> the snapshot unprotect operation, opening a parent image of a clone,
>> etc.   You can extract the "librados::Rados" object from the
>> "librados::IoCtx" and then use "librados::Rados::ioctx_create2" to
>> create a new IoCtx by pool id.
>>
>> Also agree with Mykola in that the API should return resolved image names.
>>
>> --
>> Jason



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