]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cleanup: Replacing MIN,MAX with std::min,std::max 18124/head
authoramitkuma <amitkuma@redhat.com>
Thu, 5 Oct 2017 13:47:18 +0000 (19:17 +0530)
committeramitkuma <amitkuma@redhat.com>
Mon, 20 Nov 2017 12:57:49 +0000 (18:27 +0530)
Signed-off-by: Amit Kumar <amitkuma@redhat.com>
45 files changed:
src/auth/cephx/CephxKeyServer.cc
src/cls/journal/cls_journal.cc
src/common/LogClient.cc
src/common/Readahead.cc
src/include/interval_set.h
src/journal/JournalMetadata.cc
src/journal/JournalTrimmer.cc
src/librbd/Journal.cc
src/librbd/api/DiffIterate.cc
src/librbd/io/ReadResult.cc
src/librbd/object_map/CreateRequest.cc
src/librbd/operation/ResizeRequest.cc
src/librbd/operation/TrimRequest.cc
src/mds/CInode.cc
src/mds/Locker.cc
src/mds/MDCache.cc
src/mds/PurgeQueue.cc
src/mds/SnapRealm.cc
src/mds/StrayManager.cc
src/mon/MDSMonitor.cc
src/mon/MonClient.cc
src/mon/Monitor.cc
src/mon/Paxos.cc
src/msg/async/dpdk/DPDKStack.h
src/msg/async/dpdk/Packet.h
src/msg/xio/XioConnection.cc
src/os/bluestore/BitAllocator.cc
src/os/bluestore/StupidAllocator.cc
src/os/filestore/JournalingObjectStore.cc
src/os/memstore/MemStore.cc
src/osd/ECBackend.cc
src/osd/ExtentCache.h
src/osd/OSDMapMapping.cc
src/osd/PG.h
src/osdc/ObjectCacher.cc
src/osdc/Objecter.cc
src/test/librbd/fsx.cc
src/test/mon/test_mon_workloadgen.cc
src/test/objectstore/BitAllocator_test.cc
src/test/objectstore/store_test.cc
src/test/osd/TestPGLog.cc
src/test/osdc/MemWriteback.cc
src/test/rbd_mirror/test_ImageSync.cc
src/test/rgw/test_rgw_manifest.cc
src/tools/cephfs/DataScan.cc

index b3a9dc8c8e29a59cef913785422df06592b43eb6..e99d78e759fe4863711157f2649b1a49d5635f60 100644 (file)
@@ -200,7 +200,7 @@ int KeyServer::_rotate_secret(uint32_t service_id)
     } else {
       utime_t next_ttl = now;
       next_ttl += ttl;
-      ek.expiration = MAX(next_ttl, r.next().expiration);
+      ek.expiration = std::max(next_ttl, r.next().expiration);
     }
     ek.expiration += ttl;
     uint64_t secret_id = r.add(ek);
index c0bd76138678e00e2d79cd7c7383bb7846610518..398a9aed9cab751abc433cc39e1d74c58a50f8e7 100644 (file)
@@ -139,7 +139,7 @@ int expire_tags(cls_method_context_t hctx, const std::string *skip_client_id) {
       }
 
       for (auto object_position : client.commit_position.object_positions) {
-        minimum_tag_tid = MIN(minimum_tag_tid, object_position.tag_tid);
+        minimum_tag_tid = std::min(minimum_tag_tid, object_position.tag_tid);
       }
     }
     if (!vals.empty()) {
@@ -1018,7 +1018,7 @@ int journal_tag_list(cls_method_context_t hctx, bufferlist *in,
   }
 
   for (auto object_position : client.commit_position.object_positions) {
-    minimum_tag_tid = MIN(minimum_tag_tid, object_position.tag_tid);
+    minimum_tag_tid = std::min(minimum_tag_tid, object_position.tag_tid);
   }
 
   // compute minimum tags in use per-class
index b99d1d7fbf3487d72f99e9e15fe1651a8fbc49db..6ffa753623a83971af6f6d4bcad18dc87021e9e9 100644 (file)
@@ -278,7 +278,7 @@ Message *LogClient::_get_mon_log_message()
   unsigned num_unsent = last_log - last_log_sent;
   unsigned num_send;
   if (cct->_conf->mon_client_max_log_entries_per_message > 0)
-    num_send = MIN(num_unsent, (unsigned)cct->_conf->mon_client_max_log_entries_per_message);
+    num_send = std::min(num_unsent, (unsigned)cct->_conf->mon_client_max_log_entries_per_message);
   else
     num_send = num_unsent;
 
index 9318bbf545ebd2171a4a17313221f05a8ec5f2d3..c4e331946fb03087cc121b0bbd818dc19b89f1b3 100644 (file)
@@ -82,8 +82,8 @@ Readahead::extent_t Readahead::_compute_readahead(uint64_t limit) {
          m_readahead_pos = m_last_pos;
        }
       }
-      m_readahead_size = MAX(m_readahead_size, m_readahead_min_bytes);
-      m_readahead_size = MIN(m_readahead_size, m_readahead_max_bytes);
+      m_readahead_size = std::max(m_readahead_size, m_readahead_min_bytes);
+      m_readahead_size = std::min(m_readahead_size, m_readahead_max_bytes);
       readahead_offset = m_readahead_pos;
       readahead_length = m_readahead_size;
 
index aca7e0699c454f10d998dcafbb1c783a81e308de..527b2a62eadecaf54a663981cd40049e726a278d 100644 (file)
@@ -600,8 +600,8 @@ class interval_set {
         continue;
       }
 
-      T start = MAX(pa->first, pb->first);
-      T en = MIN(pa->first+pa->second, pb->first+pb->second);
+      T start = std::max(pa->first, pb->first);
+      T en = std::min(pa->first+pa->second, pb->first+pb->second);
       assert(en > start);
       typename decltype(m)::value_type i{start, en - start};
       mi = m.insert(mi, i);
index 4073216bcdfb2eb561cf03fe77f0d58d62a38dc8..f03b6125a791763c6d08ce1f0a12d4a121bb2851 100644 (file)
@@ -757,8 +757,8 @@ void JournalMetadata::handle_refresh_complete(C_Refresh *refresh, int r) {
        ldout(m_cct, 0) << "client flagged disconnected: " << m_client_id
                        << dendl;
       }
-      m_minimum_set = MAX(m_minimum_set, refresh->minimum_set);
-      m_active_set = MAX(m_active_set, refresh->active_set);
+      m_minimum_set = std::max(m_minimum_set, refresh->minimum_set);
+      m_active_set = std::max(m_active_set, refresh->active_set);
       m_registered_clients = refresh->registered_clients;
       m_client = *it;
 
