]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
kvs: ObjectWriteOPerations can't be in a VLA
authorAdam C. Emerson <aemerson@redhat.com>
Wed, 9 Nov 2016 21:36:23 +0000 (16:36 -0500)
committerAdam C. Emerson <aemerson@redhat.com>
Thu, 17 Nov 2016 00:54:31 +0000 (19:54 -0500)
Variable length arrays can only contain Plain Old data
types. ObjectOperation has a virtual destructor and is thus not Plain
Old Data.

We could also get rid of ObjectOperation's virtual destructor, since it
has no other virtual functions.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/key_value_store/kv_flat_btree_async.cc

index df54384b525bbedd952a78d8559a40edb34d2af5..c0acd4dc924bbcb62edeed9c6affa9af0877c5a0 100644 (file)
@@ -1120,7 +1120,7 @@ int KvFlatBtreeAsync::cleanup(const index_data &idata, const int &error) {
     //all changes were created except for updating the index and possibly
     //deleting the objects. roll forward.
     vector<pair<pair<int, string>, librados::ObjectWriteOperation*> > ops;
-    librados::ObjectWriteOperation owos[idata.to_delete.size() + 1];
+    vector<librados::ObjectWriteOperation> owos(idata.to_delete.size() + 1);
     for (int i = 0; i <= (int)idata.to_delete.size(); ++i) {
       ops.push_back(make_pair(pair<int, string>(0, ""), &owos[i]));
     }
@@ -1883,7 +1883,7 @@ int KvFlatBtreeAsync::set_many(const map<string, bufferlist> &in_map) {
                                 .omap.rbegin()->first);
 
       to_create.push_back(object_data(
-       to_string(client_name, client_index++)));
+       to_string(client_name, client_index++)));
       to_create[to_create.size() - 1].min_kdata =
          to_create[to_create.size() - 2].max_kdata;
     }
@@ -1893,8 +1893,8 @@ int KvFlatBtreeAsync::set_many(const map<string, bufferlist> &in_map) {
   to_create[to_create.size() - 1].max_kdata =
       to_delete[to_delete.size() - 1].max_kdata;
 
-  librados::ObjectWriteOperation owos[2 + 2 * to_delete.size()
-                                      + to_create.size()];
+  vector<librados::ObjectWriteOperation> owos(2 + 2 * to_delete.size()
+                                             + to_create.size());
   vector<pair<pair<int, string>, librados::ObjectWriteOperation*> > ops;