public:
explicit FDCache(CephContext *cct) : cct(cct),
- registry_shards(MAX(cct->_conf->filestore_fd_cache_shards, 1)) {
+ registry_shards(std::max<int64_t>(cct->_conf->filestore_fd_cache_shards, 1)) {
assert(cct);
cct->_conf->add_observer(this);
registry = new SharedLRU<ghobject_t, FD>[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<int64_t>((cct->_conf->filestore_fd_cache_size / registry_shards), 1));
}
}
~FDCache() override {
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<int64_t>((conf->filestore_fd_cache_size / registry_shards), 1));
}
}
// 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<int>(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
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<int>(bl.get_num_buffers(), IOV_MAX-1);
iovec *iov = new iovec[max];
int n = 0;
unsigned len = 0;
loff_t dstpos = dstoff;
while (pos < end) {
- int l = MIN(end-pos, buflen);
+ int l = std::min<int>(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) {
char buf[buflen];
while (pos < end) {
- int l = MIN(end-pos, buflen);
+ int l = std::min<int>(end-pos, buflen);
r = ::read(from, buf, l);
dout(25) << " read from " << pos << "~" << l << " got " << r << dendl;
if (r < 0) {
{
// TODO: a more elaborate hint calculation
- uint64_t hint = MIN(expected_write_size, m_filestore_max_alloc_hint_size);
+ uint64_t hint = std::min<uint64_t>(expected_write_size, m_filestore_max_alloc_hint_size);
ret = backend->set_alloc_hint(**fd, hint);
dout(20) << __FUNC__ << ": hint " << hint << " ret " << ret << dendl;