mirror of
https://github.com/ceph/ceph
synced 2025-03-31 07:53:23 +00:00
Merge pull request #2209 from somnathr/wip-sd-check-pool-existence
RadosClient: Adding pool existence checks for pool create interfaces. Reviewed-by: Sage Weil <sage@redhat.com>
This commit is contained in:
commit
448edb191c
@ -546,13 +546,19 @@ bool librados::RadosClient::put() {
|
||||
int librados::RadosClient::pool_create(string& name, unsigned long long auid,
|
||||
__u8 crush_rule)
|
||||
{
|
||||
int reply;
|
||||
lock.Lock();
|
||||
|
||||
int r = wait_for_osdmap();
|
||||
if (r < 0) {
|
||||
lock.Unlock();
|
||||
return r;
|
||||
}
|
||||
|
||||
Mutex mylock ("RadosClient::pool_create::mylock");
|
||||
int reply;
|
||||
Cond cond;
|
||||
bool done;
|
||||
Context *onfinish = new C_SafeCond(&mylock, &cond, &done, &reply);
|
||||
lock.Lock();
|
||||
reply = objecter->create_pool(name, onfinish, auid, crush_rule);
|
||||
lock.Unlock();
|
||||
|
||||
@ -572,8 +578,13 @@ int librados::RadosClient::pool_create_async(string& name, PoolAsyncCompletionIm
|
||||
__u8 crush_rule)
|
||||
{
|
||||
Mutex::Locker l(lock);
|
||||
|
||||
int r = wait_for_osdmap();
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
Context *onfinish = new C_PoolAsync_Safe(c);
|
||||
int r = objecter->create_pool(name, onfinish, auid, crush_rule);
|
||||
r = objecter->create_pool(name, onfinish, auid, crush_rule);
|
||||
if (r < 0) {
|
||||
delete onfinish;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user