diff --git a/src/os/filestore/FDCache.h b/src/os/filestore/FDCache.h index 8e037ac78a1..723cc722f4b 100644 --- a/src/os/filestore/FDCache.h +++ b/src/os/filestore/FDCache.h @@ -56,14 +56,14 @@ private: public: explicit FDCache(CephContext *cct) : cct(cct), - registry_shards(MAX(cct->_conf->filestore_fd_cache_shards, 1)) { + registry_shards(std::max(cct->_conf->filestore_fd_cache_shards, 1)) { assert(cct); cct->_conf->add_observer(this); registry = new SharedLRU[registry_shards]; for (int i = 0; i < registry_shards; ++i) { registry[i].set_cct(cct); registry[i].set_size( - MAX((cct->_conf->filestore_fd_cache_size / registry_shards), 1)); + std::max((cct->_conf->filestore_fd_cache_size / registry_shards), 1)); } } ~FDCache() override { @@ -101,7 +101,7 @@ public: if (changed.count("filestore_fd_cache_size")) { for (int i = 0; i < registry_shards; ++i) registry[i].set_size( - MAX((conf->filestore_fd_cache_size / registry_shards), 1)); + std::max((conf->filestore_fd_cache_size / registry_shards), 1)); } } diff --git a/src/os/filestore/FileJournal.cc b/src/os/filestore/FileJournal.cc index 1b8c1bd63d9..abd48c1b26b 100644 --- a/src/os/filestore/FileJournal.cc +++ b/src/os/filestore/FileJournal.cc @@ -1228,7 +1228,7 @@ void FileJournal::write_thread_entry() // flight if we hit this limit to ensure we keep the device // saturated. while (aio_num > 0) { - int exp = MIN(aio_num * 2, 24); + int exp = std::min(aio_num * 2, 24); long unsigned min_new = 1ull << exp; uint64_t cur = aio_write_queue_bytes; dout(20) << "write_thread_entry aio throttle: aio num " << aio_num << " bytes " << aio_bytes @@ -1380,7 +1380,7 @@ int FileJournal::write_aio_bl(off64_t& pos, bufferlist& bl, uint64_t seq) dout(20) << "write_aio_bl " << pos << "~" << bl.length() << " seq " << seq << dendl; while (bl.length() > 0) { - int max = MIN(bl.get_num_buffers(), IOV_MAX-1); + int max = std::min(bl.get_num_buffers(), IOV_MAX-1); iovec *iov = new iovec[max]; int n = 0; unsigned len = 0; diff --git a/src/os/filestore/FileStore.cc b/src/os/filestore/FileStore.cc index 2320eb770b5..8e9ed56d660 100644 --- a/src/os/filestore/FileStore.cc +++ b/src/os/filestore/FileStore.cc @@ -3810,7 +3810,7 @@ int FileStore::_do_copy_range(int from, int to, uint64_t srcoff, uint64_t len, u loff_t dstpos = dstoff; while (pos < end) { - int l = MIN(end-pos, buflen); + int l = std::min(end-pos, buflen); r = safe_splice(from, &pos, pipefd[1], nullptr, l, SPLICE_F_NONBLOCK); dout(10) << " safe_splice read from " << pos << "~" << l << " got " << r << dendl; if (r < 0) { @@ -3863,7 +3863,7 @@ int FileStore::_do_copy_range(int from, int to, uint64_t srcoff, uint64_t len, u char buf[buflen]; while (pos < end) { - int l = MIN(end-pos, buflen); + int l = std::min(end-pos, buflen); r = ::read(from, buf, l); dout(25) << " read from " << pos << "~" << l << " got " << r << dendl; if (r < 0) { @@ -5724,7 +5724,7 @@ int FileStore::_set_alloc_hint(const coll_t& cid, const ghobject_t& oid, { // TODO: a more elaborate hint calculation - uint64_t hint = MIN(expected_write_size, m_filestore_max_alloc_hint_size); + uint64_t hint = std::min(expected_write_size, m_filestore_max_alloc_hint_size); ret = backend->set_alloc_hint(**fd, hint); dout(20) << __FUNC__ << ": hint " << hint << " ret " << ret << dendl;