ReplicatedPG,PG: adapt collection_list* users to PGBackend interface

Signed-off-by: Samuel Just <sam.just@inktank.com>
This commit is contained in:
Samuel Just 2013-09-17 10:12:11 -07:00
parent ff17e45fe2
commit 8a919fb41d
2 changed files with 20 additions and 20 deletions

View File

@ -1996,8 +1996,7 @@ void PG::upgrade(ObjectStore *store, const interval_set<snapid_t> &snapcolls)
hobject_t cur;
vector<hobject_t> objects;
while (1) {
int r = store->collection_list_partial(
cid,
int r = get_pgbackend()->objects_list_partial(
cur,
store->get_ideal_list_min(),
store->get_ideal_list_max(),
@ -2045,8 +2044,7 @@ void PG::upgrade(ObjectStore *store, const interval_set<snapid_t> &snapcolls)
while (1) {
dout(1) << "Updating snap_mapper from main collection, "
<< done << " objects done" << dendl;
int r = store->collection_list_partial(
cid,
int r = get_pgbackend()->objects_list_partial(
cur,
store->get_ideal_list_min(),
store->get_ideal_list_max(),
@ -3038,9 +3036,9 @@ int PG::build_scrub_map_chunk(
// objects
vector<hobject_t> ls;
int ret = osd->store->collection_list_range(coll, start, end, 0, &ls);
int ret = get_pgbackend()->objects_list_range(start, end, 0, &ls);
if (ret < 0) {
dout(5) << "collection_list_range error: " << ret << dendl;
dout(5) << "objects_list_range error: " << ret << dendl;
return ret;
}
@ -3560,11 +3558,13 @@ void PG::chunky_scrub(ThreadPool::TPHandle &handle)
hobject_t start = scrubber.start;
while (!boundary_found) {
vector<hobject_t> objects;
ret = osd->store->collection_list_partial(coll, start,
cct->_conf->osd_scrub_chunk_min,
cct->_conf->osd_scrub_chunk_max,
0,
&objects, &scrubber.end);
ret = get_pgbackend()->objects_list_partial(
start,
cct->_conf->osd_scrub_chunk_min,
cct->_conf->osd_scrub_chunk_max,
0,
&objects,
&scrubber.end);
assert(ret >= 0);
// in case we don't find a boundary: start again at the end

View File

@ -639,12 +639,13 @@ void ReplicatedPG::do_pg_op(OpRequestRef op)
hobject_t next;
hobject_t current = response.handle;
osr->flush();
int r = osd->store->collection_list_partial(coll, current,
list_size,
list_size,
snapid,
&sentries,
&next);
int r = pgbackend->objects_list_partial(
current,
list_size,
list_size,
snapid,
&sentries,
&next);
if (r != 0) {
result = -EINVAL;
break;
@ -8209,8 +8210,7 @@ void ReplicatedPG::scan_range(
vector<hobject_t> ls;
ls.reserve(max);
int r = osd->store->collection_list_partial(coll, bi->begin, min, max,
0, &ls, &bi->end);
int r = pgbackend->objects_list_partial(bi->begin, min, max, 0, &ls, &bi->end);
assert(r >= 0);
dout(10) << " got " << ls.size() << " items, next " << bi->end << dendl;
dout(20) << ls << dendl;
@ -8225,7 +8225,7 @@ void ReplicatedPG::scan_range(
dout(20) << " " << *p << " " << obc->obs.oi.version << dendl;
} else {
bufferlist bl;
int r = osd->store->getattr(coll, *p, OI_ATTR, bl);
int r = pgbackend->objects_get_attr(*p, OI_ATTR, &bl);
assert(r >= 0);
object_info_t oi(bl);
bi->objects[*p] = oi.version;