st->st_size = in->size;
st->st_blocks = (in->size + 511) >> 9;
}
- st->st_blksize = MAX(in->layout.stripe_unit, 4096);
+ st->st_blksize = std::max<uint32_t>(in->layout.stripe_unit, 4096);
if (dirstat)
*dirstat = in->dirstat;
/* These are always considered to be available */
stx->stx_dev = in->snapid;
- stx->stx_blksize = MAX(in->layout.stripe_unit, 4096);
+ stx->stx_blksize = std::max<uint32_t>(in->layout.stripe_unit, 4096);
/* Type bits are always set, even when CEPH_STATX_MODE is not */
stx->stx_mode = S_IFMT & in->mode;
f->readahead.set_min_readahead_size(conf->client_readahead_min);
uint64_t max_readahead = Readahead::NO_LIMIT;
if (conf->client_readahead_max_bytes) {
- max_readahead = MIN(max_readahead, (uint64_t)conf->client_readahead_max_bytes);
+ max_readahead = std::min(max_readahead, (uint64_t)conf->client_readahead_max_bytes);
}
if (conf->client_readahead_max_periods) {
- max_readahead = MIN(max_readahead, in->layout.get_period()*(uint64_t)conf->client_readahead_max_periods);
+ max_readahead = std::min(max_readahead, in->layout.get_period()*(uint64_t)conf->client_readahead_max_periods);
}
f->readahead.set_max_readahead_size(max_readahead);
vector<uint64_t> alignments;
uint64_t pos = 0;
bufferlist from_before;
while (pos < size) {
- int get = MIN(size-pos, 1048576);
+ int get = std::min<int>(size - pos, 1048576);
Mutex flock("synclient chunk_file lock");
Cond cond;
bool done;
bufferlist bl;
-
+
flock.Lock();
Context *onfinish = new C_SafeCond(&flock, &cond, &done);
client->filer->read(inode.ino, &inode.layout, CEPH_NOSNAP, pos, get, &bl, 0,
bufferlist bl;
dout(10) << "Reading at pos=0x" << std::hex << pos << std::dec << dendl;
- const uint32_t read_size = MIN(chunk_size, end - pos);
+ const uint32_t read_size = std::min<uint64_t>(chunk_size, end - pos);
C_SaferCond cond;
lock.Lock();
// Read
bufferlist j;
lseek64(fd, pos, SEEK_SET);
- uint64_t l = MIN(left, 1024*1024);
+ uint64_t l = std::min<uint64_t>(left, 1024*1024);
j.read_fd(fd, l);
// Write
uint64_t old_len = old_end - old_start;
cout << "old journal was " << old_start << "~" << old_len << std::endl;
- uint64_t new_start = ROUND_UP_TO(old_end+1, journaler.get_layout_period());
+ uint64_t new_start = round_up_to(old_end+1, journaler.get_layout_period());
cout << "new journal start will be " << new_start
<< " (" << (new_start - old_end) << " bytes past old end)" << std::endl;