diff options
author | Sage Weil <sage@inktank.com> | 2013-10-10 11:51:16 -0700 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-10-10 11:51:38 -0700 |
commit | 562d7816ef3bab4bdd4a823184c8f5477b94b4d7 (patch) | |
tree | bef55f3d8625898acba3fa26308dc5b3b0dc6d29 /src/osdc/Objecter.cc | |
parent | 67f80754bda81017c8d5828c88a81a55945bbe5b (diff) | |
download | ceph-wip-rados-list.tar.gz |
librados: seek during object iterationwip-rados-list
Add ability to reset iterator to a specific hash position. For now, we
just truncate this to the current PG. In the future, this may be more
precise.
Signed-off-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'src/osdc/Objecter.cc')
-rw-r--r-- | src/osdc/Objecter.cc | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/osdc/Objecter.cc b/src/osdc/Objecter.cc index f767641a0f7..89f99f1a927 100644 --- a/src/osdc/Objecter.cc +++ b/src/osdc/Objecter.cc @@ -1714,8 +1714,24 @@ void Objecter::handle_osd_op_reply(MOSDOpReply *m) } -void Objecter::list_objects(ListContext *list_context, Context *onfinish) { +uint32_t Objecter::list_objects_seek(ListContext *list_context, + uint32_t pos) +{ + assert(client_lock.is_locked()); + pg_t actual = osdmap->raw_pg_to_pg(pg_t(pos, list_context->pool_id)); + ldout(cct, 10) << "list_objects_seek " << list_context + << " pos " << pos << " -> " << actual << dendl; + list_context->current_pg = actual.ps(); + list_context->cookie = collection_list_handle_t(); + list_context->at_end_of_pg = false; + list_context->at_end_of_pool = false; + list_context->current_pg_epoch = 0; + return list_context->current_pg; +} +void Objecter::list_objects(ListContext *list_context, Context *onfinish) +{ + assert(client_lock.is_locked()); ldout(cct, 10) << "list_objects" << dendl; ldout(cct, 20) << " pool_id " << list_context->pool_id << " pool_snap_seq " << list_context->pool_snap_seq |