]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/osd_types: let pg_log_t::approx_size() return uint64_t 28732/head
authorKefu Chai <kchai@redhat.com>
Tue, 2 Jul 2019 06:00:01 +0000 (14:00 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 2 Jul 2019 06:03:51 +0000 (14:03 +0800)
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 <kchai@redhat.com>
src/osd/osd_types.h

index 26fcfd0174ea5c6cfedd77e0849039fec02bdd95..f31fbd2f5412f38585464382c039b8193ff657d8 100644 (file)
@@ -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;
   }