]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: Clang does not (yet) support std::map::merge 21211/head
authorWillem Jan Withagen <wjw@digiware.nl>
Sun, 1 Apr 2018 12:34:48 +0000 (14:34 +0200)
committerKefu Chai <kchai@redhat.com>
Sat, 7 Apr 2018 05:25:22 +0000 (13:25 +0800)
@tchaikov found:
    libc++ still does not support "Splicing Maps and Sets",
    see https://libcxx.llvm.org/cxx1z_status.html ,
    search for "p0083r3" .

Make this case the more explicit coded.

Signed-off-by: Willem Jan Withagen <wjw@digiware.nl>
src/mds/OpenFileTable.cc

index 4bb52ba0054c929b894bb49f9f8656884417cc2b..cc64d42c523fba88090ed6d7a2df5e0cc0566206 100644 (file)
@@ -12,6 +12,7 @@
  *
  */
 
+#include "acconfig.h"
 #include "mds/CInode.h"
 #include "mds/CDir.h"
 #include "mds/MDSRank.h"
@@ -342,8 +343,13 @@ void OpenFileTable::commit(MDSInternalContextBase *c, uint64_t log_seq, int op_p
     mds->objecter->mutate(oid, oloc, op, snapc, ceph::real_clock::now(), 0,
                          gather.new_sub());
 
+#ifdef HAVE_STDLIB_MAP_SPLICING
     ctl.journaled_update.merge(ctl.to_update);
     ctl.journaled_remove.merge(ctl.to_remove);
+#else
+    ctl.journaled_update.insert(ctl.to_update.begin(), ctl.to_update.end());
+    ctl.journaled_remove.insert(ctl.to_remove.begin(), ctl.to_remove.end());
+#endif
     ctl.to_update.clear();
     ctl.to_remove.clear();
   };