]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: use min<offset_t> instead of min()
authorKefu Chai <kchai@redhat.com>
Wed, 14 Apr 2021 02:19:28 +0000 (10:19 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 15 Apr 2021 04:33:23 +0000 (12:33 +0800)
as its parameters' types might not be identical. to be specific,
the 2nd parameter's type will be an unsigned one after the c++ => yaml
migration.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/rgw/rgw_op.cc

index 1824fb1d5eef023922dc3eef5a7054b6c96a354f..f25adc06e50e1cc238d74cf075a2a2ba43fd02e3 100644 (file)
@@ -3904,7 +3904,7 @@ void RGWPutObj::execute(optional_yield y)
     if (copy_source.empty()) {
       len = get_data(data);
     } else {
-      uint64_t cur_lst = min(fst + s->cct->_conf->rgw_max_chunk_size - 1, lst);
+      off_t cur_lst = min<off_t>(fst + s->cct->_conf->rgw_max_chunk_size - 1, lst);
       op_ret = get_data(fst, cur_lst, data);
       if (op_ret < 0)
         return;