]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/kstore: do not include header in omap iterator result
authorSage Weil <sage@redhat.com>
Wed, 23 Dec 2015 14:22:34 +0000 (09:22 -0500)
committerSage Weil <sage@redhat.com>
Fri, 1 Jan 2016 18:07:28 +0000 (13:07 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/os/kstore/KStore.cc

index 525cad527697ac181eee92e02bc1a9f72492322e..be5d3f19230d885811142d54d41d9bcc4a2b77c1 100644 (file)
@@ -1831,12 +1831,13 @@ int KStore::collection_list(
 
 // omap reads
 
-KStore::OmapIteratorImpl::OmapIteratorImpl(CollectionRef c, OnodeRef o, KeyValueDB::Iterator it)
+KStore::OmapIteratorImpl::OmapIteratorImpl(
+  CollectionRef c, OnodeRef o, KeyValueDB::Iterator it)
   : c(c), o(o), it(it)
 {
   RWLock::RLocker l(c->lock);
   if (o->onode.omap_head) {
-    get_omap_header(o->onode.omap_head, &head);
+    get_omap_key(o->onode.omap_head, string(), &head);
     get_omap_tail(o->onode.omap_head, &tail);
     it->lower_bound(head);
   }
@@ -2025,15 +2026,10 @@ int KStore::omap_get_keys(
   {
     KeyValueDB::Iterator it = db->get_iterator(PREFIX_OMAP);
     string head, tail;
-    get_omap_header(o->onode.omap_head, &head);
+    get_omap_key(o->onode.omap_head, string(), &head);
     get_omap_tail(o->onode.omap_head, &tail);
     it->lower_bound(head);
     while (it->valid()) {
-      if (it->key() == head) {
-       dout(30) << __func__ << "  skipping head" << dendl;
-       it->next();
-       continue;
-      }
       if (it->key() >= tail) {
        dout(30) << __func__ << "  reached tail" << dendl;
        break;