index 0e60a58437c9a7a51e1f8d62951649abe2630f02..6d3caed03df10e260b49c441a679f9a890ad3649 100644 (file)
@@ -111,7 +111,7 @@ void JournalTrimmer::trim_objects(uint64_t minimum_set) {
   }
 
   if (m_remove_set_pending) {
-    m_remove_set = MAX(m_remove_set, minimum_set);
+    m_remove_set = std::max(m_remove_set, minimum_set);
     return;
   }
 
index 64031efe473b98b0b25b606dcc8e5024c9939dfc..015030946222738807951e89ea8545827d400f38 100644 (file)
@@ -749,7 +749,7 @@ uint64_t Journal<I>::append_write_event(uint64_t offset, size_t length,
   uint64_t bytes_remaining = length;
   uint64_t event_offset = 0;
   do {
-    uint64_t event_length = MIN(bytes_remaining, max_write_data_size);
+    uint64_t event_length = std::min(bytes_remaining, max_write_data_size);
 
     bufferlist event_bl;
     event_bl.substr_of(bl, event_offset, event_length);
index 04b8ba450e19132e1211d62ba74ca9c789824e4e..ea7e70d5d98335077cc43e12b8c206f8658b2c16 100644 (file)
@@ -457,7 +457,7 @@ int DiffIterate<I>::diff_object_map(uint64_t from_snap_id, uint64_t to_snap_id,
     }
     object_map.resize(num_objs);
 
-    uint64_t overlap = MIN(object_map.size(), prev_object_map.size());
+    uint64_t overlap = std::min(object_map.size(), prev_object_map.size());
     for (uint64_t i = 0; i < overlap; ++i) {
       ldout(cct, 20) << __func__ << ": object state: " << i << " "
                      << static_cast<uint32_t>(prev_object_map[i])
index 3b126871d1407bd2ea27f27114de67978cf46925..f4d78562b56b0cea486b8034f3267dfe375b52d8 100644 (file)
@@ -62,7 +62,7 @@ struct ReadResult::AssembleResultVisitor : public boost::static_visitor<void> {
     size_t offset = 0;
     int idx = 0;
     for (; offset < length && idx < vector.iov_count; idx++) {
-      size_t len = MIN(vector.iov[idx].iov_len, length - offset);
+      size_t len = std::min(vector.iov[idx].iov_len, length - offset);
       it.copy(len, static_cast<char *>(vector.iov[idx].iov_base));
       offset += len;
     }
index 846b49e64b138030759a30b9377cc9792bbcf66b..9d48de7782f793626074c24df6850c6221d2ce0d 100644 (file)
@@ -35,7 +35,7 @@ void CreateRequest<I>::send() {
     RWLock::WLocker snap_locker(m_image_ctx->snap_lock);
     m_snap_ids.push_back(CEPH_NOSNAP);
     for (auto it : m_image_ctx->snap_info) {
-      max_size = MAX(max_size, it.second.size);
+      max_size = std::max(max_size, it.second.size);
       m_snap_ids.push_back(it.first);
     }
 
index 07e5158c97f243aee74bbc90468666182142514f..df9ed2b9b23f3822c48929b05e1409bd32daa38a 100644 (file)
@@ -422,7 +422,7 @@ void ResizeRequest<I>::compute_parent_overlap() {
   if (image_ctx.parent == NULL) {
     m_new_parent_overlap = 0;
   } else {
-    m_new_parent_overlap = MIN(m_new_size, image_ctx.parent_md.overlap);
+    m_new_parent_overlap = std::min(m_new_size, image_ctx.parent_md.overlap);
   }
 }
 
index 9e01b163b5cd3e74b5f22e04c637e7a8ea12024a..dcf4956a6060f2186129439931e570797fc1cc51 100644 (file)
@@ -103,7 +103,7 @@ TrimRequest<I>::TrimRequest(I &image_ctx, Context *on_finish,
 {
   uint64_t period = image_ctx.get_stripe_period();
   uint64_t new_num_periods = ((m_new_size + period - 1) / period);
-  m_delete_off = MIN(new_num_periods * period, original_size);
+  m_delete_off = std::min(new_num_periods * period, original_size);
   // first object we can delete free and clear
   m_delete_start = new_num_periods * image_ctx.get_stripe_count();
   m_delete_start_min = m_delete_start;
index 581ae2d0d91505eb098ffc33ec0be194553f6452..fa6f30b41da02a5cd058667ffa3a045e6eecd06f 100644 (file)
@@ -459,7 +459,7 @@ void CInode::project_past_snaprealm_parent(SnapRealm *newparent)
       new_snap->past_parents[oldparentseq].ino = oldparent->inode->ino();
       new_snap->past_parents[oldparentseq].first = new_snap->current_parent_since;
     }
-    new_snap->current_parent_since = MAX(oldparentseq, newparent->get_last_created()) + 1;
+    new_snap->current_parent_since = std::max(oldparentseq, newparent->get_last_created()) + 1;
   }
 }
 
@@ -2538,7 +2538,7 @@ snapid_t CInode::get_oldest_snap()
   snapid_t t = first;
   if (!old_inodes.empty())
     t = old_inodes.begin()->second.first;
-  return MIN(t, oldest_snap);
+  return std::min(t, oldest_snap);
 }
 
 old_inode_t& CInode::cow_old_inode(snapid_t follows, bool cow_head)
@@ -3204,7 +3204,7 @@ int CInode::encode_inodestat(bufferlist& bl, Session *session,
 
   // max_size is min of projected, actual
   uint64_t max_size =
-    MIN(oi->client_ranges.count(client) ?
+    std::min(oi->client_ranges.count(client) ?
        oi->client_ranges[client].range.last : 0,
        pi->client_ranges.count(client) ?
        pi->client_ranges[client].range.last : 0);
@@ -3476,7 +3476,7 @@ void CInode::encode_cap_message(MClientCaps *m, Capability *cap)
   // max_size is min of projected, actual.
   uint64_t oldms = oi->client_ranges.count(client) ? oi->client_ranges[client].range.last : 0;
   uint64_t newms = pi->client_ranges.count(client) ? pi->client_ranges[client].range.last : 0;
-  m->max_size = MIN(oldms, newms);
+  m->max_size = std::min(oldms, newms);
 
   i = pauth ? pi:oi;
   m->head.mode = i->mode;
index 388f6a58bcf43bfd6377226cef16954ef5fd4db3..2ef38bc1d2de3eabf1b75278d41d1eefac8fdbb8 100644 (file)
@@ -2297,7 +2297,7 @@ uint64_t Locker::calc_new_max_size(inode_t *pi, uint64_t size)
   uint64_t max_inc = g_conf->mds_client_writeable_range_max_inc_objs;
   if (max_inc > 0) {
     max_inc *= pi->get_layout_size_increment();
-    new_max = MIN(new_max, size + max_inc);
+    new_max = std::min(new_max, size + max_inc);
   }
   return ROUND_UP_TO(new_max, pi->get_layout_size_increment());
 }
@@ -2327,7 +2327,7 @@ void Locker::calc_new_client_ranges(CInode *in, uint64_t size,
        client_writeable_range_t& oldr = latest->client_ranges[p->first];
        if (ms > oldr.range.last)
          *max_increased = true;
-       nr.range.last = MAX(ms, oldr.range.last);
+       nr.range.last = std::max(ms, oldr.range.last);
        nr.follows = oldr.follows;
       } else {
        *max_increased = true;
@@ -2353,8 +2353,8 @@ bool Locker::check_inode_max_size(CInode *in, bool force_wrlock,
   bool max_increased = false;
 
   if (update_size) {
-    new_size = size = MAX(size, new_size);
-    new_mtime = MAX(new_mtime, latest->mtime);
+    new_size = size = std::max(size, new_size);
+    new_mtime = std::max(new_mtime, latest->mtime);
     if (latest->size == new_size && latest->mtime == new_mtime)
       update_size = false;
   }
index 59ffa841ca0ae1a4473688fa7828e5ed38cac565..70becd50dd27c4e45582ca7f70a6735295f043b7 100644 (file)
@@ -1745,7 +1745,7 @@ void MDCache::project_rstat_inode_to_frag(CInode *cur, CDir *parent, snapid_t fi
 
   if (cur->last != CEPH_NOSNAP) {
     assert(cur->dirty_old_rstats.empty());
-    set<snapid_t>::const_iterator q = snaps.lower_bound(MAX(first, floor));
+    set<snapid_t>::const_iterator q = snaps.lower_bound(std::max(first, floor));
     if (q == snaps.end() || *q > cur->last)
       return;
   }
@@ -1759,7 +1759,7 @@ void MDCache::project_rstat_inode_to_frag(CInode *cur, CDir *parent, snapid_t fi
       assert(cur->is_frozen_inode());
       update = false;
     }
-    _project_rstat_inode_to_frag(*curi, MAX(first, floor), cur->last, parent,
+    _project_rstat_inode_to_frag(*curi, std::max(first, floor), cur->last, parent,
                                 linkunlink, update);
   }
 
@@ -1768,7 +1768,7 @@ void MDCache::project_rstat_inode_to_frag(CInode *cur, CDir *parent, snapid_t fi
         p != cur->dirty_old_rstats.end();
         ++p) {
       old_inode_t& old = cur->old_inodes[*p];
-      snapid_t ofirst = MAX(old.first, floor);
+      snapid_t ofirst = std::max(old.first, floor);
       set<snapid_t>::const_iterator q = snaps.lower_bound(ofirst);
       if (q == snaps.end() || *q > *p)
        continue;
@@ -1813,7 +1813,7 @@ void MDCache::_project_rstat_inode_to_frag(inode_t& inode, snapid_t ofirst, snap
     fnode_t *pf = parent->get_projected_fnode();
     if (last == CEPH_NOSNAP) {
       if (g_conf->mds_snap_rstat)
-       first = MAX(ofirst, parent->first);
+       first = std::max(ofirst, parent->first);
       else
        first = parent->first;
       prstat = &pf->rstat;
@@ -1915,7 +1915,7 @@ void MDCache::project_rstat_frag_to_inode(nest_info_t& rstat, nest_info_t& accou
     snapid_t first;
     if (last == pin->last) {
       pi = pin->get_projected_inode();
-      first = MAX(ofirst, pin->first);
+      first = std::max(ofirst, pin->first);
       if (first > pin->first) {
        old_inode_t& old = pin->cow_old_inode(first-1, cow_head);
        dout(20) << "   cloned old_inode rstat is " << old.inode.rstat << dendl;
index 657bf6e099e74ac4a4ffd1f17c4fde99b6181a5a..a3dea1107af772388e64ef96632ce0115d36a43b 100644 (file)
@@ -301,7 +301,7 @@ uint32_t PurgeQueue::_calculate_ops(const PurgeItem &item) const
     const uint64_t num = (item.size > 0) ?
       Striper::get_num_objects(item.layout, item.size) : 1;
 
-    ops_required = MIN(num, g_conf->filer_max_purge_ops);
+    ops_required = std::min(num, g_conf->filer_max_purge_ops);
 
     // Account for removing (or zeroing) backtrace
     ops_required += 1;
@@ -564,7 +564,7 @@ void PurgeQueue::update_op_limit(const MDSMap &mds_map)
 
   // User may also specify a hard limit, apply this if so.
   if (cct->_conf->mds_max_purge_ops) {
-    max_purge_ops = MIN(max_purge_ops, cct->_conf->mds_max_purge_ops);
+    max_purge_ops = std::min(max_purge_ops, cct->_conf->mds_max_purge_ops);
   }
 }
 
index df5cb12df7faea2f60d0e9bf4250dfcd4ae5b190..285743ecce1ee81dbd078954f9509d0b7f1dc4a2 100644 (file)
@@ -133,7 +133,7 @@ bool SnapRealm::_open_parents(MDSInternalContextBase *finish, snapid_t first, sn
     dout(10) << " current parent [" << srnode.current_parent_since << ",head] is " << *parent
             << " on " << *parent->inode << dendl;
     if (last >= srnode.current_parent_since &&
-       !parent->_open_parents(finish, MAX(first, srnode.current_parent_since), last))
+       !parent->_open_parents(finish, std::max(first, srnode.current_parent_since), last))
       return false;
   }
 
@@ -197,8 +197,8 @@ bool SnapRealm::have_past_parents_open(snapid_t first, snapid_t last)
       return false;
     }
     SnapRealm *parent_realm = open_past_parents[p->second.ino].first;
-    if (!parent_realm->have_past_parents_open(MAX(first, p->second.first),
-                                             MIN(last, p->first)))
+    if (!parent_realm->have_past_parents_open(std::max(first, p->second.first),
+                                             std::min(last, p->first)))
       return false;
   }
 
@@ -248,12 +248,12 @@ void SnapRealm::build_snap_set(set<snapid_t> &s,
     assert(oldparent);  // call open_parents first!
     assert(oldparent->snaprealm);
     oldparent->snaprealm->build_snap_set(s, max_seq, max_last_created, max_last_destroyed,
-                                        MAX(first, p->second.first),
-                                        MIN(last, p->first));
+                                        std::max(first, p->second.first),
+                                        std::min(last, p->first));
   }
   if (srnode.current_parent_since <= last && parent)
     parent->build_snap_set(s, max_seq, max_last_created, max_last_destroyed,
-                          MAX(first, srnode.current_parent_since), last);
+                          std::max(first, srnode.current_parent_since), last);
 }
 
 
@@ -331,11 +331,11 @@ void SnapRealm::get_snap_info(map<snapid_t,SnapInfo*>& infomap, snapid_t first,
     assert(oldparent);  // call open_parents first!
     assert(oldparent->snaprealm);
     oldparent->snaprealm->get_snap_info(infomap,
-                                       MAX(first, p->second.first),
-                                       MIN(last, p->first));
+                                       std::max(first, p->second.first),
+                                       std::min(last, p->first));
   }
   if (srnode.current_parent_since <= last && parent)
-    parent->get_snap_info(infomap, MAX(first, srnode.current_parent_since), last);
+    parent->get_snap_info(infomap, std::max(first, srnode.current_parent_since), last);
 }
 
 const string& SnapRealm::get_snapname(snapid_t snapid, inodeno_t atino)
@@ -402,13 +402,13 @@ snapid_t SnapRealm::resolve_snapname(const string& n, inodeno_t atino, snapid_t
     assert(oldparent);  // call open_parents first!
     assert(oldparent->snaprealm);
     snapid_t r = oldparent->snaprealm->resolve_snapname(n, atino,
-                                                       MAX(first, p->second.first),
-                                                       MIN(last, p->first));
+                                                       std::max(first, p->second.first),
+                                                       std::min(last, p->first));
     if (r)
       return r;
   }
   if (parent && srnode.current_parent_since <= last)
-    return parent->resolve_snapname(n, atino, MAX(first, srnode.current_parent_since), last);
+    return parent->resolve_snapname(n, atino, std::max(first, srnode.current_parent_since), last);
   return 0;
 }
 
index 51fed4ba5a0c43658f45a943881c54a0d8b4987a..e1cd070c18c49ed0b62d0a9e45aa97ec48fc3164 100644 (file)
@@ -118,11 +118,11 @@ void StrayManager::purge(CDentry *dn)
     uint64_t to = 0;
     if (in->is_file()) {
       to = in->inode.get_max_size();
-      to = MAX(in->inode.size, to);
+      to = std::max(in->inode.size, to);
       // when truncating a file, the filer does not delete stripe objects that are
       // truncated to zero. so we need to purge stripe objects up to the max size
       // the file has ever been.
-      to = MAX(in->inode.max_size_ever, to);
+      to = std::max(in->inode.max_size_ever, to);
     }
 
     inode_t *pi = in->get_projected_inode();
@@ -719,11 +719,11 @@ void StrayManager::truncate(CDentry *dn)
   const SnapContext *snapc = &realm->get_snap_context();
 
   uint64_t to = in->inode.get_max_size();
-  to = MAX(in->inode.size, to);
+  to = std::max(in->inode.size, to);
   // when truncating a file, the filer does not delete stripe objects that are
   // truncated to zero. so we need to purge stripe objects up to the max size
   // the file has ever been.
-  to = MAX(in->inode.max_size_ever, to);
+  to = std::max(in->inode.max_size_ever, to);
 
   assert(to > 0);
 
index 4159d341d00da9a492a7bbb7e23fce0e02ebce2c..226a0ddfd39c6a9fe34f0e3beb0fb125ae1b2128 100644 (file)
@@ -1816,11 +1816,11 @@ void MDSMonitor::maybe_replace_gid(mds_gid_t gid, const MDSMap::mds_info_t& info
   // getting beacons through recently.
   utime_t latest_beacon;
   for (const auto & i : last_beacon) {
-    latest_beacon = MAX(i.second.stamp, latest_beacon);
+    latest_beacon = std::max(i.second.stamp, latest_beacon);
   }
   const bool may_replace = latest_beacon >
     (ceph_clock_now() -
-     MAX(g_conf->mds_beacon_interval, g_conf->mds_beacon_grace * 0.5));
+     std::max(g_conf->mds_beacon_interval, g_conf->mds_beacon_grace * 0.5));
 
   // are we in?
   // and is there a non-laggy standby that can take over for us?
index 250620cb56b7a47c3fd460516b73db6e13a383de..35323e9c4de18eb3bd1cc92ff9cc9669ce1a94d8 100644 (file)
@@ -880,7 +880,7 @@ int MonClient::_check_auth_rotating()
 
   utime_t now = ceph_clock_now();
   utime_t cutoff = now;
-  cutoff -= MIN(30.0, cct->_conf->auth_service_ticket_ttl / 4.0);
+  cutoff -= std::min(30.0, cct->_conf->auth_service_ticket_ttl / 4.0);
   utime_t issued_at_lower_bound = now;
   issued_at_lower_bound -= cct->_conf->auth_service_ticket_ttl;
   if (!rotating_secrets->need_new_secrets(cutoff)) {
index ac8339a77d5e310744ec9e5a4c7c40997f39e5ea..ae6f24a5fe5f4693709a1a6fa9fbf13bfbf52867 100644 (file)
@@ -1177,7 +1177,7 @@ void Monitor::sync_start(entity_inst_t &other, bool full)
     sync_stash_critical_state(t);
     t->put("mon_sync", "in_sync", 1);
 
-    sync_last_committed_floor = MAX(sync_last_committed_floor, paxos->get_version());
+    sync_last_committed_floor = std::max(sync_last_committed_floor, paxos->get_version());
     dout(10) << __func__ << " marking sync in progress, storing sync_last_committed_floor "
             << sync_last_committed_floor << dendl;
     t->put("mon_sync", "last_committed_floor", sync_last_committed_floor);
index cf27d3f36d2603a755335517dba0643048bad314..3a9968e0a533cde26a21ebda9ef71c417dd7ee88 100644 (file)
@@ -180,7 +180,7 @@ void Paxos::collect(version_t oldpn)
   }
 
   // pick new pn
-  accepted_pn = get_new_proposal_number(MAX(accepted_pn, oldpn));
+  accepted_pn = get_new_proposal_number(std::max(accepted_pn, oldpn));
   accepted_pn_from = last_committed;
   num_last = 1;
   dout(10) << "collect with pn " << accepted_pn << dendl;
@@ -1225,7 +1225,7 @@ void Paxos::lease_renew_timeout()
 void Paxos::trim()
 {
   assert(should_trim());
-  version_t end = MIN(get_version() - g_conf->paxos_min,
+  version_t end = std::min(get_version() - g_conf->paxos_min,
                      get_first_committed() + g_conf->paxos_trim_max);
 
   if (first_committed >= end)
index af5a5fd2400224a8d8dd8ddbdfe5de7eac748eae..73759128fde0d59be025435680c118536b3196db 100644 (file)
@@ -147,7 +147,7 @@ class NativeConnectedSocketImpl : public ConnectedSocketImpl {
         // space for next ptr.
         if (len > 0)
           break;
-        seglen = MIN(seglen, available);
+        seglen = std::min(seglen, available);
       }
       len += seglen;
       frags.push_back(fragment{(char*)pb->c_str(), seglen});
index b8134573fa32f7910554b7fbdfde26d3c5726fef..000329b4cfd372734a3fee243c611f0c4cec1449 100644 (file)
@@ -125,7 +125,7 @@ class Packet {
     pseudo_vector fragments() { return { frags, _nr_frags }; }
 
     static std::unique_ptr<impl> allocate(size_t nr_frags) {
-      nr_frags = MAX(nr_frags, default_nr_frags);
+      nr_frags = std::max(nr_frags, default_nr_frags);
       return std::unique_ptr<impl>(new (nr_frags) impl(nr_frags));
     }
 
index 7964a15901a72e0fbd8eb816c608b9daeb523da7..25ac21544917a9434718bba1096719d6dfb84605 100644 (file)
@@ -344,7 +344,7 @@ int XioConnection::handle_data_msg(struct xio_session *session,
        * split due to coalescing of a segment (front, middle,
        * data) boundary */
 
-      take_len = MIN(blen, msg_iov->iov_len);
+      take_len = std::min(blen, msg_iov->iov_len);
       payload.append(
        buffer::create_msg(
          take_len, (char*) msg_iov->iov_base, m_hook));
@@ -386,7 +386,7 @@ int XioConnection::handle_data_msg(struct xio_session *session,
     iovs = vmsg_sglist(&tmsg->in);
     for (; blen && (ix < iov_len); ++ix) {
       msg_iov = &iovs[ix];
-      take_len = MIN(blen, msg_iov->iov_len);
+      take_len = std::min(blen, msg_iov->iov_len);
       middle.append(
        buffer::create_msg(
          take_len, (char*) msg_iov->iov_base, m_hook));
index aeec038dc951562e5d4310e2ed8e3600c506a784..8ab77ae2a018eaa5f4a95c80a9ed2a46f0d67857 100644 (file)
@@ -335,7 +335,7 @@ bool BitMapZone::is_allocated(int64_t start_block, int64_t num_blocks)
   while (num_blocks) {
     bit = start_block % BmapEntry::size();
     bmap = &m_bmap_vec[start_block / BmapEntry::size()];
-    falling_in_bmap = MIN(num_blocks, BmapEntry::size() - bit);
+    falling_in_bmap = std::min(num_blocks, BmapEntry::size() - bit);
 
     if (!bmap->is_allocated(bit, falling_in_bmap)) {
       return false;
@@ -358,7 +358,7 @@ void BitMapZone::set_blocks_used(int64_t start_block, int64_t num_blocks)
   while (blks) {
     bit = start_block % BmapEntry::size();
     bmap = &m_bmap_vec[start_block / BmapEntry::size()];
-    falling_in_bmap = MIN(blks, BmapEntry::size() - bit);
+    falling_in_bmap = std::min(blks, BmapEntry::size() - bit);
 
     bmap->set_bits(bit, falling_in_bmap);
 
@@ -384,7 +384,7 @@ void BitMapZone::free_blocks_int(int64_t start_block, int64_t num_blocks)
   while (count) {
     bit = first_blk % BmapEntry::size();
     bmap = &m_bmap_vec[first_blk / BmapEntry::size()];
-    falling_in_bmap = MIN(count, BmapEntry::size() - bit);
+    falling_in_bmap = std::min(count, BmapEntry::size() - bit);
 
     bmap->clear_bits(bit, falling_in_bmap);
 
@@ -774,7 +774,7 @@ bool BitMapAreaIN::is_allocated(int64_t start_block, int64_t num_blocks)
                     start_block / m_child_size_blocks));
 
     area_block_offset = start_block % m_child_size_blocks;
-    falling_in_area = MIN(m_child_size_blocks - area_block_offset,
+    falling_in_area = std::min(m_child_size_blocks - area_block_offset,
               num_blocks);
     if (!area->is_allocated(area_block_offset, falling_in_area)) {
       return false;
@@ -850,7 +850,7 @@ void BitMapAreaIN::set_blocks_used_int(int64_t start_block, int64_t num_blocks)
                   start_blk / m_child_size_blocks));
 
     child_block_offset = start_blk % child->size();
-    falling_in_child = MIN(m_child_size_blocks - child_block_offset,
+    falling_in_child = std::min(m_child_size_blocks - child_block_offset,
               blks);
     child->set_blocks_used(child_block_offset, falling_in_child);
     start_blk += falling_in_child;
@@ -891,7 +891,7 @@ void BitMapAreaIN::free_blocks_int(int64_t start_block, int64_t num_blocks)
 
     child_block_offset = start_block % m_child_size_blocks;
 
-    falling_in_child = MIN(m_child_size_blocks - child_block_offset,
+    falling_in_child = std::min(m_child_size_blocks - child_block_offset,
               num_blocks);
     child->free_blocks(child_block_offset, falling_in_child);
     start_block += falling_in_child;
@@ -1059,7 +1059,7 @@ void BitMapAreaLeaf::free_blocks_int(int64_t start_block, int64_t num_blocks)
 
     child_block_offset = start_block % m_child_size_blocks;
 
-    falling_in_child = MIN(m_child_size_blocks - child_block_offset,
+    falling_in_child = std::min(m_child_size_blocks - child_block_offset,
               num_blocks);
 
     child->lock_excl();
index 41962bca6c1a7daf5564eb070308d8d93a595658..fee4f0b31d9c325b175d092ae7710a35e7bf13df 100644 (file)
@@ -93,7 +93,7 @@ int64_t StupidAllocator::allocate_int(
                 << " alloc_unit 0x" << alloc_unit
                 << " hint 0x" << hint << std::dec
                 << dendl;
-  uint64_t want = MAX(alloc_unit, want_size);
+  uint64_t want = std::max(alloc_unit, want_size);
   int bin = _choose_bin(want);
   int orig_bin = bin;
 
@@ -159,7 +159,7 @@ int64_t StupidAllocator::allocate_int(
   if (skew)
     skew = alloc_unit - skew;
   *offset = p.get_start() + skew;
-  *length = MIN(MAX(alloc_unit, want_size), P2ALIGN((p.get_len() - skew), alloc_unit));
+  *length = std::min(std::max(alloc_unit, want_size), P2ALIGN((p.get_len() - skew), alloc_unit));
   if (cct->_conf->bluestore_debug_small_allocations) {
     uint64_t max =
       alloc_unit * (rand() % cct->_conf->bluestore_debug_small_allocations);
@@ -222,7 +222,7 @@ int64_t StupidAllocator::allocate(
   ExtentList block_list = ExtentList(extents, 1, max_alloc_size);
 
   while (allocated_size < want_size) {
-    res = allocate_int(MIN(max_alloc_size, (want_size - allocated_size)),
+    res = allocate_int(std::min(max_alloc_size, (want_size - allocated_size)),
        alloc_unit, hint, &offset, &length);
     if (res != 0) {
       /*
index a9c528f0482d080ccfbf287916499ce476072542..0a9aebc2deb4fe906de2727b2724b8b1f3374dd2 100644 (file)
@@ -140,7 +140,7 @@ void JournalingObjectStore::ApplyManager::op_apply_finish(uint64_t op)
   Mutex::Locker l(apply_lock);
   dout(10) << "op_apply_finish " << op << " open_ops " << open_ops << " -> "
           << (open_ops-1) << ", max_applied_seq " << max_applied_seq << " -> "
-          << MAX(op, max_applied_seq) << dendl;
+          << std::max(op, max_applied_seq) << dendl;
   --open_ops;
   assert(open_ops >= 0);
 
index e4c74149d723c2f05662ddde8bf5a858e21e0ea3..cc3425c14c1c2095403188dda276a95ecdb1fbcc 100644 (file)
@@ -1400,7 +1400,7 @@ int MemStore::_collection_add(const coll_t& cid, const coll_t& ocid, const ghobj
   CollectionRef oc = get_collection(ocid);
   if (!oc)
     return -ENOENT;
-  RWLock::WLocker l1(MIN(&(*c), &(*oc))->lock);
+  RWLock::WLocker l1(std::min(&(*c), &(*oc))->lock);
   RWLock::WLocker l2(MAX(&(*c), &(*oc))->lock);
 
   if (c->object_hash.count(oid))
@@ -1459,7 +1459,7 @@ int MemStore::_split_collection(const coll_t& cid, uint32_t bits, uint32_t match
   CollectionRef dc = get_collection(dest);
   if (!dc)
     return -ENOENT;
-  RWLock::WLocker l1(MIN(&(*sc), &(*dc))->lock);
+  RWLock::WLocker l1(std::min(&(*sc), &(*dc))->lock);
   RWLock::WLocker l2(MAX(&(*sc), &(*dc))->lock);
 
   map<ghobject_t,ObjectRef>::iterator p = sc->object_map.begin();
@@ -1727,14 +1727,14 @@ int MemStore::PageSetObject::clone(Object *src, uint64_t srcoff,
     auto dst_iter = dst_pages.begin();
 
     for (auto &src_page : tls_pages) {
-      auto sbegin = std::max(srcoff, src_page->offset);
+      auto sbegin = MAX(srcoff, src_page->offset);
       auto send = std::min(srcoff + count, src_page->offset + src_page_size);
 
       // zero-fill holes before src_page
       if (srcoff < sbegin) {
         while (dst_iter != dst_pages.end()) {
           auto &dst_page = *dst_iter;
-          auto dbegin = std::max(srcoff + delta, dst_page->offset);
+          auto dbegin = MAX(srcoff + delta, dst_page->offset);
           auto dend = std::min(sbegin + delta, dst_page->offset + dst_page_size);
           std::fill(dst_page->data + dbegin - dst_page->offset,
                     dst_page->data + dend - dst_page->offset, 0);
@@ -1750,7 +1750,7 @@ int MemStore::PageSetObject::clone(Object *src, uint64_t srcoff,
       // copy data from src page to dst pages
       while (dst_iter != dst_pages.end()) {
         auto &dst_page = *dst_iter;
-        auto dbegin = std::max(sbegin + delta, dst_page->offset);
+        auto dbegin = MAX(sbegin + delta, dst_page->offset);
         auto dend = std::min(send + delta, dst_page->offset + dst_page_size);
 
         std::copy(src_page->data + (dbegin - delta) - src_page->offset,
@@ -1773,7 +1773,7 @@ int MemStore::PageSetObject::clone(Object *src, uint64_t srcoff,
     if (count > 0) {
       while (dst_iter != dst_pages.end()) {
         auto &dst_page = *dst_iter;
-        auto dbegin = std::max(dstoff, dst_page->offset);
+        auto dbegin = MAX(dstoff, dst_page->offset);
         auto dend = std::min(dstoff + count, dst_page->offset + dst_page_size);
         std::fill(dst_page->data + dbegin - dst_page->offset,
                   dst_page->data + dend - dst_page->offset, 0);
index e30b280b21dd4bdef42c0e6ed86e6e338cdb083b..31e27b9e7f8cf83efadcac624667f25ebcb72410 100644 (file)
@@ -1483,7 +1483,7 @@ void ECBackend::submit_transaction(
   op->delta_stats = delta_stats;
   op->version = at_version;
   op->trim_to = trim_to;
-  op->roll_forward_to = MAX(roll_forward_to, committed_to);
+  op->roll_forward_to = std::max(roll_forward_to, committed_to);
   op->log_entries = log_entries;
   std::swap(op->updated_hit_set_history, hset_history);
   op->on_local_applied_sync = on_local_applied_sync;
@@ -2272,7 +2272,7 @@ struct CallClientContexts :
       trimmed.substr_of(
        bl,
        read.get<0>() - adjusted.first,
-       MIN(read.get<1>(),
+       std::min(read.get<1>(),
            bl.length() - (read.get<0>() - adjusted.first)));
       result.insert(
        read.get<0>(), trimmed.length(), std::move(trimmed));
index 4354ba6c7e6960163f9f50bb94dbc882364a9ba6..c5ab2c4915b24be1fc1d0eb02a28d145a96d6a44 100644 (file)
@@ -235,8 +235,8 @@ private:
        extent *ext = &*p;
        ++p;
 
-       uint64_t extoff = MAX(ext->offset, offset);
-       uint64_t extlen = MIN(
+       uint64_t extoff = std::max(ext->offset, offset);
+       uint64_t extlen = std::min(
          ext->length - (extoff - ext->offset),
          offset + length - extoff);
 
index bf9f4f99c38b0f4a35f94164c60809835e9d7514..beea0be130bf443f2cdd44c5d2b2d2d973eba31e 100644 (file)
@@ -160,7 +160,7 @@ void ParallelPGMapper::queue(
   bool any = false;
   for (auto& p : job->osdmap->get_pools()) {
     for (unsigned ps = 0; ps < p.second.get_pg_num(); ps += pgs_per_item) {
-      unsigned ps_end = MIN(ps + pgs_per_item, p.second.get_pg_num());
+      unsigned ps_end = std::min(ps + pgs_per_item, p.second.get_pg_num());
       job->start_one();
       wq.queue(new Item(job, p.first, ps, ps_end));
       ldout(cct, 20) << __func__ << " " << job << " " << p.first << " [" << ps
index 37cc3e9b9838698b13245bdefc5d616c5f8e95b5..c347fce01be162f00e6e1b4da04ca984a8cf9e8d 100644 (file)
@@ -1254,11 +1254,11 @@ protected:
   static pair<epoch_t, epoch_t> get_required_past_interval_bounds(
     const pg_info_t &info,
     epoch_t oldest_map) {
-    epoch_t start = MAX(
+    epoch_t start = std::max(
       info.history.last_epoch_clean ? info.history.last_epoch_clean :
        info.history.epoch_pool_created,
       oldest_map);
-    epoch_t end = MAX(
+    epoch_t end = std::max(
       info.history.same_interval_since,
       info.history.epoch_pool_created);
     return make_pair(start, end);
index 4afd1de9b6fc16e31f8dc7981a2d7093d0b7aeb5..c1664718daef237db2aff4f1a6546717f20f4bf3 100644 (file)
@@ -177,8 +177,8 @@ void ObjectCacher::Object::merge_left(BufferHead *left, BufferHead *right)
 
   // version
   // note: this is sorta busted, but should only be used for dirty buffers
-  left->last_write_tid =  MAX( left->last_write_tid, right->last_write_tid );
-  left->last_write = MAX( left->last_write, right->last_write );
+  left->last_write_tid =  std::max( left->last_write_tid, right->last_write_tid );
+  left->last_write = std::max( left->last_write, right->last_write );
 
   left->set_dontneed(right->get_dontneed() ? left->get_dontneed() : false);
   left->set_nocache(right->get_nocache() ? left->get_nocache() : false);
@@ -242,7 +242,7 @@ bool ObjectCacher::Object::is_cached(loff_t cur, loff_t left) const
 
     if (p->first <= cur) {
       // have part of it
-      loff_t lenfromcur = MIN(p->second->end() - cur, left);
+      loff_t lenfromcur = std::min(p->second->end() - cur, left);
       cur += lenfromcur;
       left -= lenfromcur;
       ++p;
@@ -332,7 +332,7 @@ int ObjectCacher::Object::map_read(ObjectExtent &ex,
         ceph_abort();
       }
 
-      loff_t lenfromcur = MIN(e->end() - cur, left);
+      loff_t lenfromcur = std::min(e->end() - cur, left);
       cur += lenfromcur;
       left -= lenfromcur;
       ++p;
@@ -342,7 +342,7 @@ int ObjectCacher::Object::map_read(ObjectExtent &ex,
       // gap.. miss
       loff_t next = p->first;
       BufferHead *n = new BufferHead(this);
-      loff_t len = MIN(next - cur, left);
+      loff_t len = std::min(next - cur, left);
       n->set_start(cur);
       n->set_length(len);
       oc->bh_add(this,n);
@@ -354,8 +354,8 @@ int ObjectCacher::Object::map_read(ObjectExtent &ex,
         missing[cur] = n;
         ldout(oc->cct, 20) << "map_read gap " << *n << dendl;
       }
-      cur += MIN(left, n->length());
-      left -= MIN(left, n->length());
+      cur += std::min(left, n->length());
+      left -= std::min(left, n->length());
       continue;    // more?
     } else {
       ceph_abort();
@@ -492,7 +492,7 @@ ObjectCacher::BufferHead *ObjectCacher::Object::map_write(ObjectExtent &ex,
     } else {
       // gap!
       loff_t next = p->first;
-      loff_t glen = MIN(next - cur, max);
+      loff_t glen = std::min(next - cur, max);
       ldout(oc->cct, 10) << "map_write gap " << cur << "~" << glen << dendl;
       if (final) {
         oc->bh_stat_sub(final);
@@ -1462,7 +1462,7 @@ int ObjectCacher::_readx(OSDRead *rd, ObjectSet *oset, Context *onfinish,
          if (success) {
            ldout(cct, 10) << "readx missed, waiting on cache to complete "
                           << waitfor_read.size() << " blocked reads, "
-                          << (MAX(rx_bytes, max_size) - max_size)
+                          << (std::max(rx_bytes, max_size) - max_size)
                           << " read bytes" << dendl;
            waitfor_read.push_back(new C_RetryRead(this, rd, oset, onfinish,
                                                   *trace));
@@ -1552,7 +1552,7 @@ int ObjectCacher::_readx(OSDRead *rd, ObjectSet *oset, Context *onfinish,
          BufferHead *bh = bh_it->second;
          assert(opos == (loff_t)(bh->start() + bhoff));
 
-         uint64_t len = MIN(f_it->second - foff, bh->length() - bhoff);
+         uint64_t len = std::min(f_it->second - foff, bh->length() - bhoff);
          ldout(cct, 10) << "readx rmap opos " << opos << ": " << *bh << " +"
                         << bhoff << " frag " << f_it->first << "~"
                         << f_it->second << " +" << foff << "~" << len
index 03baa7800475936dfaab7925ce0f1d1d9428498e..4fd95c34edfafc0085ee4733268986ee894d923e 100644 (file)
@@ -747,7 +747,7 @@ int Objecter::linger_check(LingerOp *info)
 
   ceph::coarse_mono_time stamp = info->watch_valid_thru;
   if (!info->watch_pending_async.empty())
-    stamp = MIN(info->watch_valid_thru, info->watch_pending_async.front());
+    stamp = std::min(info->watch_valid_thru, info->watch_pending_async.front());
   auto age = ceph::coarse_mono_clock::now() - stamp;
 
   ldout(cct, 10) << __func__ << " " << info->linger_id
index e5bd71bbf5046d4cc5956b28430e8a2b29d252f7..c6641966e912d2f2249c2ccb8c5b446d937a1e0e 100644 (file)
@@ -2309,7 +2309,7 @@ check_clone(int clonenum, bool replay_image)
 
        good_buf = NULL;
        ret = posix_memalign((void **)&good_buf,
-                            MAX(writebdy, (int)sizeof(void *)),
+                            std::max(writebdy, (int)sizeof(void *)),
                             file_info.st_size);
        if (ret > 0) {
                prterrcode("check_clone: posix_memalign(good_buf)", -ret);
@@ -2318,7 +2318,7 @@ check_clone(int clonenum, bool replay_image)
 
        temp_buf = NULL;
        ret = posix_memalign((void **)&temp_buf,
-                            MAX(readbdy, (int)sizeof(void *)),
+                            std::max(readbdy, (int)sizeof(void *)),
                             file_info.st_size);
        if (ret > 0) {
                prterrcode("check_clone: posix_memalign(temp_buf)", -ret);
@@ -2994,7 +2994,7 @@ main(int argc, char **argv)
                original_buf[i] = get_random() % 256;
 
        ret = posix_memalign((void **)&good_buf,
-                            MAX(writebdy, (int)sizeof(void *)), maxfilelen);
+                            std::max(writebdy, (int)sizeof(void *)), maxfilelen);
        if (ret > 0) {
                if (ret == EINVAL)
                        prt("writebdy is not a suitable power of two\n");
@@ -3005,7 +3005,7 @@ main(int argc, char **argv)
        memset(good_buf, '\0', maxfilelen);
 
        ret = posix_memalign((void **)&temp_buf,
-                            MAX(readbdy, (int)sizeof(void *)), maxfilelen);
+                            std::max(readbdy, (int)sizeof(void *)), maxfilelen);
        if (ret > 0) {
                if (ret == EINVAL)
                        prt("readbdy is not a suitable power of two\n");
index 5984a26aa936308a0a0d3278c4371b73995300ae..64ff693d77deb0b4f1e66a06832118213d6d157b 100644 (file)
@@ -809,7 +809,7 @@ class OSDStub : public TestStub
       }
     }
 
-    epoch_t start_full = MAX(osdmap.get_epoch() + 1, first);
+    epoch_t start_full = std::max(osdmap.get_epoch() + 1, first);
 
     if (m->maps.size() > 0) {
       map<epoch_t,bufferlist>::reverse_iterator rit;
index 34a3a4a7e5c342e5517755ad9eeb1753949390e9..14041b6c2af116b2c4f04e08ba86bc3659fc3a8a 100644 (file)
@@ -432,7 +432,7 @@ TEST(BitAllocator, test_bmap_alloc)
         ExtentList *block_list = new ExtentList(&extents, blk_size, alloc_size);
         for (int64_t i = 0; i < total_blocks; i += alloc_size) {
           bmap_test_assert(alloc->reserve_blocks(alloc_size) == true);
-          allocated = alloc->alloc_blocks_dis_res(alloc_size, MIN(alloc_size, zone_size),
+          allocated = alloc->alloc_blocks_dis_res(alloc_size, std::min(alloc_size, zone_size),
                                                   0, block_list);
           bmap_test_assert(alloc_size == allocated);
           bmap_test_assert(block_list->get_extent_count() == 
index be8971b781c0bc91021db4f9881d3aece86ed2e8..f34eb8b44ec4045fe86d8307a45431faa30b9624 100644 (file)
@@ -62,7 +62,7 @@ static bool bl_eq(bufferlist& expected, bufferlist& actual)
          << "expected 0x" << expected.length() << " != actual 0x"
          << actual.length() << std::dec << dendl;
   }
-  auto len = MIN(expected.length(), actual.length());
+  auto len = std::min(expected.length(), actual.length());
   while ( first<len && expected[first] == actual[first])
     ++first;
   unsigned last = len;
index 4d7a858a520f9cf303febc6bc18ba560eb809d33..a72b07a23dd143b039ac40c6161772dc912403bb 100644 (file)
@@ -2446,13 +2446,13 @@ public:
 
   void add_dups(uint a, uint b) {
     log.dups.push_back(create_dup_entry(a, b));
-    write_from_dups = MIN(write_from_dups, log.dups.back().version);
+    write_from_dups = std::min(write_from_dups, log.dups.back().version);
   }
 
   void add_dups(const std::vector<pg_log_dup_t>& l) {
     for (auto& i : l) {
       log.dups.push_back(i);
-      write_from_dups = MIN(write_from_dups, log.dups.back().version);
+      write_from_dups = std::min(write_from_dups, log.dups.back().version);
     }
   }
 
index f8f9844b30c780a94adab8835b2c75f30108ee5b..0f479e3684d0f6a60faeff185cb55c284ca3fed0 100644 (file)
@@ -156,7 +156,7 @@ int MemWriteback::read_object_data(const object_t& oid, uint64_t off, uint64_t l
   const bufferlist& obj_bl = obj_i->second;
   dout(1) << "reading " << oid << " from total size " << obj_bl.length() << dendl;
 
-  uint64_t read_len = MIN(len, obj_bl.length()-off);
+  uint64_t read_len = std::min(len, obj_bl.length()-off);
   data_bl->substr_of(obj_bl, off, read_len);
   return 0;
 }
index d0401ef0d6050d77887cc7d9401d07a4d9da5226..67bc8fd5900482c020484ae895a11c9f62513007 100644 (file)
@@ -28,7 +28,7 @@ namespace {
 
 void scribble(librbd::ImageCtx *image_ctx, int num_ops, size_t max_size)
 {
-  max_size = MIN(image_ctx->size, max_size);
+  max_size = std::min(image_ctx->size, max_size);
   for (int i=0; i<num_ops; i++) {
     uint64_t off = rand() % (image_ctx->size - max_size + 1);
     uint64_t len = 1 + rand() % max_size;
index 7c4cc9c9fd610447410e74f72b347b35a0d9cddc..0744030820a4376571cd85b53dd2132089bc063d 100644 (file)
@@ -157,7 +157,7 @@ static void gen_obj(test_rgw_env& env, uint64_t obj_size, uint64_t head_max_size
     rgw_raw_obj test_raw = rgw_obj_select(*iter).get_raw_obj(env.zonegroup, env.zone_params);
     ASSERT_TRUE(obj == test_raw);
 
-    ofs = MIN(ofs + gen->cur_stripe_max_size(), obj_size);
+    ofs = std::min(ofs + gen->cur_stripe_max_size(), obj_size);
     gen->create_next(ofs);
 
   cout << "obj=" << obj << " *iter=" << *iter << std::endl;
@@ -174,7 +174,7 @@ static void gen_obj(test_rgw_env& env, uint64_t obj_size, uint64_t head_max_size
   }
   ASSERT_TRUE(iter == test_objs->end());
   ASSERT_EQ(manifest->get_obj_size(), obj_size);
-  ASSERT_EQ(manifest->get_head_size(), MIN(obj_size, head_max_size));
+  ASSERT_EQ(manifest->get_head_size(), std::min(obj_size, head_max_size));
   ASSERT_EQ(manifest->has_tail(), (obj_size > head_max_size));
 }
 
index d36ab36d1d3a7867bdc0d0e6eb60587ef6d779b8..760c8dc643c2dbd05f873f506bb2288b93c42c1c 100644 (file)
@@ -776,7 +776,7 @@ int DataScan::scan_inodes()
                 + (i % guessed_layout.stripe_count)
                 * guessed_layout.stripe_unit + (osize - 1)
                 % guessed_layout.stripe_unit + 1;
-              incomplete_size = MAX(incomplete_size, upper_size);
+              incomplete_size = std::max(incomplete_size, upper_size);
             }
           } else if (r == -ENOENT) {
             // Absent object, treat as size 0 and ignore.