]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: Remove unnecessary assert and assignment in DBObjectMap
authorDavid Zafman <dzafman@redhat.com>
Tue, 7 Feb 2017 05:31:18 +0000 (21:31 -0800)
committerDavid Zafman <dzafman@redhat.com>
Tue, 28 Mar 2017 16:30:19 +0000 (09:30 -0700)
Fix and add comment(s)

Signed-off-by: David Zafman <dzafman@redhat.com>
(cherry picked from commit 937e6a03ea4692cc44d53faa0615f8e808c9eb03)

src/os/filestore/DBObjectMap.cc
src/os/filestore/DBObjectMap.h

index a4685b8c33671e40c951012824a16e8ea5f30023..a5a8a52cee7c806495c54ce733358b4bfd1a7dab 100644 (file)
@@ -62,8 +62,6 @@ bool DBObjectMap::check(std::ostream &out)
   KeyValueDB::Iterator iter = db->get_iterator(HOBJECT_TO_SEQ);
   for (iter->seek_to_first(); iter->valid(); iter->next()) {
     _Header header;
-    assert(header.num_children == 1);
-    header.num_children = 0; // Hack for leaf node
     bufferlist bl = iter->value();
     while (true) {
       bufferlist::iterator bliter = bl.begin();
@@ -1150,9 +1148,9 @@ DBObjectMap::Header DBObjectMap::lookup_parent(Header input)
   }
 
   Header header = Header(new _Header(), RemoveOnDelete(this));
-  header->seq = input->parent;
   bufferlist::iterator iter = out.begin()->second.begin();
   header->decode(iter);
+  assert(header->seq == input->parent);
   dout(20) << "lookup_parent: parent seq is " << header->seq << " with parent "
        << header->parent << dendl;
   in_use.insert(header->seq);
index d23a246165b876a813d4052c55ee4cf8fe2c7cbc..6c72068c885513fe9f231bb30528a79bcc6dced9 100644 (file)
@@ -30,7 +30,7 @@
  * @see user_prefix
  * @see sys_prefix
  *
- * - GHOBJECT_TO_SEQ: Contains leaf mapping from ghobject_t->hobj.seq and
+ * - HOBJECT_TO_SEQ: Contains leaf mapping from ghobject_t->header.seq and
  *                   corresponding omap header
  * - SYS_PREFIX: GLOBAL_STATE_KEY - contains next seq number
  *                                  @see State
@@ -217,7 +217,7 @@ public:
   /// Ensure that all previous operations are durable
   int sync(const ghobject_t *oid=0, const SequencerPosition *spos=0);
 
-  /// Util, list all objects, there must be no other concurrent access
+  /// Util, get all objects, there must be no other concurrent access
   int list_objects(vector<ghobject_t> *objs ///< [out] objects
     );
 
@@ -275,28 +275,29 @@ public:
     uint64_t parent;
     uint64_t num_children;
 
-    coll_t c;
     ghobject_t oid;
 
     SequencerPosition spos;
 
     void encode(bufferlist &bl) const {
+      coll_t unused;
       ENCODE_START(2, 1, bl);
       ::encode(seq, bl);
       ::encode(parent, bl);
       ::encode(num_children, bl);
-      ::encode(c, bl);
+      ::encode(unused, bl);
       ::encode(oid, bl);
       ::encode(spos, bl);
       ENCODE_FINISH(bl);
     }
 
     void decode(bufferlist::iterator &bl) {
+      coll_t unused;
       DECODE_START(2, bl);
       ::decode(seq, bl);
       ::decode(parent, bl);
       ::decode(num_children, bl);
-      ::decode(c, bl);
+      ::decode(unused, bl);
       ::decode(oid, bl);
       if (struct_v >= 2)
        ::decode(spos, bl);
@@ -307,7 +308,6 @@ public:
       f->dump_unsigned("seq", seq);
       f->dump_unsigned("parent", parent);
       f->dump_unsigned("num_children", num_children);
-      f->dump_stream("coll") << c;
       f->dump_stream("oid") << oid;
     }