From: Kefu Chai Date: Tue, 2 Jul 2019 06:00:01 +0000 (+0800) Subject: osd/osd_types: let pg_log_t::approx_size() return uint64_t X-Git-Tag: v15.1.0~2289^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=eb5ba3a28ddbc270dd268b79906c25c6a2a73d16;p=ceph.git osd/osd_types: let pg_log_t::approx_size() return uint64_t because both `head.version` and `tail.version` are of `uint64_t`, there is no need to cast the difference between them to `size_t` which could be a 32-bit unsigned integer on 32bit platforms. also, by casting it to `size_t` makes it a little bit more difficult to compare it with `osd_pg_log_trim_max` option, which is of `uint64_t`, as `std::min()` requires both its parameters to be the same type if we want to use tempalte parameter type deduction. Signed-off-by: Kefu Chai --- diff --git a/src/osd/osd_types.h b/src/osd/osd_types.h index 26fcfd0174ea..f31fbd2f5412 100644 --- a/src/osd/osd_types.h +++ b/src/osd/osd_types.h @@ -4159,7 +4159,7 @@ public: return head.version == 0 && head.epoch == 0; } - size_t approx_size() const { + uint64_t approx_size() const { return head.version - tail.version; }