mirror of
https://github.com/ceph/ceph
synced 2025-04-11 04:02:04 +00:00
objecter: librados: add optional auid param to
create_pool functions
This commit is contained in:
parent
14cdfd4337
commit
9199dd2d9e
@ -129,7 +129,7 @@ public:
|
|||||||
int get_pool_stats(std::vector<string>& ls, map<string,rados_pool_stat_t>& result);
|
int get_pool_stats(std::vector<string>& ls, map<string,rados_pool_stat_t>& result);
|
||||||
int get_fs_stats( rados_statfs_t& result );
|
int get_fs_stats( rados_statfs_t& result );
|
||||||
|
|
||||||
int create_pool(string& name);
|
int create_pool(string& name, __u64 auid=0);
|
||||||
int delete_pool(const rados_pool_t& pool);
|
int delete_pool(const rados_pool_t& pool);
|
||||||
|
|
||||||
int list(PoolCtx& pool, int max_entries, std::list<object_t>& entries,
|
int list(PoolCtx& pool, int max_entries, std::list<object_t>& entries,
|
||||||
@ -532,7 +532,7 @@ int RadosClient::snap_remove( const rados_pool_t pool, const char *snapName)
|
|||||||
return reply;
|
return reply;
|
||||||
}
|
}
|
||||||
|
|
||||||
int RadosClient::create_pool(string& name)
|
int RadosClient::create_pool(string& name, __u64 auid)
|
||||||
{
|
{
|
||||||
int reply;
|
int reply;
|
||||||
|
|
||||||
@ -541,7 +541,7 @@ int RadosClient::create_pool(string& name)
|
|||||||
bool done;
|
bool done;
|
||||||
lock.Lock();
|
lock.Lock();
|
||||||
objecter->create_pool(name,
|
objecter->create_pool(name,
|
||||||
new C_SafeCond(&mylock, &cond, &done, &reply));
|
new C_SafeCond(&mylock, &cond, &done, &reply), auid);
|
||||||
lock.Unlock();
|
lock.Unlock();
|
||||||
|
|
||||||
mylock.Lock();
|
mylock.Lock();
|
||||||
@ -1082,12 +1082,12 @@ int Rados::get_pool_stats(std::vector<string>& v, std::map<string,rados_pool_sta
|
|||||||
return client->get_pool_stats(v, result);
|
return client->get_pool_stats(v, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Rados::create_pool(const char *name)
|
int Rados::create_pool(const char *name, __u64 auid)
|
||||||
{
|
{
|
||||||
string str(name);
|
string str(name);
|
||||||
if (!client)
|
if (!client)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
return client->create_pool(str);
|
return client->create_pool(str, auid);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Rados::delete_pool(const rados_pool_t& pool)
|
int Rados::delete_pool(const rados_pool_t& pool)
|
||||||
@ -1450,6 +1450,12 @@ extern "C" int rados_create_pool(const char *name)
|
|||||||
return radosp->create_pool(sname);
|
return radosp->create_pool(sname);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern "C" int rados_create_pool_with_auid(const char *name, __u64 auid)
|
||||||
|
{
|
||||||
|
string sname(name);
|
||||||
|
return radosp->create_pool(sname, auid);
|
||||||
|
}
|
||||||
|
|
||||||
extern "C" int rados_delete_pool(const rados_pool_t pool)
|
extern "C" int rados_delete_pool(const rados_pool_t pool)
|
||||||
{
|
{
|
||||||
return radosp->delete_pool(pool);
|
return radosp->delete_pool(pool);
|
||||||
|
@ -679,7 +679,7 @@ int Objecter::delete_pool_snap(int pool, string& snapName, Context *onfinish) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Objecter::create_pool(string& name, Context *onfinish) {
|
int Objecter::create_pool(string& name, Context *onfinish, __u64 auid) {
|
||||||
dout(10) << "create_pool name=" << name << dendl;
|
dout(10) << "create_pool name=" << name << dendl;
|
||||||
PoolOp *op = new PoolOp;
|
PoolOp *op = new PoolOp;
|
||||||
if (!op)
|
if (!op)
|
||||||
@ -690,6 +690,7 @@ int Objecter::create_pool(string& name, Context *onfinish) {
|
|||||||
op->onfinish = onfinish;
|
op->onfinish = onfinish;
|
||||||
op->pool_op = POOL_OP_CREATE;
|
op->pool_op = POOL_OP_CREATE;
|
||||||
op_pool[op->tid] = op;
|
op_pool[op->tid] = op;
|
||||||
|
if (auid) op->auid = auid;
|
||||||
|
|
||||||
pool_op_submit(op);
|
pool_op_submit(op);
|
||||||
|
|
||||||
|
@ -673,7 +673,7 @@ public:
|
|||||||
int create_pool_snap(int pool, string& snapName, Context *onfinish);
|
int create_pool_snap(int pool, string& snapName, Context *onfinish);
|
||||||
int delete_pool_snap(int pool, string& snapName, Context *onfinish);
|
int delete_pool_snap(int pool, string& snapName, Context *onfinish);
|
||||||
|
|
||||||
int create_pool(string& name, Context *onfinish);
|
int create_pool(string& name, Context *onfinish, __u64 auid=0);
|
||||||
int delete_pool(int pool, Context *onfinish);
|
int delete_pool(int pool, Context *onfinish);
|
||||||
|
|
||||||
void handle_pool_op_reply(MPoolOpReply *m);
|
void handle_pool_op_reply(MPoolOpReply *m);
|
||||||
|
@ -53,6 +53,7 @@ void rados_pool_close_ctx(rados_list_ctx_t *ctx);
|
|||||||
int rados_pool_list_next(rados_pool_t pool, const char **entry, rados_list_ctx_t *ctx);
|
int rados_pool_list_next(rados_pool_t pool, const char **entry, rados_list_ctx_t *ctx);
|
||||||
|
|
||||||
int rados_create_pool(const char *name);
|
int rados_create_pool(const char *name);
|
||||||
|
int rados_create_pool_with_auid(const char *name, __u64 auid);
|
||||||
int rados_delete_pool(const rados_pool_t pool);
|
int rados_delete_pool(const rados_pool_t pool);
|
||||||
|
|
||||||
/* snapshots */
|
/* snapshots */
|
||||||
@ -132,7 +133,7 @@ public:
|
|||||||
std::map<std::string,rados_pool_stat_t>& stats);
|
std::map<std::string,rados_pool_stat_t>& stats);
|
||||||
int get_fs_stats(rados_statfs_t& result);
|
int get_fs_stats(rados_statfs_t& result);
|
||||||
|
|
||||||
int create_pool(const char *name);
|
int create_pool(const char *name, __u64 auid=0);
|
||||||
int delete_pool(const rados_pool_t& pool);
|
int delete_pool(const rados_pool_t& pool);
|
||||||
|
|
||||||
int snap_create(const rados_pool_t pool, const char *snapname);
|
int snap_create(const rados_pool_t pool, const char *snapname);
|
||||||
|
Loading…
Reference in New Issue
Block a user