Skip to content

Commit

Permalink
Merge pull request #16154 from mikulely/obj-placement-pool
Browse files Browse the repository at this point in the history
rgw: drop unused rgw_pool parameter, local variables and member variable

Reviewed-by: Jos Collin <jcollin@redhat.com>
  • Loading branch information
yuriw committed Jul 12, 2017
2 parents bcd4374 + 4e04bf3 commit dba56d6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 44 deletions.
60 changes: 20 additions & 40 deletions src/rgw/rgw_rados.cc
Expand Up @@ -6178,7 +6178,7 @@ int RGWRados::get_obj_head_ref(const RGWBucketInfo& bucket_info, const rgw_obj&
return 0;
}

int RGWRados::get_raw_obj_ref(const rgw_raw_obj& obj, rgw_rados_ref *ref, rgw_pool *pool)
int RGWRados::get_raw_obj_ref(const rgw_raw_obj& obj, rgw_rados_ref *ref)
{
ref->oid = obj.oid;
ref->key = obj.loc;
Expand All @@ -6191,9 +6191,6 @@ int RGWRados::get_raw_obj_ref(const rgw_raw_obj& obj, rgw_rados_ref *ref, rgw_po
} else {
ref->pool = obj.pool;
}
if (pool) {
*pool = ref->pool;
}
r = open_pool_ctx(ref->pool, ref->ioctx);
if (r < 0)
return r;
Expand All @@ -6203,9 +6200,9 @@ int RGWRados::get_raw_obj_ref(const rgw_raw_obj& obj, rgw_rados_ref *ref, rgw_po
return 0;
}

int RGWRados::get_system_obj_ref(const rgw_raw_obj& obj, rgw_rados_ref *ref, rgw_pool *pool)
int RGWRados::get_system_obj_ref(const rgw_raw_obj& obj, rgw_rados_ref *ref)
{
return get_raw_obj_ref(obj, ref, pool);
return get_raw_obj_ref(obj, ref);
}

/*
Expand Down Expand Up @@ -6741,8 +6738,6 @@ int RGWRados::Object::Write::_do_write_meta(uint64_t size, uint64_t accounted_si
void *_index_op)
{
RGWRados::Bucket::UpdateIndex *index_op = static_cast<RGWRados::Bucket::UpdateIndex *>(_index_op);
rgw_pool pool;
rgw_rados_ref ref;
RGWRados *store = target->get_store();

ObjectWriteOperation op;
Expand All @@ -6759,6 +6754,7 @@ int RGWRados::Object::Write::_do_write_meta(uint64_t size, uint64_t accounted_si
return -EIO;
}

rgw_rados_ref ref;
r = store->get_obj_head_ref(target->get_bucket_info(), obj, &ref);
if (r < 0)
return r;
Expand Down Expand Up @@ -6998,9 +6994,8 @@ int RGWRados::put_system_obj_impl(rgw_raw_obj& obj, uint64_t size, real_time *mt
RGWObjVersionTracker *objv_tracker,
real_time set_mtime /* 0 for don't set */)
{
rgw_pool pool;
rgw_rados_ref ref;
int r = get_system_obj_ref(obj, &ref, &pool);
int r = get_system_obj_ref(obj, &ref);
if (r < 0)
return r;

Expand Down Expand Up @@ -7061,8 +7056,7 @@ int RGWRados::put_system_obj_data(void *ctx, rgw_raw_obj& obj, bufferlist& bl,
RGWObjVersionTracker *objv_tracker)
{
rgw_rados_ref ref;
rgw_pool pool;
int r = get_system_obj_ref(obj, &ref, &pool);
int r = get_system_obj_ref(obj, &ref);
if (r < 0) {
return r;
}
Expand Down Expand Up @@ -8856,8 +8850,7 @@ int RGWRados::delete_obj(RGWObjectCtx& obj_ctx,
int RGWRados::delete_raw_obj(const rgw_raw_obj& obj)
{
rgw_rados_ref ref;
rgw_pool pool;
int r = get_raw_obj_ref(obj, &ref, &pool);
int r = get_raw_obj_ref(obj, &ref);
if (r < 0) {
return r;
}
Expand All @@ -8880,8 +8873,7 @@ int RGWRados::delete_system_obj(rgw_raw_obj& obj, RGWObjVersionTracker *objv_tra
return -EINVAL;
}
rgw_rados_ref ref;
rgw_pool pool;
int r = get_raw_obj_ref(obj, &ref, &pool);
int r = get_raw_obj_ref(obj, &ref);
if (r < 0) {
return r;
}
Expand Down Expand Up @@ -9322,8 +9314,7 @@ int RGWRados::Object::Stat::finish()
int RGWRados::system_obj_get_attr(rgw_raw_obj& obj, const char *name, bufferlist& dest)
{
rgw_rados_ref ref;
rgw_pool pool;
int r = get_system_obj_ref(obj, &ref, &pool);
int r = get_system_obj_ref(obj, &ref);
if (r < 0) {
return r;
}
Expand Down Expand Up @@ -9484,8 +9475,7 @@ int RGWRados::system_obj_set_attrs(void *ctx, rgw_raw_obj& obj,
RGWObjVersionTracker *objv_tracker)
{
rgw_rados_ref ref;
rgw_pool pool;
int r = get_system_obj_ref(obj, &ref, &pool);
int r = get_system_obj_ref(obj, &ref);
if (r < 0) {
return r;
}
Expand Down Expand Up @@ -10094,8 +10084,7 @@ int RGWRados::Object::Read::read(int64_t ofs, int64_t end, bufferlist& bl)
int RGWRados::SystemObject::Read::GetObjState::get_ref(RGWRados *store, rgw_raw_obj& obj, rgw_rados_ref **pref)
{
if (!has_ref) {
rgw_pool pool;
int r = store->get_raw_obj_ref(obj, &ref, &pool);
int r = store->get_raw_obj_ref(obj, &ref);
if (r < 0) {
return r;
}
Expand Down Expand Up @@ -12681,8 +12670,7 @@ int RGWRados::cls_obj_usage_log_add(const string& oid, rgw_usage_log_info& info)
rgw_raw_obj obj(get_zone_params().usage_log_pool, oid);

rgw_rados_ref ref;
rgw_pool pool;
int r = get_raw_obj_ref(obj, &ref, &pool);
int r = get_raw_obj_ref(obj, &ref);
if (r < 0) {
return r;
}
Expand All @@ -12700,8 +12688,7 @@ int RGWRados::cls_obj_usage_log_read(string& oid, string& user, uint64_t start_e
rgw_raw_obj obj(get_zone_params().usage_log_pool, oid);

rgw_rados_ref ref;
rgw_pool pool;
int r = get_raw_obj_ref(obj, &ref, &pool);
int r = get_raw_obj_ref(obj, &ref);
if (r < 0) {
return r;
}
Expand All @@ -12719,8 +12706,7 @@ int RGWRados::cls_obj_usage_log_trim(string& oid, string& user, uint64_t start_e
rgw_raw_obj obj(get_zone_params().usage_log_pool, oid);

rgw_rados_ref ref;
rgw_pool pool;
int r = get_raw_obj_ref(obj, &ref, &pool);
int r = get_raw_obj_ref(obj, &ref);
if (r < 0) {
return r;
}
Expand Down Expand Up @@ -12919,8 +12905,7 @@ int RGWRados::cls_user_get_header(const string& user_id, cls_user_header *header
rgw_raw_obj obj(get_zone_params().user_uid_pool, buckets_obj_id);

rgw_rados_ref ref;
rgw_pool pool;
int r = get_raw_obj_ref(obj, &ref, &pool);
int r = get_raw_obj_ref(obj, &ref);
if (r < 0) {
return r;
}
Expand All @@ -12945,8 +12930,7 @@ int RGWRados::cls_user_get_header_async(const string& user_id, RGWGetUserHeader_
rgw_raw_obj obj(get_zone_params().user_uid_pool, buckets_obj_id);

rgw_rados_ref ref;
rgw_pool pool;
int r = get_raw_obj_ref(obj, &ref, &pool);
int r = get_raw_obj_ref(obj, &ref);
if (r < 0) {
return r;
}
Expand Down Expand Up @@ -13003,8 +12987,7 @@ int RGWRados::cls_user_list_buckets(rgw_raw_obj& obj,
bool * const truncated)
{
rgw_rados_ref ref;
rgw_pool pool;
int r = get_raw_obj_ref(obj, &ref, &pool);
int r = get_raw_obj_ref(obj, &ref);
if (r < 0) {
return r;
}
Expand All @@ -13026,8 +13009,7 @@ int RGWRados::cls_user_list_buckets(rgw_raw_obj& obj,
int RGWRados::cls_user_update_buckets(rgw_raw_obj& obj, list<cls_user_bucket_entry>& entries, bool add)
{
rgw_rados_ref ref;
rgw_pool pool;
int r = get_raw_obj_ref(obj, &ref, &pool);
int r = get_raw_obj_ref(obj, &ref);
if (r < 0) {
return r;
}
Expand All @@ -13052,8 +13034,7 @@ int RGWRados::complete_sync_user_stats(const rgw_user& user_id)
int RGWRados::cls_user_complete_stats_sync(rgw_raw_obj& obj)
{
rgw_rados_ref ref;
rgw_pool pool;
int r = get_raw_obj_ref(obj, &ref, &pool);
int r = get_raw_obj_ref(obj, &ref);
if (r < 0) {
return r;
}
Expand All @@ -13077,9 +13058,8 @@ int RGWRados::cls_user_add_bucket(rgw_raw_obj& obj, const cls_user_bucket_entry&

int RGWRados::cls_user_remove_bucket(rgw_raw_obj& obj, const cls_user_bucket& bucket)
{
rgw_pool p;
rgw_rados_ref ref;
int r = get_system_obj_ref(obj, &ref, &p);
int r = get_system_obj_ref(obj, &ref);
if (r < 0) {
return r;
}
Expand Down
6 changes: 2 additions & 4 deletions src/rgw/rgw_rados.h
Expand Up @@ -799,8 +799,6 @@ class RGWObjManifest {
string oid_prefix;

rgw_obj_select cur_obj;
rgw_pool pool;


RGWObjManifestRule rule;

Expand Down Expand Up @@ -2294,7 +2292,7 @@ class RGWRados

int get_obj_head_ioctx(const RGWBucketInfo& bucket_info, const rgw_obj& obj, librados::IoCtx *ioctx);
int get_obj_head_ref(const RGWBucketInfo& bucket_info, const rgw_obj& obj, rgw_rados_ref *ref);
int get_system_obj_ref(const rgw_raw_obj& obj, rgw_rados_ref *ref, rgw_pool *pool = NULL);
int get_system_obj_ref(const rgw_raw_obj& obj, rgw_rados_ref *ref);
uint64_t max_bucket_id;

int get_olh_target_state(RGWObjectCtx& rctx, const RGWBucketInfo& bucket_info, const rgw_obj& obj,
Expand Down Expand Up @@ -2527,7 +2525,7 @@ class RGWRados
return rgw_shards_max();
}

int get_raw_obj_ref(const rgw_raw_obj& obj, rgw_rados_ref *ref, rgw_pool *pool = NULL);
int get_raw_obj_ref(const rgw_raw_obj& obj, rgw_rados_ref *ref);

int list_raw_objects(const rgw_pool& pool, const string& prefix_filter, int max,
RGWListRawObjsCtx& ctx, list<string>& oids,
Expand Down

0 comments on commit dba56d6

Please sign in to comment.