{
ImageCtx *ictx = (ImageCtx *)ctx;
tracepoint(librbd, discard_enter, ictx, ictx->name.c_str(), ictx->snap_name.c_str(), ictx->read_only, ofs, len);
- if (len > std::numeric_limits<int32_t>::max()) {
+ if (len > static_cast<uint64_t>(std::numeric_limits<int32_t>::max())) {
tracepoint(librbd, discard_exit, -EINVAL);
return -EINVAL;
}
ictx->read_only, ofs, len, bl.length() <= 0 ? NULL : bl.c_str(), bl.length(),
op_flags);
if (bl.length() <= 0 || len % bl.length() ||
- len > std::numeric_limits<int>::max()) {
+ len > static_cast<size_t>(std::numeric_limits<int>::max())) {
tracepoint(librbd, writesame_exit, -EINVAL);
return -EINVAL;
}
librbd::ImageCtx *ictx = (librbd::ImageCtx *)image;
tracepoint(librbd, discard_enter, ictx, ictx->name.c_str(),
ictx->snap_name.c_str(), ictx->read_only, ofs, len);
- if (len > std::numeric_limits<int>::max()) {
+ if (len > static_cast<uint64_t>(std::numeric_limits<int>::max())) {
tracepoint(librbd, discard_exit, -EINVAL);
return -EINVAL;
}
ictx->read_only, ofs, len, data_len == 0 ? NULL : buf, data_len, op_flags);
if (data_len == 0 || len % data_len ||
- len > std::numeric_limits<int>::max()) {
+ len > static_cast<uint64_t>(std::numeric_limits<int>::max())) {
tracepoint(librbd, writesame_exit, -EINVAL);
return -EINVAL;
}
// which is obviously the hard part TBD..
vector<pg_t> pgs_to_check;
tmp.get_upmap_pgs(&pgs_to_check);
- if (pgs_to_check.size() < g_conf()->mon_clean_pg_upmaps_per_chunk * 2) {
+ if (pgs_to_check.size() <
+ static_cast<uint64_t>(g_conf()->mon_clean_pg_upmaps_per_chunk * 2)) {
// not enough pgs, do it inline
tmp.clean_pg_upmaps(cct, &pending_inc);
} else {